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

Fatal error creating room (without a crash) #391

Closed
turt2live opened this issue Nov 30, 2019 · 2 comments
Closed

Fatal error creating room (without a crash) #391

turt2live opened this issue Nov 30, 2019 · 2 comments
Labels
bug: regression Something isn't working, but it used to work before
Milestone

Comments

@turt2live
Copy link
Contributor

Nov 30 23:30:29 integrations python[14189]: [2019-11-30 23:30:29,648] [[email protected]] Fatal error updating Matrix room
Nov 30 23:30:29 integrations python[14189]: Traceback (most recent call last):
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1513, in _object_value_for_elem
Nov 30 23:30:29 integrations python[14189]:     return self._object_lookup[elem]
Nov 30 23:30:29 integrations python[14189]: KeyError: 'LEFT'
Nov 30 23:30:29 integrations python[14189]: During handling of the above exception, another exception occurred:
Nov 30 23:30:29 integrations python[14189]: Traceback (most recent call last):
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix_telegram/portal/metadata.py", line 201, in update_matrix_room
Nov 30 23:30:29 integrations python[14189]:     participants)
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix_telegram/portal/metadata.py", line 214, in _update_matrix_room
Nov 30 23:30:29 integrations python[14189]:     await self._sync_telegram_users(user, users)
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix_telegram/portal/metadata.py", line 460, in _sync_telegram_users
Nov 30 23:30:29 integrations python[14189]:     await puppet.intent_for(self).ensure_joined(self.mxid)
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/appservice/api/intent.py", line 353, in ensure_joined
Nov 30 23:30:29 integrations python[14189]:     if not ignore_cache and self.state_store.is_joined(room_id, self.mxid):
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/appservice/state_store/abstract.py", line 100, in is_joined
Nov 30 23:30:29 integrations python[14189]:     return self.get_membership(room_id, user_id) == Membership.JOIN
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/appservice/state_store/abstract.py", line 97, in get_membership
Nov 30 23:30:29 integrations python[14189]:     return self.get_member(room_id, user_id).membership or Membership.LEAVE
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/bridge/db/sqlstatestore.py", line 62, in get_member
Nov 30 23:30:29 integrations python[14189]:     return self._get_user_profile(room_id, user_id).member()
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/bridge/db/sqlstatestore.py", line 48, in _get_user_profile
Nov 30 23:30:29 integrations python[14189]:     profile = UserProfile.get(*key)
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/bridge/db/mx_user_profile.py", line 30, in get
Nov 30 23:30:29 integrations python[14189]:     return cls._select_one_or_none(and_(cls.c.room_id == room_id, cls.c.user_id == user_id))
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/db/base.py", line 135, in _select_one_or_none
Nov 30 23:30:29 integrations python[14189]:     return cls._one_or_none(cls.db.execute(cls._make_simple_select(*args)))
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/db/base.py", line 59, in _one_or_none
Nov 30 23:30:29 integrations python[14189]:     return cls.scan(next(rows))
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/db/base.py", line 88, in scan
Nov 30 23:30:29 integrations python[14189]:     return cls(**dict(zip(cls.column_names, row)))
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1599, in process
Nov 30 23:30:29 integrations python[14189]:     value = self._object_value_for_elem(value)
Nov 30 23:30:29 integrations python[14189]:   File "/home/telegram/tgenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1516, in _object_value_for_elem
Nov 30 23:30:29 integrations python[14189]:     '"%s" is not among the defined enum values' % elem
Nov 30 23:30:29 integrations python[14189]: LookupError: "LEFT" is not among the defined enum values
@tulir
Copy link
Member

tulir commented Dec 1, 2019

Looks like I need to update the membership migration to replace left with leave. Not sure where they came from, but this should fix it:

UPDATE mx_user_profile SET membership='LEAVE' WHERE membership='LEFT';

@tulir tulir added the bug: regression Something isn't working, but it used to work before label Dec 1, 2019
@tulir tulir added this to the 0.7.0 milestone Dec 1, 2019
@tulir tulir closed this as completed in cf8c05e Dec 1, 2019
@turt2live
Copy link
Contributor Author

turt2live commented Dec 2, 2019

telegram=# UPDATE mx_user_profile SET membership='LEAVE' WHERE membership='LEFT';
UPDATE 16678

ftr

edit: of 1.1 million records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: regression Something isn't working, but it used to work before
Development

No branches or pull requests

2 participants