Sandbox provisioning broken after upgrade of django-storages library to version 1.8

Description

The django-storages library was upgraded to version 1.8 from version 1.4 as part of this commit and merged to master. One of the changes in version 1.7 is to not allow media location with a leading slash. But the configuration repo used to provision sandboxes declares the media location with a leading slash (c.f. edx_media_dir variable). This is breaking the sandbox provisioning with the error:

Steps to Reproduce

Install edxapp sandbox with master branch using configuration repo.

Activity

Show:
Ned Batchelder
May 19, 2020, 8:54 PM

Also, how do I cause the error? A native Open edX installation doesn’t seem to have this error.

Pooja Kulkarni
May 20, 2020, 6:58 AM

We noticed this error while running the openedx_native.yml playbook from master branch of the configuration repo with default variables. The error is also consistent with the change pushed to version 1.7 of the django-storages library which doesn’t allow storage locations with a leading slash and the default value for edx_media_dir variable contains a leading slash (namely /edx/app/edxapp/media). The solution would be to replace the default value for edx_media_dir variable from the current {{ edxapp_data_dir }}/media to just media.

Guruprasad Lakshmi Narayanan
May 20, 2020, 2:43 PM

has a possible fix and I am currently testing it.

Guruprasad Lakshmi Narayanan
May 20, 2020, 2:45 PM

The solution would be to replace the default value for edx_media_dir variable from the current {{ edxapp_data_dir }}/media to just media.

, with the versions of django-storages before 1.7 (Ironwood uses an older version iirc), the value /edx/var/edxapp/media was automatically converted to edx/var/edxapp/media on the S3 bucket. Changing the default to just media will break existing instances when they are upgraded to Juniper. A potential fix will be to strip the leading / before passing it to the S3 configuration parameters used by django-storages and that’s what my WIP PR tries to do.

Ned Batchelder
May 20, 2020, 5:49 PM
Done

Assignee

Guruprasad Lakshmi Narayanan

Reporter

Pooja Kulkarni

Labels

None

Platform Area

None

Priority

Unset
Configure