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

Crash on source selection during on_source_change #947

Closed
sssoleileraaa opened this issue Mar 17, 2020 · 0 comments · Fixed by #943
Closed

Crash on source selection during on_source_change #947

sssoleileraaa opened this issue Mar 17, 2020 · 0 comments · Fixed by #943
Labels
bug Something isn't working release blocker

Comments

@sssoleileraaa
Copy link
Contributor

Description

When clicking on a source after source deletion, the client crashes with w sqlalchemy.orm.exc.ObjectDeletedError: Instance '<Source at 0x7f0f51ed7b10>' has been deleted, or its row is otherwise not present.

Related to #906

STR

  1. NUM_SOURCES=10 make dev
  2. LOGLEVEL=debug ./run.sh --sdc-home ~/.securedrop_client (just in case you need to share logs later)
  3. Login
  4. Log out in offline mode
  5. Stop the server and run NUM_SOURCES=10 make dev
  6. Sign back in
  7. Select an old source widget (you can click around as much as you like)

Expected

For the client to keep running

Actual

Crash with the following output:

Traceback (most recent call last):
  File "/home/kdas/code/securedrop-client/securedrop_client/gui/widgets.py", line 705, in on_source_changed
    source = self.source_list.get_current_source()
  File "/home/kdas/code/securedrop-client/securedrop_client/gui/widgets.py", line 886, in get_current_source
    if source_widget and source_exists(self.controller.session, source_widget.source.uuid):
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 276, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 677, in get
    value = state._load_expired(state, passive)
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/state.py", line 660, in _load_expired
    self.manager.deferred_scalar_loader(self, toload)
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 985, in load_scalar_attributes
    raise orm_exc.ObjectDeletedError(state)
sqlalchemy.orm.exc.ObjectDeletedError: Instance '<Source at 0x7f2bd80abba8>' has been deleted, or its row is otherwise not present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant