diff --git a/mautrix/bridge/matrix.py b/mautrix/bridge/matrix.py index da42a95e..e5399094 100644 --- a/mautrix/bridge/matrix.py +++ b/mautrix/bridge/matrix.py @@ -225,6 +225,12 @@ async def wait_for_connection(self) -> None: try: self.versions = await self.az.intent.versions() break + except MForbidden: + self.log.debug( + "/versions endpoint returned M_FORBIDDEN, " + "trying to register bridge bot before retrying..." + ) + await self.az.intent.ensure_registered() except Exception: self.log.exception("Connection to homeserver failed, retrying in 10 seconds") await asyncio.sleep(10)