Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lms dev static files not found #235

Open
carlos-wong opened this issue Jul 18, 2019 · 4 comments

Comments

@carlos-wong
Copy link

commented Jul 18, 2019

Bug description

I am follow https://docs.tutor.overhang.io/dev.html#prepare-the-edx-platform-repo to prepare the env for dev.

But when i am open the page the terminal log show

"GET /static/bundles/UnenrollmentFactory.e95d8e9e8ad3632637ea.js HTTP/1.1" 404 1880

Basically all the files under bundles is 404

Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
2019-07-18 11:22:02,174 INFO 121 [tracking] logger.py:50 - {"username": "", "event_type": "/dashboard", "ip": "121.35.100.32", "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36", "host": "openedxdev.lejuhub.com:8000", "referer": "http://openedxdev.lejuhub.com:8000/login?next=%2F", "accept_language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", "event": "{\"POST\": {}, \"GET\": {}}", "event_source": "server", "context": {"user_id": null, "org_id": "", "course_id": "", "path": "/dashboard"}, "time": "2019-07-18T11:22:02.173931+00:00", "page": null}
2019-07-18 11:22:02,186 WARNING 121 [py.warnings] __init__.py:200 - /openedx/venv/local/lib/python2.7/site-packages/debug_toolbar/panels/__init__.py:200: DeprecationWarning: DebugPanel was renamed to Panel.
  warnings.warn("DebugPanel was renamed to Panel.", DeprecationWarning)

[18/Jul/2019 11:22:02] "GET /dashboard HTTP/1.1" 302 0
[18/Jul/2019 11:22:03] "GET /login?next=/dashboard HTTP/1.1" 200 50585
[18/Jul/2019 11:22:03] "GET /static/common/js/vendor/jquery-migrate.js HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/css/lms-main-v1.css HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/common/js/vendor/underscore.js HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/common/js/vendor/picturefill.js HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/common/js/vendor/underscore.string.js HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/common/js/vendor/require.js HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/common/js/vendor/backbone.js HTTP/1.1" 304 0
[18/Jul/2019 11:22:03] "GET /static/bundles/commons.7dc51240caff0acca5ba.js HTTP/1.1" 404 1844
[18/Jul/2019 11:22:03] "GET /static/bundles/commons.7dc51240caff0acca5ba.js HTTP/1.1" 404 1844
2019-07-18 11:22:37,348 INFO 121 [tracking] logger.py:50 - {"username": "", "event_type": "/user_api/v1/account/login_session/", "ip": "121.35.100.32", "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36", "host": "openedxdev.lejuhub.com:8000", "referer": "http://openedxdev.lejuhub.com:8000/login?next=/dashboard", "accept_language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", "event": "{\"POST\": {\"password\": \"********\", \"email\": [\"huaixian.huang+openedx4@gmail.com\"], \"remember\": [\"false\"]}, \"GET\": {}}", "event_source": "server", "context": {"user_id": null, "org_id": "", "course_id": "", "path": "/user_api/v1/account/login_session/"}, "time": "2019-07-18T11:22:37.348282+00:00", "page": null}
2019-07-18 11:22:37,393 INFO 121 [audit] models.py:2247 - Login success - carlos-wong4 (huaixian.huang+openedx4@gmail.com)
[18/Jul/2019 11:22:37] "POST /user_api/v1/account/login_session/ HTTP/1.1" 200 0
2019-07-18 11:22:37,612 INFO 121 [tracking] logger.py:50 - {"username": "carlos-wong4", "event_type": "/dashboard", "ip": "121.35.100.32", "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36", "host": "openedxdev.lejuhub.com:8000", "referer": "http://openedxdev.lejuhub.com:8000/login?next=/dashboard", "accept_language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", "event": "{\"POST\": {}, \"GET\": {}}", "event_source": "server", "context": {"user_id": 6, "org_id": "", "course_id": "", "path": "/dashboard"}, "time": "2019-07-18T11:22:37.612719+00:00", "page": null}
2019-07-18 11:22:37,740 WARNING 121 [openedx.core.djangoapps.catalog.utils] utils.py:103 - Failed to get program UUIDs from the cache for site example.com.
[18/Jul/2019 11:22:38] "GET /dashboard HTTP/1.1" 200 31397
[18/Jul/2019 11:22:38] "GET /static/bundles/commons.7dc51240caff0acca5ba.js HTTP/1.1" 404 1844
[18/Jul/2019 11:22:38] "GET /asset-v1:edX+DemoX+Demo_Course+type@asset+block@images_course_image.jpg HTTP/1.1" 304 0
[18/Jul/2019 11:22:38] "GET /static/bundles/commons.7dc51240caff0acca5ba.js HTTP/1.1" 404 1844
[18/Jul/2019 11:22:38] "GET /static/bundles/UnenrollmentFactory.e95d8e9e8ad3632637ea.js HTTP/1.1" 404 1880
[18/Jul/2019 11:22:39] "GET /static/bundles/EntitlementUnenrollmentFactory.8436ccff2ed0b3506bcc.js HTTP/1.1" 404 1913
[18/Jul/2019 11:22:39] "GET /static/bundles/UnenrollmentFactory.e95d8e9e8ad3632637ea.js HTTP/1.1" 404 1880
[18/Jul/2019 11:22:39] "GET /static/bundles/EntitlementUnenrollmentFactory.8436ccff2ed0b3506bcc.js HTTP/1.1" 404 1913

