Ticket created by ~aereaux on ~nicoco/slidge
In slidcord (at least) when I receive a reply that includes an image, the URL is cut off. This appears to be caused by the fact that the sent XML includes a element with a begin and end even though the body does not include any fallback text (just the URL for the media).
To reproduce I just reply to a discord message (in discord) with an image. I can provide more XML or debug logs if needed.
Comment by ~aereaux on ~nicoco/slidcord
I am using cheogram but I don't think I use the stickers support. I'll see if I can get the debug logging when I have more time. But it seems to happen inconsistently now.
Comment by ~aereaux on ~nicoco/slidcord
package slidcord 0.0.0.dev0+20240829.git095eba37fa, installed using Python 3.12.5 - slidcord
Comment by ~aereaux on ~nicoco/slidcord
Whatever this is, something is causing it to happen pretty often, sometimes multiple times an hour.
Ticket created by ~aereaux on ~nicoco/slidcord
I'm getting this error, with nothing obvious triggering it:
python[1142080]: ERROR:slixmpp.stanza.rootstanza:Error handling {jabber:component:accept}iq stanza python[1142080]: Traceback (most recent call last): python[1142080]: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slixmpp/xmlstream/handler/coroutine_callback.py", line 60, in pointer_wrapper python[1142080]: await pointer(stanza) python[1142080]: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slixmpp/plugins/xep_0231/bob.py", line 148, in _handle_bob_iq python[1142080]: iq.append(data) python[1142080]: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slixmpp/xmlstream/stanzabase.py", line 1233, in append python[1142080]: raise TypeError python[1142080]: TypeError python[1142080]: ERROR:slidge.core.gateway: python[1142080]: Traceback (most recent call last): python[1142080]: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slixmpp/xmlstream/handler/coroutine_callback.py", line 60, in pointer_wrapper python[1142080]: await pointer(stanza) python[1142080]: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slixmpp/plugins/xep_0231/bob.py", line 148, in _handle_bob_iq python[1142080]: iq.append(data) python[1142080]: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slixmpp/xmlstream/stanzabase.py", line 1233, in append python[1142080]: raise TypeError python[1142080]: TypeError python[1142080]: INFO:slixmpp.xmlstream.xmlstream:connection_lost: (None,) python[1142080]: INFO:root:Successful clean shut down
Ticket created by ~aereaux on ~nicoco/slidge
I just got this error message in my slidge-whatsapp logs. It looks like it was loosely correlated with a contact sending me a message:
Traceback (most recent call last): File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute cursor.execute(statement, parameters) sqlite3.IntegrityError: UNIQUE constraint failed: contact_sent.contact_id, contact_sent.msg_id The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge_whatsapp/session.py", line 624, in wrapper return future.result() ^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge_whatsapp/session.py", line 52, in wrapped return await func(self, *a, **k) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge_whatsapp/session.py", line 161, in handle_event await self.handle_message(data.Message) File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge_whatsapp/session.py", line 215, in handle_message contact.send_text( File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge/core/mixins/message.py", line 249, in send_text return self._send( ^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge/contact/contact.py", line 304, in _send self.xmpp.store.contacts.add_to_sent(self.contact_pk, stanza["id"]) File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/slidge/db/store.py", line 419, in add_to_sent session.commit() File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2028, in commit trans.commit(_to_root=True) File "<string>", line 2, in commit File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 1313, in commit self._prepare_impl() File "<string>", line 2, in _prepare_impl File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 1288, in _prepare_impl self.session.flush() File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4352, in flush self._flush(objects) File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4487, in _flush with util.safe_reraise(): File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__ raise exc_value.with_traceback(exc_tb) File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4448, in _flush flush_context.execute() File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute rec.execute(self) File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/unitofwork.py", line 642, in execute util.preloaded.orm_persistence.save_obj( File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/persistence.py", line 93, in save_obj _emit_insert_statements( File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/orm/persistence.py", line 1233, in _emit_insert_statements result = connection.execute( ^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418, in execute return meth( ^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/home/slidge/.local/share/pipx/venvs/slidge-whatsapp/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: contact_sent.contact_id, contact_sent.msg_id [SQL: INSERT INTO contact_sent (contact_id, msg_id) VALUES (?, ?)] [parameters: (167, '1E08ADE6857004636E88')] (Background on this error at: https://sqlalche.me/e/20/gkpj)
Comment by ~aereaux on ~nicoco/slidcord
Yep, seems to be much better now, thanks!
Ticket created by ~aereaux on ~nicoco/slidcord
I upgraded and restarted and now my chats seem to be stuck reconnecting.
I get a variety of errors including:
WARNING:discord.gateway:Gateway has stopped responding. Closing and restarting. ERROR:discord.client:Attempting a reconnect in 0.58s Traceback (most recent call last): File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/discord/client.py", line 907, in connect await self.ws.poll_event() File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/discord/gateway.py", line 623, in poll_event await self.received_message(msg.data) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/discord/gateway.py", line 528, in received_message await self.send_as_json(beat) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/discord/gateway.py", line 659, in send_as_json await self.send(utils._to_json(data)) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/discord/gateway.py", line 655, in send await self.socket.send_str(data) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/client_ws.py", line 165, in send_str await self._writer.send(data, binary=False, compress=compress) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/http_websocket.py", line 729, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/http_websocket.py", line 675, in _send_frame self._write(header + mask + message) File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/http_websocket.py", line 702, in _write raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport
ERROR:<me>:Failed to set avatar https://cdn.discordapp.com/avatars/228680336719085568/38a559e75118a1866ecebd982fccdb32.png?size=1024 Traceback (most recent call last): File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slidge/core/mixins/avatar.py", line 97, in __set_avatar cached_avatar = await avatar_cache.convert_or_get( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slidge/db/avatar.py", line 155, in convert_or_get img, _ = await self.__download(avatar, {}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/slidge/db/avatar.py", line 91, in __download async with self.http.get(url, headers=headers) as response: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/client.py", line 1197, in __aenter__ self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/client.py", line 507, in _request with timer: File "/home/slidge/.local/share/pipx/venvs/slidcord/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__ raise asyncio.TimeoutError from None TimeoutError
WARNING:discord.gateway:Can't keep up, websocket is 35.4s behind.
Comment by ~aereaux on ~nicoco/slidge-whatsapp
That's really weird, it works on my machine (when pipx installing :-/). Any idea what I could do to get it closer to what the CI does to reproduce?
Comment by ~aereaux on ~nicoco/slidge-whatsapp
Yes, I was able to install after installing go, it mostly just takes a little longer. Thanks for looking into this!