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

SendReplyJob failures #432

Closed
sssoleileraaa opened this issue Jun 20, 2019 · 8 comments · Fixed by #434
Closed

SendReplyJob failures #432

sssoleileraaa opened this issue Jun 20, 2019 · 8 comments · Fixed by #434
Assignees
Labels
bug Something isn't working

Comments

@sssoleileraaa
Copy link
Contributor

Description

When sending a reply fails, the follow error occurs:

  File "/home/user/securedrop-client/securedrop_client/logic.py", line 628, in on_reply_failure
    self.reply_failed.emit(reply_uuid)
TypeError: Controller.reply_failed[str].emit(): argument 1 has unexpected type 'TypeError'

Somewhere we missed this in our testing. When an exception occurs, SendReplyJob emits a signal carry with it the exception that occurred. This signal is handled by Controller.on_reply_failure which expects a uuid string.

@sssoleileraaa sssoleileraaa added the bug Something isn't working label Jun 20, 2019
@sssoleileraaa
Copy link
Contributor Author

Also related (might need to be a separate issue), the SendReplyJob fails on Qubes.

@sssoleileraaa
Copy link
Contributor Author

The exception thrown by subprocess.check_call when it tries to convert NoneType to str implicitly. This only happens on Qubes because source.fingerprint is returning None.

@sssoleileraaa sssoleileraaa self-assigned this Jun 21, 2019
@eloquence
Copy link
Member

(Pulled into current sprint as it impacts other ongoing work.)

@eloquence eloquence added this to Current Sprint - 6/12-6/26 in SecureDrop Team Board Jun 21, 2019
@redshiftzero redshiftzero moved this from Current Sprint - 6/12-6/26 to In Development in SecureDrop Team Board Jun 24, 2019
@redshiftzero
Copy link
Contributor

(current working theory on this is that the servers used for testing do not have freedomofpress/securedrop#4436 applied)

@sssoleileraaa
Copy link
Contributor Author

Confirmed. The reason source.fingerprint was returning None on Qubes was because I was testing against staging servers that were running 0.13.0 instead of 0.13.1, which started exposing the source fingerprint (see link @redshiftzero provided above).

I'm going to keep this issue open until we merge a fix for the ValueError for when we have legit exceptions during a SendReplyJob. Right now we don't actually do anything with the reply_uuid other than log, so we could continue just retruning exceptions from ApiJob and remove the expectation of a reply_uuid. I'm in favor of that for now, but let me know if you disagree!

@redshiftzero
Copy link
Contributor

It looks like the issue here is that we're emitting exceptions that are useless to the rest of the UI because it doesn't know which UUID these failures correspond to. While we could keep the exception emission (e.g. this might actually be useful to preserve for a future where we want the UI corresponding to an individual UUID element to update based on the exception that was updated), the failure slot needs to at least be getting the UUID of the item the job corresponds to. We need to make this change in the base ApiJob to emit the UUID.

@sssoleileraaa
Copy link
Contributor Author

Per discussion with @redshiftzero:

We need to implement a solution that will allow us to emit reply_uuids to the GUI when there is a failure so that the GUI can show to the user that the reply send failed. Right now ApiJobs require that a derived class raise Exceptions that it will then emit, but this will need to be modified to accommodate the failure case where we need more information than just the exception.

@sssoleileraaa
Copy link
Contributor Author

sssoleileraaa commented Jun 24, 2019

agreed! :)

right now we're just logging from the ReplyWidget, but after discussing how we eventually want to do more than log, it makes sense to keep this code in place and instead change the ApiJob interface

@sssoleileraaa sssoleileraaa moved this from In Development to Ready for review in SecureDrop Team Board Jun 25, 2019
SecureDrop Team Board automation moved this from Ready for review to Done Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants