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

Cannot use telegram bridge due to error on invitation #297

Closed
vmario89 opened this issue Mar 14, 2019 · 4 comments
Closed

Cannot use telegram bridge due to error on invitation #297

vmario89 opened this issue Mar 14, 2019 · 4 comments
Labels
duplicate This issue has already been reported
Milestone

Comments

@vmario89
Copy link

Hi, running mautrix-telegram v0.5.0-rc3 i get an error when inviting @TelegramBot:sub.domain.tld

what i did:

  • stopped the mautrix-telegram service
  • i removed the mautrix-telegram.db
  • restarted matrix-synapse
  • source ./bin/activate; alembic upgrade head;
  • run mautrix-telegram again: python -m mautrix_telegram

everything on invitation this stack is thrown:

[2019-03-14 17:25:16,518] [[email protected]] Exception in Matrix event handler
Traceback (most recent call last):
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
cursor, statement, parameters, context
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
cursor.execute(statement, parameters)
sqlite3.IntegrityError: NOT NULL constraint failed: contact.user

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_appservice/appservice.py", line 173, in try_handle
await handler_func(event)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_telegram/matrix.py", line 402, in handle_event
await self.handle_invite(room_id, state_key, sender)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_telegram/matrix.py", line 138, in handle_invite
inviter = u.User.get_by_mxid(inviter_mxid)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_telegram/user.py", line 368, in get_by_mxid
user.db_instance.insert()
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_telegram/user.py", line 131, in db_instance
self._db_instance = self.new_db_instance()
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_telegram/user.py", line 137, in new_db_instance
portals=self.db_portals)
File "", line 4, in init
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 428, in _initialize_instance
manager.dispatch.init_failure(self, args, kwargs)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 67, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 277, in reraise
raise value
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 425, in _initialize_instance
return manager.original_init(*mixed[1:], **kwargs)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/ext/declarative/base.py", line 801, in _declarative_constructor
setattr(self, k, kwargs[k])
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/mautrix_telegram/db/user.py", line 84, in contacts
for tgid in puppets])
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2144, in execute
return connection.execute(statement, *multiparams, **params)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 980, in execute
return meth(self, multiparams, params)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 273, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1099, in _execute_clauseelement
distilled_params,
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1240, in _execute_context
e, statement, parameters, cursor, context
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1458, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 276, in reraise
raise value.with_traceback(tb)
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
cursor, statement, parameters, context
File "/opt/matrix-bridges/mautrix-telegram/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: contact.user [SQL: 'INSERT INTO contact DEFAULT VALUES'] (Background on this error at: http://sqlalche.me/e/gkpj)
[2019-03-14 17:25:16,523] [[email protected]] 127.0.0.1 [14/Mar/2019:16:25:16 +0000] "PUT /transactions/2?access_token=q4wuvo7nteyrxydlr4g45ysnh7nxy67cb5remx3qwet0jv7l8m5yhcr5ed6udtl3 HTTP/1.1" 200 158 "-" "Synapse/0.99.2"

Is this fixable by removing sth. from Matrix Synapse db? I am using postgresql. I guess from previous installation the telegrambot is already registered. But i am unsure on how to clean/overwrite this stuff.

regards, Mario

@tulir
Copy link
Member

tulir commented Mar 14, 2019

This might be related to #296

@tulir tulir added the bug: regression Something isn't working, but it used to work before label Mar 14, 2019
@tulir tulir added this to the 0.5.0 milestone Mar 14, 2019
@moqmar
Copy link

moqmar commented Mar 15, 2019

I have the exactly same error when using the docker image v0.5.0-rc3; it works in latest though so I guess that issue is fixed.

@moqmar
Copy link

moqmar commented Mar 15, 2019

I still get #296 though, so these two seem to be unrelated to each other

@tulir
Copy link
Member

tulir commented Mar 16, 2019

it works in latest though so I guess that issue is fixed.

Oh yeah, this was probably fixed in a3534d8. #284 was this issue.

@tulir tulir closed this as completed Mar 16, 2019
@tulir tulir added duplicate This issue has already been reported and removed bug: regression Something isn't working, but it used to work before labels Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue has already been reported
Development

No branches or pull requests

3 participants