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

add-source scheduler crashes app because of unhandled exception #1117

Closed
sssoleileraaa opened this issue Jun 16, 2020 · 0 comments · Fixed by #1114
Closed

add-source scheduler crashes app because of unhandled exception #1117

sssoleileraaa opened this issue Jun 16, 2020 · 0 comments · Fixed by #1114
Labels
bug Something isn't working

Comments

@sssoleileraaa
Copy link
Contributor

sssoleileraaa commented Jun 16, 2020

Extracting #906 (comment) from the long list of issues in #906 since there is a fix and str now:

STR

  1. Run NUM_SOURCES=50 make dev
  2. Log into the client so that 50 source widgets are create
  3. Close the client and run NUM_SOURCES=50 make dev
  4. Log into the client again

Expected

For the old source widgets to disappear and the new ones to be added

Actual

The client crashes with the following traceback:

Traceback (most recent call last):
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 859, in schedule_source_management
    new_source = SourceWidget(self.controller, source)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 1034, in __init__
    self.update()
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 1041, in update
    self.controller.session.refresh(self.source)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/.venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1675, in refresh
    "Could not refresh instance '%s'" % instance_str(instance)
sqlalchemy.exc.InvalidRequestError: Could not refresh instance '<Source at 0x7f5b46c37550>'

What's behind this?

We raise an exception in the SourceWidget.update method that we don't handle when the intial_update add-source scheduling happens, see:

and
self.source_list.initial_update(sources)

@sssoleileraaa sssoleileraaa changed the title source-add scheduler crashes because of unhandled exception add-source scheduler crashes app because of unhandled exception Jun 16, 2020
@eloquence eloquence added the bug Something isn't working label Jun 16, 2020
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants