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

[0.2.1-deb] Crasher: New source temporarily appears under name of deleted source #859

Closed
eloquence opened this issue Mar 4, 2020 · 5 comments · Fixed by #890
Closed
Assignees

Comments

@eloquence
Copy link
Member

eloquence commented Mar 4, 2020

Encountered during QA. May be related to #858.

STR:

  1. Create a new source in the Source Interface (let's call it "benign artichoke")
  2. Delete the source in the client. Wait for the deletion to apparently succeed.
  3. Create a new source in the Source Interface (let's call it "surreal yo-yo")
  4. Wait for the next sync.

Expected behavior

The new source "surreal yo-yo" appears.

Actual behavior

The source "benign artichoke" re-appears with "Reply not downloaded yet" placeholder. After a while, it transitions to "surreal yo-yo" with the correct placeholder. Clicking "surreal yo-yo" crashes the client with the following stack trace. Restarting the client, we can select the source without crashing.

Mar  3 17:20:47 localhost 2020-03-03 17:20:47,208 - root:53(excepthook) ERROR: Unrecoverable error#012Traceback (most recent call last):#012  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 710, in on_source_changed#012    conversation_wrapper.conversation_view.update_conversation(source.collection)#012  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2775, in update_conversation#012    self.add_message(conversation_item, index)#012  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2815, in add_message#012    self.conversation_layout.insertWidget(index, conversation_item, alignment=Qt.AlignLeft)#012RuntimeError: wrapped C/C++ object of type QVBoxLayout has been deleted
Mar  3 17:20:47 localhost qubes.VMShell-dom0: Traceback (most recent call last):
Mar  3 17:20:47 localhost qubes.VMShell-dom0:   File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 710, in on_source_changed
Mar  3 17:20:47 localhost qubes.VMShell-dom0:     conversation_wrapper.conversation_view.update_conversation(source.collection)
Mar  3 17:20:47 localhost qubes.VMShell-dom0:   File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2775, in update_conversation
Mar  3 17:20:47 localhost qubes.VMShell-dom0:     self.add_message(conversation_item, index)
Mar  3 17:20:47 localhost qubes.VMShell-dom0:   File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2815, in add_message
Mar  3 17:20:47 localhost qubes.VMShell-dom0:     self.conversation_layout.insertWidget(index, conversation_item, alignment=Qt.AlignLeft)
Mar  3 17:20:47 localhost qubes.VMShell-dom0: RuntimeError: wrapped C/C++ object of type QVBoxLayout has been deleted

Full logs. Note that I again encountered the "failed to delete at server" timeout before the deletion succeeded.

@eloquence eloquence added bug Something isn't working security release blocker labels Mar 4, 2020
@sssoleileraaa
Copy link
Contributor

so i had a hard time repro'ing but after a few tries i did see a similar issue:

STR

  1. delete a source in the middle of your source list from the client
  2. See "Failed to delete at server"

If you don't see that the first time, repeat by deleting the source below it.

@sssoleileraaa
Copy link
Contributor

More info: I just saw that the sources ended up being removed from the source list after a long time waiting. There was no indicator of the sync retrying to connect to the server and I did not see the sync in an active state for minutes.

@sssoleileraaa
Copy link
Contributor

after leaving the client running for a while, i created a couple new sources, returned and saw the client crash with this in the logs (it was sudden and I can't remember if I clicked on logout or a source or did nothing):

2020-03-04 20:25:20,424 - securedrop_client.queue:217(resume_queues) DEBUG: Resuming main queue
2020-03-04 20:25:20,425 - securedrop_client.queue:220(resume_queues) DEBUG: Resuming download queue

2020-03-04 20:47:35,671 - securedrop_client.storage:97(get_remote_data) INFO: Fetched 4 remote sources.
2020-03-04 20:47:35,672 - securedrop_client.storage:99(get_remote_data) INFO: Fetched 11 remote submissions.
2020-03-04 20:47:35,673 - securedrop_client.storage:100(get_remote_data) INFO: Fetched 52 remote replies.

2020-03-04 20:47:35,677 - securedrop_client.storage:145(update_source_key) DEBUG: Source key data is unchanged
2020-03-04 20:47:35,677 - securedrop_client.storage:190(update_sources) DEBUG: Updated source 7224d241-f5ec-46d8-b357-b0e3d32be71f

2020-03-04 20:47:35,680 - securedrop_client.storage:145(update_source_key) DEBUG: Source key data is unchanged
2020-03-04 20:47:35,680 - securedrop_client.storage:190(update_sources) DEBUG: Updated source 2aacce10-265d-46a3-9844-9b1d3dc83921

2020-03-04 20:47:35,686 - securedrop_client.storage:145(update_source_key) DEBUG: Source key data is unchanged
2020-03-04 20:47:35,687 - securedrop_client.storage:190(update_sources) DEBUG: Updated source 8b2abb3e-1f37-4a3c-af6a-1ca62dc1eeee

2020-03-04 20:47:35,695 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint F6B0FD93C0532CF6AA76D9867F7000E093496B81
2020-03-04 20:47:35,801 - securedrop_client.storage:205(update_sources) DEBUG: Added new source ac076be0-a00d-4cbd-9f11-0d25b7b00609

2020-03-04 20:47:35,804 - securedrop_client.storage:256(__update_submissions) DEBUG: Updated submission 1cf7c94b-6d6e-4085-842a-a116f8faa25d
2020-03-04 20:47:35,806 - securedrop_client.storage:265(__update_submissions) DEBUG: Added new submission 8c4fb5d5-d1cd-4fbb-9223-2fbe8b52c782
...
2020-03-04 20:47:35,825 - securedrop_client.storage:299(update_replies) DEBUG: Updated reply 40da51f6-90f4-4bca-b03b-58345d59d17f
2020-03-04 20:47:35,826 - securedrop_client.storage:299(update_replies) DEBUG: Updated reply 311a1e28-6673-4ee3-a29e-299dfe240166
...
2020-03-04 20:47:35,933 - securedrop_client.queue:236(enqueue) DEBUG: Added MessageDownloadJob to main queue
2020-03-04 20:47:35,935 - securedrop_client.queue:217(resume_queues) DEBUG: Resuming main queue
2020-03-04 20:47:35,935 - securedrop_client.queue:220(resume_queues) DEBUG: Resuming download queue

2020-03-04 20:47:37,395 - securedrop_client.api_jobs.downloads:161(_download) INFO: File downloaded to /home/user/.securedrop_client/data/inferior_interval/1-inferior_interval-msg.txt
2020-03-04 20:47:37,544 - securedrop_client.api_jobs.downloads:180(_decrypt) INFO: File decrypted: 1-inferior_interval-msg.txt (decrypted file: )
2020-03-04 20:48:11,217 - securedrop_client.logic:462(on_sync_failure) DEBUG: The SecureDrop server cannot be reached due to Error: The request timed out.

2020-03-04 20:48:35,981 - root:53(excepthook) ERROR: Unrecoverable error
Traceback (most recent call last):
  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 711, in on_source_changed
    conversation_wrapper.conversation_view.update_conversation(source.collection)
  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2795, in update_conversation
    self.add_message(conversation_item, index)
  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2835, in add_message
    self.conversation_layout.insertWidget(index, conversation_item, alignment=Qt.AlignLeft)
RuntimeError: wrapped C/C++ object of type QVBoxLayout has been deleted

@sssoleileraaa
Copy link
Contributor

I'm starting to suspect that the issue is GUI-only because it looks like update_conversation is trying to add the new source messages to self.conversation_layout at the specified index, see

Traceback (most recent call last):
  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 711, in on_source_changed
    conversation_wrapper.conversation_view.update_conversation(source.collection)
  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2795, in update_conversation
    self.add_message(conversation_item, index)
  File "/opt/venvs/securedrop-client/lib/python3.7/site-packages/securedrop_client/gui/widgets.py", line 2835, in add_message
    self.conversation_layout.insertWidget(index, conversation_item, alignment=Qt.AlignLeft)
RuntimeError: wrapped C/C++ object of type QVBoxLayout has been deleted

This is the line of code where it fails:

        self.conversation_layout.insertWidget(index, conversation_item, alignment=Qt.AlignLeft)

Adding logs around

def on_source_changed(self):
"""
Show conversation for the currently-selected source if it hasn't been deleted. If the
current source no longer exists, clear the conversation for that source.
"""
source = self.source_list.get_current_source()
if source:
self.controller.session.refresh(source)
# Try to get the SourceConversationWrapper from the persistent dict,
# else we create it.
try:
conversation_wrapper = self.source_conversations[source]
# Redraw the conversation view such that new messages, replies, files appear.
conversation_wrapper.conversation_view.update_conversation(source.collection)
except KeyError:
conversation_wrapper = SourceConversationWrapper(source, self.controller)
self.source_conversations[source] = conversation_wrapper
self.set_conversation(conversation_wrapper)
else:
self.clear_conversation()
(specifically around whether or not we create a new SourceConversationWrapper or use an existing one from our dict here -- it appears that we're using an existing SourceConversationWrapper for a new source that has reference to a deleted layout)

@sssoleileraaa sssoleileraaa self-assigned this Mar 5, 2020
@eloquence
Copy link
Member Author

I'm unable to reproduce the original issue today (again on 0.2.1-deb), but I'm also not seeing "Failed to delete" errors today; the issue may only arise in combination with that error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants