-
Notifications
You must be signed in to change notification settings - Fork 687
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
unhandled FileNotFoundError when files have been manually deleted from disk #4787
Comments
There was a case with this on the SI as well (fix in for 1.6.0) - would be cool to look for other potential cases as well. |
Looks like this issue is not completely addressed: While #5549 addresses the issue for deletions, it does not address this issue for downloads. Steps to reproduce are as follows:
We may need to wrap the securedrop/securedrop/journalist_app/utils.py Line 211 in bee63b1
|
This issue is flagged with "Help Wanted". I'd be interested in working on it if no one else is. From a UX perspective, when the journalist deletes a message, they don't have to know that the corresponding file was missing. However if the file is missing when they try to download it, they will expect some sort of feedback to tell them the message cannot be downloaded. I see different possible scenarios: Missing files cases:A. One of multiple message files is missing Journalist actions:
In cases A1, A2, B2 and A5, the zip file can be produced with the remaining available message files. Opinions on the way to handle these scenarios from a UX prespective would be helpful. Thx. |
Hey @DrGFreeman thanks for the analysis and offer of help! Would be very happy to have your involvement on this. For the deletion case addressed in 1.6.0, it originally summarized any non-fatal errors in an additional flash message, after deletions were complete. That flash message was dropped to avoid reopening translations late in the release cycle, but will probably be added again for next release. A similar mechanism would probably work OK for submissions IMO but it would be cool to get @ninavizz' or others' opinions. (In A3 and B3, there would just be the error flash message.) One other thing to bear in mind is that these errors would occur in the context of an inconsistent file store on the server, so there should be:
|
Thanks from my end as well @DrGFreeman for the awesome breakdown :) It's important to note that this issue is not expected to arise on production systems, and we have no report of journalists or admins seeing these 500 errors. If it does arise, it indicates a serious issue with the file store, and possible tampering. It really does require admin involvement. We discussed this a bit at today's tech meeting and agreed that we can start with the simple possible improvement for now upon any cases where users currently see a 500 error, and that would be a catch-all error message. It would be great to get Nina's input on the wording here. @ninavizz, let's discuss a bit, I can get you up to speed. For now, DrG, you can just put in a placeholder error. What is the current behavior in collections where only some files in a collection are available? Do some of those cases you listed currently work, or do they all throw a 500? |
All cases above throw a 500. I will start working on a solution with a generic flash message for now + logging of the errors. |
That sounds great, thank you @DrGFreeman! :) |
Description
In 1.0.0, we introduced logic for an admin to check if there are files that have been deleted on disk but not had their corresponding db rows deleted. Right now in the JI, an unhandled exception will occur in the JI if a user tries to download all submissions and there are any missing files on disk.
Steps to Reproduce
Expected Behavior
All files on the server are downloaded.
Actual Behavior
500 occurs and
FileNotFoundError
is unhandledComments
I don't think this the highest priority since this is an edge case but it might be nice to add exception handling to flash a message instructing the user to get their admin to run the cleanup tool (it's easy for an admin to miss a notification in an OSSEC alert).
The text was updated successfully, but these errors were encountered: