Closed briangrossman closed 3 years ago
@pdpinch This error is not reproducible on my local machine. @shaidar Did you follow any specific steps to produce it?
@umarmughal824 On QA next I managed to run into it when uploading a pdf for a second time.
@umarmughal824 On QA next I managed to run into it when uploading a pdf for a second time.
@shaidar I have run it plenty of times
I tried today as well but it's not reproducible
I was able to regenerate the issue just for once at https://studio-mitx-qa-next.mitx.mit.edu/ but it never showed up again even after quite deliberate efforts. But just to understand the issue better I am writing my findings below:
Whenever a file is uploaded on the studio, a POST request is done which uploads the file and right after that fetches the file to verify if it is successfully uploaded. And this immediate file fetching sometimes messes up, generating the current issue.
The code that deals with the file uploading is not changed for a couple of years, but the mongo used for this purpose may have some impact.
I am not sure but a most probable issue with mongo can be the writing speed of files from mongo's master-node to mongo's servant-nodes. As the files are written to master-node and read from servant-nodes it may sometimes cause a lag/glitch.
@shaidar do you think the conspiracy theory above makes sense?
A simple solution can be just to add a retry at https://github.com/edx/edx-platform/blob/master/cms/djangoapps/contentstore/views/assets.py#L420 with a few seconds sleep.
Sounds like a race condition? I like Hamza's suggestion of doing a retry. However, I'd like to wait and see if this problem continues to occur in production first.
Closing this, as we haven't had any further reports.
Sometimes when uploading a file (in
Content
=>Files & Uploads
), the user will receive an error message, but the file appears to upload successfully.This error was reported on the Summer-2021 github: https://github.mit.edu/mitx/Summer-2021/issues/11
Details:
Got an error on upload:
But the file was uploaded:
Sar was able to reproduce it using this PDF: web-cache-poisoning.pdf and saw the following error message: