Image preview hangs up the client if the download fails
Please first check if another issue has been opened for your problem
Versions
- OS: Linux
- Gajim version: 1.7.3
- GTK version: 3.24.37
- Python-nbxmpp version: 4.2.2
Steps to reproduce the problem
- Get an account on the server with a broken HTTP upload. For example https://5222.de/register/
- Add account to gajim.
- Connect to the server.
- Open note to myself.
- Create a small image. For example, I used this one 1.
- Send an image using HTTP upload.
Expected behavior
The image shown, or at least the client doesn't hang up.
Actual behavior
The client hangs up because it fails to download an image from the server using http2.
http1.1 works fine.
Log
05/19/2023 10:10:10(D) gajim.c.preview_helpers Guessed MIME type: image/png
05/19/2023 10:10:10(I) gajim.c.settings Set settings: app
05/19/2023 10:10:10(I) gajim.c.settings Signal: last_send_dir changed
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for reset_unread_count: 1 ms
05/19/2023 10:10:10(I) gajim.c.settings Commit
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for _commit: 1 ms
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Send keepalive
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) gajim.c.m.httpupload (5222.de) Detected MIME type of file: image/png
05/19/2023 10:10:10(D) gajim.c.ged Raise event: http-upload-started
05/19/2023 10:10:10(D) gajim.c.ged Call handler _on_http_upload_started on <gajim.gtk.control.ChatControl object at 0x7f2ef6790b90>
05/19/2023 10:10:10(I) gajim.c.m.httpupload (5222.de) Sending request for slot
05/19/2023 10:10:10(I) nbxmpp.m.httpupload (5222.de) request_slot(jid=media.5222.de, filename=image.png, size=69, content_type=image/png)
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
<iq xmlns="jabber:client" to="media.5222.de" type="get" id="**************************"><request xmlns="urn:xmpp:http:upload:0" filename="image.png" size="69" content-type="image/png" /></iq>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-sent
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-sent
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-sent
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
<r xmlns="urn:xmpp:sm:3" />
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-sent
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-sent
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-sent
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit request-history, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_conversation_before_after: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit autoscroll-changed, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for reset_unread_count: 1 ms
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Remove keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA RECEIVED ::::
<iq to='username@5222.de/gajim' id='**************************' type='result' from='media.5222.de'><slot xmlns='urn:xmpp:http:upload:0'><get url='https://media.5222.de/upload/****************/image.png'/><put url='https://media.5222.de/upload/****************/image.png'/></slot></iq>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Signal: before-dispatch
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-received
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-received
05/19/2023 10:10:10(I) gajim.c.m.httpupload (5222.de) Uploading file to https://media.5222.de/upload/****************/image.png
05/19/2023 10:10:10(I) gajim.c.m.httpupload (5222.de) Please download from https://media.5222.de/upload/****************/image.png
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Created
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Request sent, method: PUT, uri: https://media.5222.de/upload/****************/image.png
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Remove ping timer
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Start ping timer
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit request-history, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_conversation_before_after: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit autoscroll-changed, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for reset_unread_count: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit request-history, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_conversation_before_after: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit autoscroll-changed, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for reset_unread_count: 1 ms
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Remove keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA RECEIVED ::::
<r xmlns='urn:xmpp:sm:3'/>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Signal: before-dispatch
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-received
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: Smacks._send_ack
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Remove ping timer
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Start ping timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
<a xmlns="urn:xmpp:sm:3" h="20" />
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-sent
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-sent
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-sent
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Remove keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA RECEIVED ::::
<a xmlns='urn:xmpp:sm:3' h='19'/>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Signal: before-dispatch
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-received
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: Smacks._on_ack
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Remove ping timer
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Start ping timer
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for _commit: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit request-history, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_conversation_before_after: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit autoscroll-changed, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for reset_unread_count: 1 ms
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Sniffed: content-type: text/plain, content-length: 0
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Request response received
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Start downloading response body
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Body received
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Finished reading
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Message finished
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Request status: Created
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Set Complete
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(I) gajim.c.storage.archive Insert into DB: jid: username@5222.de, time: 1234567890.1234567, kind: 6, stanza_id: **************************
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for insert_into_logs: 2 ms
05/19/2023 10:10:10(D) gajim.c.ged Raise event: message-sent
05/19/2023 10:10:10(D) gajim.c.ged Call handler _on_message_sent on <main.MainWindow object at 0x7f2ef79cf6c0 (gajim+gtk+main+MainWindow at 0x3982b40)>
05/19/2023 10:10:10(D) gajim.c.ged Call handler _on_message_sent on <message_input.MessageInputTextView object at 0x7f2ef682a280 (gajim+gtk+message_input+MessageInputTextView at 0x33ba570)>
05/19/2023 10:10:10(D) gajim.c.ged Call handler _on_event on <chat_list_stack.ChatListStack object at 0x7f2ef6e167c0 (gajim+gtk+chat_list_stack+ChatListStack at 0x3ed7780)>
05/19/2023 10:10:10(D) gajim.c.preview_helpers Guessed MIME type: image/png
05/19/2023 10:10:10(D) gajim.c.ged Call handler _on_message_sent on <gajim.gtk.control.ChatControl object at 0x7f2ef6790b90>
05/19/2023 10:10:10(I) gajim.c.preview Start downloading: https://media.5222.de/upload/****************/image.png
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Created
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Request sent, method: GET, uri: https://media.5222.de/upload/****************/image.png
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for get_contact: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for get_contact: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for get_contact: 1 ms
05/19/2023 10:10:10(I) gajim.c.m.httpupload (5222.de) Upload completed successfully
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Run cleanup
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
<message xmlns="jabber:client" to="username@5222.de" type="chat" id="**************************"><body>https://media.5222.de/upload/****************/image.png</body><origin-id xmlns="urn:xmpp:sid:0" id="**************************" /><x xmlns="jabber:x:oob"><url>https://media.5222.de/upload/****************/image.png</url></x><markable xmlns="urn:xmpp:chat-markers:0" /></message>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-sent
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-sent
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-sent
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
<r xmlns="urn:xmpp:sm:3" />
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-sent
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-sent
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-sent
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit request-history, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_conversation_before_after: 1 ms
05/19/2023 10:10:10(D) gajim.gtk.conversation_view emit autoscroll-changed, (True,)
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for reset_unread_count: 1 ms
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Remove keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA RECEIVED ::::
<message from='username@5222.de/gajim' xml:lang='en' type='chat' id='**************************'><body>https://media.5222.de/upload/****************/image.png</body><origin-id xmlns='urn:xmpp:sid:0' id='**************************'/><x xmlns='jabber:x:oob'><url>https://media.5222.de/upload/****************/image.png</url></x><markable xmlns='urn:xmpp:chat-markers:0'/></message>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Signal: before-dispatch
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-received
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: BaseMessage._process_message_base
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: BaseMessage._process_message_after_base
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: OOB._process_message_oob
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: ChatMarkers._process_message_marker
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: Message._check_if_unknown_contact
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: MAM._set_message_archive_info
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: ChatMarkers._process_chat_marker
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: Message._message_received
05/19/2023 10:10:10(I) gajim.c.m.message (5222.de) Received from username@5222.de/gajim
05/19/2023 10:10:10(D) gajim.c.ged Raise event: raw-message-received
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for get_jid_id: 1 ms
05/19/2023 10:10:10(I) gajim.c.storage.archive Found duplicated message, stanza-id: None, origin-id: **************************, archive-jid: username@5222.de, account: 1
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for find_stanza_id: 1 ms
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: MAM._mam_message_received
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Remove ping timer
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Start ping timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Remove keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA RECEIVED ::::
<r xmlns='urn:xmpp:sm:3'/>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Signal: before-dispatch
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-received
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: Smacks._send_ack
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Remove ping timer
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Start ping timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA SENT ::::
<a xmlns="urn:xmpp:sm:3" h="21" />
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-sent
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-sent
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-sent
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Remove keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Add keepalive timer
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) ::::: DATA RECEIVED ::::
<a xmlns='urn:xmpp:sm:3' h='20'/>
05/19/2023 10:10:10(I) nbxmpp.connection (5222.de) Signal: data-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Signal: before-dispatch
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Signal: stanza-received
05/19/2023 10:10:10(D) gajim.c.ged Raise event: stanza-received
05/19/2023 10:10:10(I) nbxmpp.dispatcher (5222.de) Call handler: Smacks._on_ack
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Remove ping timer
05/19/2023 10:10:10(I) nbxmpp.stream (5222.de) Start ping timer
05/19/2023 10:10:10(D) gajim.c.storage.cache Execution time for _commit: 1 ms
05/19/2023 10:10:10(D) gajim.c.storage.archive Execution time for _commit: 1 ms
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Message finished
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Request response received
05/19/2023 10:10:10(E) nbxmpp.http Request(***): g-io-error-quark: HTTP/2 Error: PROTOCOL_ERROR (0)
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Set Failed: 0
05/19/2023 10:10:10(W) gajim.c.preview Download failed: https://media.5222.de/upload/****************/image.png - <HTTPRequestError.UNKNOWN: 0>
05/19/2023 10:10:10(I) nbxmpp.http Request(***): Run cleanup
(org.gajim.Gajim:5377): libsoup-WARNING **: 10:10:10.10: (../libsoup/soup-session.c:334):soup_session_dispose: runtime check failed: (soup_connection_manager_get_num_conns (priv->conn_manager) == 0)
(org.gajim.Gajim:5377): libsoup-WARNING **: 10:10:10.10: (../libsoup/soup-connection-manager.c:78):soup_host_free: runtime check failed: (host->conns == NULL)