Setting up AWS S3 storage for Open edX failure

Hi all,

I follow the blog post Setting Up AWS S3 for Open edX - Blog of @lpm0073 to setup for my site. After config (lms, studio) *.yml file in /edx/etc folder and restart services, server was error (Uh oh, we are having some server issues… - the ship going down picture). I try many times, and I found the reason make that error by command was changed from the default value:

DEFAULT_FILE_STORAGE: django.core.files.storage.FileSystemStorage

to new value

DEFAULT_FILE_STORAGE: storages.backends.s3boto3.S3Boto3Storage

I prefer some articles may be related this issue:

but they can not solve. Please help me this problem.

please post the error stack trace from /edx/var/log/supervisor/lms-stderr.log

Hi @lpm0073, thanks for your reply.

The content of lastest error from /edx/var/log/supervisor/lms-stderr.log

Traceback (most recent call last):
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/arbiter.py”, line 583, in spawn_worker
worker.init_process()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/workers/base.py”, line 119, in init_process
self.load_wsgi()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/workers/base.py”, line 144, in load_wsgi
self.wsgi = self.app.wsgi()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/app/base.py”, line 67, in wsgi
self.callable = self.load()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, line 49, in load
return self.load_wsgiapp()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/gunicorn/util.py”, line 358, in import_app
mod = importlib.import_module(module)
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/edx/app/edxapp/edx-platform/lms/wsgi.py”, line 23, in
startup.run()
File “/edx/app/edxapp/edx-platform/lms/startup.py”, line 20, in run
django.setup()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/registry.py”, line 114, in populate
app_config.import_models()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/config.py”, line 211, in import_models
self.models_module = import_module(models_module_name)
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/edx/app/edxapp/edx-platform/lms/djangoapps/bulk_email/models.py”, line 19, in
from openedx.core.djangoapps.course_groups.cohorts import get_cohort_by_name
File “/edx/app/edxapp/edx-platform/openedx/core/djangoapps/course_groups/cohorts.py”, line 22, in
from lms.djangoapps.courseware import courses
File “/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/courses.py”, line 61, in
from openedx.features.course_experience.utils import is_block_structure_complete_for_assignments
File “/edx/app/edxapp/edx-platform/openedx/features/course_experience/utils.py”, line 14, in
from lms.djangoapps.course_api.blocks.api import get_blocks
File “/edx/app/edxapp/edx-platform/lms/djangoapps/course_api/blocks/api.py”, line 16, in
from .transformers.blocks_api import BlocksAPITransformer
File “/edx/app/edxapp/edx-platform/lms/djangoapps/course_api/blocks/transformers/blocks_api.py”, line 12, in
from .video_urls import VideoBlockURLTransformer
File “/edx/app/edxapp/edx-platform/lms/djangoapps/course_api/blocks/transformers/video_urls.py”, line 9, in
from xmodule.video_module.video_utils import rewrite_video_url
File “/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/video_module/init.py”, line 5, in
from .bumper_utils import *
File “/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/video_module/bumper_utils.py”, line 18, in
import edxval.api as edxval_api
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edxval/api.py”, line 31, in
from edxval.models import (
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edxval/models.py”, line 300, in
class VideoImage(TimeStampedModel):
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edxval/models.py”, line 305, in VideoImage
image = CustomizableImageField()
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edxval/models.py”, line 213, in init
storage=get_video_image_storage(),
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edxval/utils.py”, line 156, in get_video_image_storage
return get_storage_class(
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/storages/backends/s3boto3.py”, line 250, in init
check_location(self)
File “/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/storages/utils.py”, line 84, in check_location
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: S3Boto3Storage.location cannot begin with a leading slash. Found ‘/edx/var/edxapp/media//’. Use ‘edx/var/edxapp/media//’ instead.

Note the last line in the stack trace, “S3Boto3Storage.location cannot begin with a leading slash. Found ‘/edx/var/edxapp/media//’. Use ‘edx/var/edxapp/media//’ instead.”

After I replace all ‘/edx/var/edxapp/media//’ to ‘‘edx/var/edxapp/media//’ in *.yml file and restart service, the server is running as well. Thanks for your help, @lpm0073.