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

commands: implement sync-space #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

commands: implement sync-space #85

wants to merge 1 commit into from

Conversation

sumnerevans
Copy link
Member

Closes #83

Signed-off-by: Sumner Evans [email protected]

Closes #83

Signed-off-by: Sumner Evans <[email protected]>
@JacobSnyder
Copy link

Thanks for taking a look at this, Sumner!

I pulled down this version and tried the new command sync-space, but it failed with an error:

Unhandled error while handling command. Check logs for more details (ref: 1710215739).

Here's my logs:

Mar 12 03:55:36 matrix systemd[1]: Started Matrix Beeper Linkedin bridge.
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]: [2024-03-12 03:55:38,454] [[email protected]] Connection to homeserver failed, retrying in 10 seconds
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]: Traceback (most recent call last):
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/matrix.py", line 226, in wait_for_connection
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:     self.versions = await self.az.intent.versions()
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/client/api/base.py", line 118, in versions
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:     resp = await self.api.request(Method.GET, Path.versions)
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 425, in request
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:     resp_data, resp = await self._send(
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:                       ^^^^^^^^^^^^^^^^^
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 265, in _send
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]:     raise make_request_error(
Mar 12 03:55:38 matrix matrix-beeper-linkedin[3550400]: mautrix.errors.request.MatrixUnknownRequestError: 404: 404 page not found
Mar 12 03:55:50 matrix matrix-beeper-linkedin[3550400]: [2024-03-12 03:55:49,999] [[email protected]] fetchrow('SELECT membership, displayname, avatar_url FROM mx_user_profile WHERE room_id=$1 AND user_id=$2') took 1.198 seconds
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]: [2024-03-12 04:03:27,838] [[email protected]] Unhandled error while handling command sync-space  from @me:mydomain.com (ref: 1710215739)
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]: Traceback (most recent call last):
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 647, in ensure_joined
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     await self.join_room(room_id, max_retries=0)
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 128, in wrapper
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     return await __method(*args, **kwargs)
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/client/store_updater.py", line 62, in join_room
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     room_id = await super().join_room(
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:               ^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/client/api/rooms.py", line 335, in join_room
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     content = await self.api.request(
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:               ^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 425, in request
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     resp_data, resp = await self._send(
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:                       ^^^^^^^^^^^^^^^^^
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 265, in _send
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     raise make_request_error(
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]: mautrix.errors.request.MUnknown: Can't join remote room because no servers that are in the room have been provided.
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]: The above exception was the direct cause of the following exception:
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]: Traceback (most recent call last):
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 491, in handle
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     await self._run_handler(handler, evt)
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 340, in __call__
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     return await self._handler(evt)
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:            ^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/commands/spaces.py", line 24, in sync_space
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     await evt.sender.create_or_update_space()
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/user.py", line 337, in create_or_update_space
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     await self.az.intent.send_state_event(
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 141, in wrapper
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     await __self.ensure_joined(room_id)
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 669, in ensure_joined
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]:     raise IntentError(f"Failed to join room {room_id} as {self.mxid}") from e
Mar 12 04:03:27 matrix matrix-beeper-linkedin[3550400]: mautrix.errors.base.IntentError: Failed to join room !iownvEhozgUytvNhZu:mydomain.com as @linkedinbot:mydomain.com

I figured maybe my login token was bad so I did another login-curl and tried to sync-space again, but I got a similar error:

Unhandled error while handling command. Check logs for more details (ref: 1710215740).

Full logs:

Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]: [2024-03-12 04:06:01,221] [[email protected]] Unhandled error while handling command sync-space  from @me:mydomain.com (ref: 1710215740)
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]: Traceback (most recent call last):
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 647, in ensure_joined
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     await self.join_room(room_id, max_retries=0)
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 128, in wrapper
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     return await __method(*args, **kwargs)
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/client/store_updater.py", line 62, in join_room
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     room_id = await super().join_room(
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:               ^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/client/api/rooms.py", line 335, in join_room
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     content = await self.api.request(
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:               ^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 425, in request
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     resp_data, resp = await self._send(
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:                       ^^^^^^^^^^^^^^^^^
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 265, in _send
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     raise make_request_error(
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]: mautrix.errors.request.MUnknown: Can't join remote room because no servers that are in the room have been provided.
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]: The above exception was the direct cause of the following exception:
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]: Traceback (most recent call last):
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 491, in handle
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     await self._run_handler(handler, evt)
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 340, in __call__
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     return await self._handler(evt)
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:            ^^^^^^^^^^^^^^^^^^^^^^^^
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/commands/spaces.py", line 24, in sync_space
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     await evt.sender.create_or_update_space()
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/user.py", line 337, in create_or_update_space
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     await self.az.intent.send_state_event(
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 141, in wrapper
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     await __self.ensure_joined(room_id)
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:   File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 669, in ensure_joined
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]:     raise IntentError(f"Failed to join room {room_id} as {self.mxid}") from e
Mar 12 04:06:01 matrix matrix-beeper-linkedin[3550400]: mautrix.errors.base.IntentError: Failed to join room !iownvEhozgUytvNhZu:mydomain.com as @linkedinbot:mydomain.com

I can probably figure out how to drop the database for the bot, but I thought it might be helpful to have this repro so I've kept it intact for now. Cheers!

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

Successfully merging this pull request may close these issues.

Rejoin space?
2 participants