Error importing course : logs seem not to help

Hello everyone !

I’m now stuck with the info i have, so that’s why i’m posting after searching (trust me i did :persevere:)

Here’s my issue :

I received a course which was built an another platform and i imported it the first time, it was fine as it was only text, images and links to a private vimeo.

Now that the content is satisfying, we asked for some PDF addition and now here i am with my error :

What i did to try to solve this :

  • I looked up for tutor documentation and i found a way to check the logs tutor local logs and it gave me this :

cms_1 | 37.34.63.246 - - [28/Feb/2020:14:19:07 +0000] "GET / HTTP/1.0" 400 26 "-" "Mozilla/5.0 zgrab/0.x"

cms_1 | 2020-02-28 14:23:29,088 INFO 12 [tracking] logger.py:50 - {"username": "admin", "event_type": "/import/course-v1:Fnogec+001+mooc-tresorier", "ip": "194.177.45.124", "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0", "host": "studio.formation.isidoor.org", "referer": "https://studio.formation.isidoor.org/import/course-v1:Fnogec+001+mooc-tresorier", "accept_language": "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3", "event": "{\"POST\": {}, \"GET\": {}}", "event_source": "server", "context": {"user_id": 3, "org_id": "", "course_id": "", "path": "/import/course-v1:Fnogec+001+mooc-tresorier"}, "time": "2020-02-28T14:23:29.088855+00:00", "page": null}

cms_1 | 2020-02-28 14:23:29,106 INFO 12 [contentstore.views.import_export] import_export.py:201 - Course import course-v1:Fnogec+001+mooc-tresorier: Upload complete

cms_1 | 194.177.45.124 - - [28/Feb/2020:14:23:29 +0000] "POST /import/course-v1:Fnogec+001+mooc-tresorier HTTP/1.0" 200 23 "https://studio.formation.isidoor.org/import/course-v1:Fnogec+001+mooc-tresorier" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0"

cms_1 | 2020-02-28 14:23:32,053 INFO 10 [tracking] logger.py:50 - {"username": "admin", "event_type": "/import_status/course-v1:Fnogec+001+mooc-tresorier/course.MQvxbg.tar.gz", "ip": "194.177.45.124", "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0", "host": "studio.formation.isidoor.org", "referer": "https://studio.formation.isidoor.org/import/course-v1:Fnogec+001+mooc-tresorier", "accept_language": "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3", "event": "{\"POST\": {}, \"GET\": {}}", "event_source": "server", "context": {"user_id": 3, "org_id": "", "course_id": "", "path": "/import_status/course-v1:Fnogec+001+mooc-tresorier/course.MQvxbg.tar.gz"}, "time": "2020-02-28T14:23:32.053706+00:00", "page": null}

cms_1 | 194.177.45.124 - - [28/Feb/2020:14:23:32 +0000] "GET /import_status/course-v1:Fnogec+001+mooc-tresorier/course.MQvxbg.tar.gz HTTP/1.0" 200 24 "https://studio.formation.isidoor.org/import/course-v1:Fnogec+001+mooc-tresorier" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0"

cms_1 | 2020-02-28 14:23:32,101 INFO 10 [tracking] logger.py:50 - {"username": "admin", "event_type": "/import_status/course-v1:Fnogec+001+mooc-tresorier/course.MQvxbg.tar.gz", "ip": "194.177.45.124", "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0", "host": "studio.formation.isidoor.org", "referer": "https://studio.formation.isidoor.org/import/course-v1:Fnogec+001+mooc-tresorier", "accept_language": "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3", "event": "{\"POST\": {}, \"GET\": {}}", "event_source": "server", "context": {"user_id": 3, "org_id": "", "course_id": "", "path": "/import_status/course-v1:Fnogec+001+mooc-tresorier/course.MQvxbg.tar.gz"}, "time": "2020-02-28T14:23:32.101927+00:00", "page": null}

cms_1 | 194.177.45.124 - - [28/Feb/2020:14:23:32 +0000] "GET /import_status/course-v1:Fnogec+001+mooc-tresorier/course.MQvxbg.tar.gz HTTP/1.0" 200 24 "https://studio.formation.isidoor.org/import/course-v1:Fnogec+001+mooc-tresorier" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0"

As you guys can see, it’s not as verbose as i wanted it to be. :neutral_face:

  • Then i stumbled on this but we did the same thing : checking the logs and figuring the error from there.

Do you guys have an idea on how to check more precisely what happened on the import course process ?

In advance thank you !

Hi @t-leclercq! I understand your confusion. You did well to dig into the logs of the cms container. However, the course import is a task that is performed asynchronously: not by the cms container, but by the cms_worker container. In order to debug your course import, you should look in two different places:

  1. The logs of the cms_worker container: tutor local logs cms_worker
  2. The logs of the failed celery tasks in http://localhost/admin/celery_utils/failedtask/ Or maybe it’s http://localhost/admin/djcelery/taskstate/, I’m not quite sure…
1 Like

Hi @regis ! (ravi d’avoir une réponse de ta part :smiley:)

I somehow managed to solve my error by modifying the course inside the .tar.gz that was given to me !
It is an encoding error, only happenning with PDF names :persevere:

To be accurate : i removed all accents in assets.json (inside the course archive) and in the pdf filenames.

I removed them and the course was correctly imported !
I will now make sure to reproduce it tonight in order to give you the error in cms_worker logs…

Many thanks for the explanation about the import task.

1 Like

Glad you solved this! Failing to importing French courses because of file names containing accented characters is unfortunately a frequent issue… This should be fixed in Juniper, the next Open edX named release which will run on Python 3.