-
Notifications
You must be signed in to change notification settings - Fork 40
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
on_reply_download_failure()
assumes exceptions have a uuid
attribute
#2274
Comments
I haven't been able to reproduce this nor obviously trace what's happening...I suppose you don't have the full traceback anymore? |
Previously: try:
reply = storage.get_reply(self.session, exception.uuid)
self.reply_download_failed.emit(reply.source.uuid, reply.uuid, str(reply))
except Exception as e: Now: reply = storage.get_reply(self.session, exception.uuid)
if reply:
self.reply_download_failed.emit(reply.source.uuid, reply.uuid, str(reply))
else: So any old AttributeError would've been caught. |
Interestingly on_file_download_failure types it as just |
Exceptions can be other types, so we should use a wider type and isinstance checks. This brings `on_message_download_failure` and `on_reply_download_failure` in line with `on_file_download_failure`. This is mostly a bandage over the regression seen in #2274 and doesn't really substitute for the lack of more coordinated error handling. Fixes #2274.
thanks, I was able to reproduce now! Digging in a bit. |
So here's the underlying traceback of the exception that then fails in the download handling:
(obtained with |
I'm going to submit two PRs, first is the one I already posted, which broadens exception handling because there are still other exceptions that can be raised that could trigger this error in the exception handling. The second will change DownloadJob.get_db_object() to use |
Our error handling expects that failures from DownloadJobs raise DownloadExceptions, so let's do that. This is roughly the same concept as a9f0590, just in a different part of the code. The exception handling has to exist in each class (instead of `one_or_none()`) because we need to know the corresponding type to pass to DownloadException. Fixes #2274.
I wasn't able to reproduce this. Following the reproduction steps, I get:
|
ugh, you even asked me @legoktm if it was okay to stop catching Exception and I said yes. Sorry, but also, thanks for figuring this out because this is better. |
Description
After #2231, a
NoResultFound
exception can cause a furtherAttributeError
insecuredrop_client.logic.Controller.on_reply_download_failure()
.Steps to Reproduce
Discovered in test runs of f6bd2c9 without this padding—
securedrop-client/client/tests/functional/test_delete_sources.py
Lines 32 to 33 in f6bd2c9
—suggesting that it's a race in downloading something that's been deleted. After #2252, reproduce with:
Expected Behavior
Either
on_reply_download_failure()
should only take aDownloadException
, or it should not assume all exceptions it handles have auuid
attribute.Actual Behavior
The text was updated successfully, but these errors were encountered: