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

Media files not served by Discovery #69

Closed
angonz opened this issue Apr 12, 2024 · 4 comments
Closed

Media files not served by Discovery #69

angonz opened this issue Apr 12, 2024 · 4 comments
Assignees

Comments

@angonz
Copy link
Contributor

angonz commented Apr 12, 2024

Media files located at /openedx/discovery/course_discovery/media are not served. Any attempt to open <discovery host>/media/... returns 404 Not Found error, even if the file exists in the correct directory.

The problem seems to be that the media directory does not exists in /openedx/discovery/course_discovery/ in a fresh new container when uwsgi is launched. Then the --static-map /media=/openedx/discovery/course_discovery/media option does not create the mapping, even if the directory is created afterwards.

I have tested adding RUN mkdir course_discovery/media to the Dockerfile and it seems to fix the problem.

@angonz
Copy link
Contributor Author

angonz commented Apr 12, 2024

I've created PR #70

@DawoudSheraz DawoudSheraz moved this from Pending Triage to In review in Tutor project management Apr 15, 2024
@Faraz32123
Copy link
Collaborator

Hi @angonz,
let me know what kind of content you were trying to upload and from where you were uploading it. And it wasn't working for you before?
Can you please attach some screenshot for the better understanding and tell the steps to reproduce this issue and its fix.

@angonz
Copy link
Contributor Author

angonz commented Apr 18, 2024

Hi @Faraz32123,
We ran tutor k8s exec discovery ./manage.py refresh_course_metadata --partner_code=openedx and tutor k8s exec discovery ./manage.py download_course_images --overwrite. We can see that the files are created in /openedx/discovery/course_discovery/media/ inside the discovery container. However they are not served in the <discovery host>/media/... url. After patching the container (just adding the /openedx/discovery/course_discovery/media directory at build time) it started to work as expected.

@Danyal-Faheem
Copy link
Contributor

Closing this issue as completed by #70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants