Error exporting/download course feedback (oppia server)

Hi Alex
I am getting an error when I try to download the Feedback Responses from the oppia server dashboard (course->Course Data Exports-> Course Activity Trackers).
I am using server version 0.12.19.

Below is the error when debugging is enabled:-

TypeError at /course/42/exports/trackers/

init() takes 1 positional argument but 4 were given

Request Method: GET
Request URL: - OppiaMobile
Django Version: 2.2.24
Exception Type: TypeError
Exception Value:

init() takes 1 positional argument but 4 were given

Exception Location: /home/staging/env/lib/python3.8/site-packages/defusedxml/ElementTree.py in init, line 68
Python Executable: /usr/bin/python3
Python Version: 3.8.10
Python Path:

[’/home/staging/django-oppia’,
‘/home/staging/env/lib/python3.8/site-packages’,
‘/usr/lib/python38.zip’,
‘/usr/lib/python3.8’,
‘/usr/lib/python3.8/lib-dynload’,
‘/usr/local/lib/python3.8/dist-packages’,
‘/usr/lib/python3/dist-packages’]

Server time: Wed, 29 Sep 2021 18:13:20 +0300

Hi @hakimks
I’m just having a look but unable to replicate on my local machine, nor the Ethiopia covid server.

But just to clarify are you downloading the course activity trackers or the course feedback - the error info relates to the course activity trackers, but then you’re referencing downloading the feedback responses download?

However the error message appears to the referencing the defusedxml package (which is used by the tabllib library I believe). So could be worth checking that the package versions you;re using are the same ones we’re using:
defusedxml - 0.5.0
tablib - 3.0.0

Anyway, let me know of you;re already using these specific versions so we can then dig into more,
Cheers,
Alex

BTW… if you’re already using the same package versions and we need to look in more detail, is it OK for you if I take one of the backup database files from S3 to restore to my machine to try to replicate the issue?

Hi Alex,
Yes am using the same package versions, you can take one of the latest backups from s3.
Both the Course Activity Trackers and Course Feedback Responses are giving the same error.


I just restored a copy of the live db to my local machine, but then realised that the issue is happening for a course that’s only on your staging server.

I tested with some of the other live courses (eg /course/36/exports/) and these appear to be working correctly. Although I noticed a separate error on /course/34/exports/ and have put this up on Jira (Log in with Atlassian account)

Could you send me a dump of your staging server db (via email!)?
Thanks,
Alex

Hi @hakimks thanks for sending through the staging db dump.

The issue appears to be related to the version of python being used… on python 3.6 the error does not occur, but it does if I switch the python environment to 3.8.

I’ve put up an issue on Jira to look more at this (Log in with Atlassian account)

I;d suggest the temporary fix for now is to switch the virtualenv back to 3.6. Also would be good if you can try on your local machine to see if you get the same results as I do when switching between 3.6 and 3.8?
Cheers,
Alex

Thanks Alex,
I will try this out when I am updating to v20 of the oppia server.
Actually it used to work on the old server which had python 3.6.