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

Connectivity issues with too many bookmarks #1776

Open
MarcoPolo-PasTonMolo opened this issue Oct 27, 2022 · 12 comments
Open

Connectivity issues with too many bookmarks #1776

MarcoPolo-PasTonMolo opened this issue Oct 27, 2022 · 12 comments

Comments

@MarcoPolo-PasTonMolo
Copy link
Collaborator

If I have more than a particular number of bookmarks (not sure if autojoin has to be on or off, it's on for me) it my case 41 then profality loses connection whilst joining the MUCs when it reconnects it Loses connection shortly after.

Expected Behavior

Login normally

Current Behavior

Profanity loses connection while joining MUCs (sometimes even only after joining 10)

Possible Solution

Reason: maybe too many stanzas are being sent? I have no Idea

Steps to Reproduce (for bugs)

  1. Create 42 bookmarks with autojoin on
  2. Log out
  3. Log in
  4. Watch it crash

Context

For a few months couldn't get into my main account from profanity without knowing why.

Environment

Profanity, version 0.13.1dev.fix/segfault-mam.135a4cd9
Copyright (C) 2012 - 2019 James Booth [email protected].
Copyright (C) 2019 - 2022 Michael Vetter [email protected].
License GPLv3+: GNU GPL version 3 or later https://www.gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.18.0)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.10.8)
GTK icons/clipboard: Enabled
GDK Pixbuf: Enabled

@MarcoPolo-PasTonMolo MarcoPolo-PasTonMolo changed the title Cannot login when I have to many bookmarks Connectivity issues with too many bookmarsk Oct 27, 2022
@MarcoPolo-PasTonMolo MarcoPolo-PasTonMolo changed the title Connectivity issues with too many bookmarsk Connectivity issues with too many bookmarks Oct 27, 2022
@jubalh
Copy link
Member

jubalh commented Oct 27, 2022

Bad :(

BTW as a workaround: @DebXWoody had a non upstreamed patch somwhere, where he passes a flag to Profanity to not join the bookmarks upon start.

@jubalh jubalh added this to the next milestone Oct 27, 2022
@jubalh
Copy link
Member

jubalh commented Mar 10, 2023

@StefanKropp do you want to upstream your patch regarding connecting without bookmarks?

@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

I don't even think it's autojoining. As a quick workaround I tried setting

autojoin_val = TRUE;

autojoin to false and yes I don't autojoin those bookmarks but I still lose connection

@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

Upon further inspection this might be an issue with libstrophe.

@sjaeckel
Copy link
Member

sjaeckel commented Apr 3, 2023

Can you provide debug logs? We can also discuss this in the profanity MUC.

@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

I just added a break point to the line that displays the Lost connection message and got a backtrace. That line was called when we got a certain type of status from libstrophe's xmpp_connect_client, so that's why I think it's libstrophe. I can get the trace again later.

@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

Thread 1 "profanity" hit Breakpoint 1, sv_ev_lost_connection () at src/event/server_events.c:213
213         cons_show_error("Lost connection.");
(gdb) bt
#0  sv_ev_lost_connection () at src/event/server_events.c:213
#1  0x0000555555599e99 in session_lost_connection () at src/xmpp/session.c:395
#2  0x000055555559b153 in _connection_handler (xmpp_conn=<optimized out>, status=<optimized out>, error=<optimized out>, stream_error=<optimized out>, userdata=<optimized out>) at src/xmpp/connection.c:1011
#3  0x00007ffff66109f0 in xmpp_run_once () at /usr/lib/libstrophe.so.0
#4  0x000055555559b91f in connection_check_events () at src/xmpp/connection.c:160
#5  0x0000555555594114 in prof_run (log_level=0x555555627114 "WARN", account_name=<optimized out>, config_file=0x0, log_file=<optimized out>, theme_name=<optimized out>) at src/profanity.c:132
#6  0x000055555558fb1d in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:186
(gdb)

This is the last thing in the logs:

2023-04-04T10:44:53.148139+03: tls: DBG: error=SSL_ERROR_SYSCALL(5) errno=104 lasterror=0
2023-04-04T10:44:53.148172+03: xmpp: DBG: Send error occurred, disconnecting.
2023-04-04T10:44:53.148192+03: xmpp: DBG: Closing socket.
2023-04-04T10:44:53.150202+03: prof: DBG: Connection handler: XMPP_CONN_DISCONNECT
2023-04-04T10:44:53.150241+03: prof: DBG: Connection handler: Lost connection for unknown reason

@sjaeckel
Copy link
Member

sjaeckel commented Apr 4, 2023

2023-04-04T10:44:53.148139+03: tls: DBG: error=SSL_ERROR_SYSCALL(5) errno=104 lasterror=0

errno 104 is as of errno.h:87

#define	ECONNRESET	104	/* Connection reset by peer */

i.e. the connection was closed by the server. What happened before those last things in the log?

@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

Directly before it I got bunch of these:

2023-04-05T21:26:39.026896+03: prof: DBG: Presence stanza handler fired
2023-04-05T21:26:39.026912+03: prof: DBG: Room presence received from [email protected]/Wikus
2023-04-05T21:26:39.026919+03: prof: DBG: Hash sha-1 supported for [email protected]/Wikus
2023-04-05T21:26:39.026933+03: prof: DBG: Capabilities cache hit: AwrfbClCXBHs4UUGSGMLoZWmWbA=, for [email protected]/Wikus.

Another time I got some information about OMEMO like received keys or something, I don't remember well, didn't look anything like errors.

If I scroll a bunch I find some errors about glib's dates

2023-04-05T21:26:12.579932+03: stderr: ERR: 
2023-04-05T21:26:12.579961+03: stderr: ERR: (profanity:387212): GLib-CRITICAL **: 21:26:12.578: g_date_time_to_timezone: assertion 'datetime != NULL' failed
2023-04-05T21:26:12.579968+03: stderr: ERR: 
2023-04-05T21:26:12.579975+03: stderr: ERR: (profanity:387212): GLib-CRITICAL **: 21:26:12.578: g_date_time_unref: assertion 'datetime != NULL' failed
2023-04-05T21:26:12.579982+03: stderr: ERR: 
2023-04-05T21:26:12.579989+03: stderr: ERR: (profanity:387212): GLib-CRITICAL **: 21:26:12.578: g_date_time_difference: assertion 'begin != NULL' failed
2023-04-05T21:26:12.579995+03: stderr: ERR: 
2023-04-05T21:26:12.580002+03: stderr: ERR: (profanity:387212): GLib-CRITICAL **: 21:26:12.578: g_date_time_unref: assertion 'datetime != NULL' failed

Or some of this type

2023-04-05T21:26:12.505393+03: prof: ERR: IQ error received, id: gCGVHscgNO8WX1Me4021a735f045b9d8901e9c4841639892f5e2b9e, error: Administrator privileges required
2023-04-05T21:26:12.505402+03: prof: DBG: IQ affiliation list result handler fired, id: gCGVHscgNO8WX1Me4021a735f045b9d8901e9c4841639892f5e2b9e.
2023-04-05T21:26:12.505409+03: prof: DBG: Error retrieving member list for room [email protected]: Administrator privileges required

@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

Ok, now this also started happening in conversations as well so it really might be the server. What's curious though is that it only started happening in conversations a few days ago.

@jubalh jubalh removed this from the next milestone Jul 4, 2023
@MarcoPolo-PasTonMolo
Copy link
Collaborator Author

Ok idk what is happening but this was happening in conversations for only a week. Since then it never happened. Profanity on the other hand is unusable due to this issue

@andreygursky
Copy link

This reminds me of the issue while using Gajim: https://dev.gajim.org/gajim/gajim/-/issues/8758 and https://dev.gajim.org/gajim/python-nbxmpp/-/issues/45. Reasons:

  • client doesn't acknowledge received stanzas as soon as possible (fixable)
  • client is too slow to receive stanzas (hardly fixable: need to get fiber internet) or forget about have more than a dozen (or two dozens) of bookmarks
  • server has too small buffer (hardly fixable due too resource exhaustion/abusing issues but luckily (after my complaints) it has been raised a bit: Increase max_fsm_queue and max_ack_queue sizes processone/ejabberd#2028).

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

No branches or pull requests

4 participants