How to reproduce

sudo tutor dev run lms pip install --requirement requirements/edx/development.txt --edx-platform-path=/home/carlos/openedx/edx-platform 
sudo tutor dev run lms python setup.py install --edx-platform-path=/home/carlos/openedx/edx-platform 
sudo tutor dev run lms paver update_assets --settings=tutor.development --edx-platform-path=/home/carlos/openedx/edx-platform 

sudo tutor dev stop && sudo tutor dev runserver lms  --edx-platform-path=/home/carlos/openedx/edx-platform

Environment

ubuntu 18.04 64bit

carlos@open-edx-dev:~/.local/share/tutor$ sudo tutor --version tutor, version 3.6.0

Additional context

I am guess the sudo tutor dev run lms paver update_assets --settings=tutor.development --edx-platform-path=/home/carlos/openedx/edx-platform is create the static files? But why only bundle folder files is 404?

@carlos-wong

This comment has been minimized.

Copy link
Author

commented Jul 20, 2019

@regisb I think I am found the error.

Because the STATIC_ROOT in tutor we use /openedx/staticfiles but this folder is generated when run local. and the

tutor dev run lms paver update_assets --settings=tutor.development --edx-platform-path=/home/carlos/openedx/edx-platform
command only update the files in container.

so after update_assets I am start the dev server the dev containers the staticfiles is reset to the prod mode created files. and the files is come with hash file name.

I am edit the lms.env.conf point the STATIC_ROOT to the edx-platform source code path. And the dev server could find the correct dev mode static files.

But I can't add this value tho config.yml to recreate the env folder

@carlos-wong

This comment has been minimized.

Copy link
Author

commented Jul 20, 2019

@regisb do you have any suggestion about this situation?

@regisb regisb added the bug label Jul 31, 2019

@regisb

This comment has been minimized.

Copy link
Collaborator

commented Aug 2, 2019

Hey @carlos-wong,
This is indeed a bug and I managed to reproduce it. Right now I don't know how to properly fix this issue: if we modify the STATIC_ROOT path, then the static assets will fail to load when edx-platform is not mounted in the container.
Let me think a bit longer about this and I'll come back with a proper answer.

@carlos-wong

This comment has been minimized.

Copy link
Author

commented Aug 3, 2019

@regisb could we detect the dev or local command to mount the staticfiles folder to container? if we use dev we mount the dir from edx-platform/common/static otherwise we don't mount the folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.