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

Setting up Telegram puppeting twice results in the second one being silent #198

Closed
turt2live opened this issue Aug 2, 2018 · 1 comment
Labels
bug: unclassified Something isn't working and it may or may not have worked in the past
Milestone

Comments

@turt2live
Copy link
Contributor

  1. Log in to telegram on one matrix user
  2. Log in to the same telegram account with a different matrix user
  3. Try to send messages as the second matrix user
  4. Nothing is bridged
@tulir tulir added the bug: unclassified Something isn't working and it may or may not have worked in the past label Aug 2, 2018
@tulir tulir added this to the soon™ milestone Aug 5, 2018
@turt2live
Copy link
Contributor Author

This actually causes the bridge to crash and stop working now:

[2018-08-15 14:54:13,050] [[email protected]] Exception in Matrix event handler
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mautrix_appservice/appservice.py", line 173, in try_handle
    await handler_func(event)
  File "/opt/mautrix-telegram/mautrix_telegram/matrix.py", line 381, in handle_event
    await self.handle_join(room_id, state_key, event_id)
  File "/opt/mautrix-telegram/mautrix_telegram/matrix.py", line 154, in handle_join
    user = await u.User.get_by_mxid(user_id).ensure_started()
  File "/opt/mautrix-telegram/mautrix_telegram/abstract_user.py", line 170, in ensure_started
    self.session_container.Session.session_id == self.mxid).count())
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3160, in count
    return self.from_self(col).scalar()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2913, in scalar
    ret = self.one()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2884, in one
    ret = self.one_or_none()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2854, in one_or_none
    ret = list(self)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2925, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2946, in _execute_and_instances
    close_with_result=True)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2955, in _get_bind_args
    **kw
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2937, in _connection_from_session
    conn = self.session.connection(**kw)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1035, in connection
    execution_options=execution_options)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1040, in _connection_for_bind
    engine, execution_options)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 388, in _connection_for_bind
    self._assert_active()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 276, in _assert_active
    % self._rollback_exception
sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (psycopg2.IntegrityError) duplicate key value violates unique constraint "user_tgid_key"
DETAIL:  Key (tgid)=(123redacted) already exists.
 [SQL: 'UPDATE "user" SET tgid=%(tgid)s WHERE "user".mxid = %(user_mxid)s'] [parameters: {'tgid': 123redacted, 'user_mxid': '@redacted:domain.com'}] (Background on this error at: http://sqlalche.me/e/gkpj)

@tulir tulir closed this as completed in d514b92 Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: unclassified Something isn't working and it may or may not have worked in the past
Development

No branches or pull requests

2 participants