hermes - 💡(How to fix) Fix [Bug]: Matrix Gateway Boot-Loop due to Pending Invitations to closed or unexistent rooms [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

2026-05-20 07:29:34,759 WARNING gateway.run: Reconnect matrix error: matrix connect timed out after 30s, next retry in 300s 2026-05-20 07:30:46,733 WARNING gateway.platforms.matrix: Matrix: error joining !UicHSCnxJaAhfCcUpD:matrix.org: No known servers 2026-05-20 07:35:05,143 WARNING gateway.run: Reconnect matrix error: matrix connect timed out after 30s, next retry in 300s 2026-05-20 07:36:17,550 WARNING gateway.platforms.matrix: Matrix: error joining !UicHSCnxJaAhfCcUpD:matrix.org: No known servers

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report       https://paste.rs/I0LQN
  agent.log    https://paste.rs/D3fnD
  gateway.log  https://paste.rs/nQHxZ

---
RAW_BUFFERClick to expand / collapse

Bug Description

The Hermes Gateway enters a crash/restart loop when the associated Matrix account has pending invitations to rooms that are no longer available or are unresponsive.

Steps to Reproduce

Reproduction Steps

  1. An account (bot) is invited to several Matrix rooms.
  2. Some of these rooms are deleted or the homeservers become unresponsive.
  3. Start the Hermes Gateway with Matrix enabled.
  4. During the initial sync phase, the Gateway identifies pending invitations.
  5. The Gateway attempts to join these rooms sequentially.
  6. A request to a "dead" room causes a 30s timeout.
  7. The Gateway treats this timeout as a critical connection failure, disconnects the platform, and triggers a reconnection attempt.
  8. Repeat indefinitely.

Expected Behavior

Ignore room invitations that doesn't work for any reason and just start the matrix channel of the gateway.

Actual Behavior

2026-05-20 07:25:21,010 INFO gateway.memory_monitor: [MEMORY] rss=158MB gc=(77, 2, 4) threads=10 uptime=1500s 2026-05-20 07:29:04,746 INFO gateway.run: Reconnecting matrix (attempt 9)... 2026-05-20 07:29:04,896 INFO gateway.platforms.matrix: Matrix: using access token for @onibot:matrix.org (device oniricbot) 2026-05-20 07:29:05,290 INFO gateway.platforms.matrix: Matrix: E2EE enabled (store: ~/.hermes/platforms/matrix/store/crypto.db, device_id=oniricbot) 2026-05-20 07:29:05,677 INFO gateway.platforms.matrix: Matrix: initial sync complete, joined 3 rooms 2026-05-20 07:29:05,785 INFO gateway.platforms.matrix: Matrix: invited to !xuDolrLzyeQYmVuWuH:matrix.org — joining 2026-05-20 07:29:05,785 INFO gateway.platforms.matrix: Matrix: invited to !flzsxTDIHKfKGgNAyX:matrix.org — joining 2026-05-20 07:29:05,785 INFO gateway.platforms.matrix: Matrix: invited to !UicHSCnxJaAhfCcUpD:matrix.org — joining 2026-05-20 07:29:05,785 INFO gateway.platforms.matrix: Matrix: reconciling pending invite for !UicHSCnxJaAhfCcUpD:matrix.org 2026-05-20 07:29:34,759 WARNING gateway.run: Reconnect matrix error: matrix connect timed out after 30s, next retry in 300s 2026-05-20 07:30:21,011 INFO gateway.memory_monitor: [MEMORY] rss=160MB gc=(61, 5, 4) threads=11 uptime=1800s 2026-05-20 07:30:46,733 WARNING gateway.platforms.matrix: Matrix: error joining !UicHSCnxJaAhfCcUpD:matrix.org: No known servers 2026-05-20 07:34:35,136 INFO gateway.run: Reconnecting matrix (attempt 10)... 2026-05-20 07:34:35,254 INFO gateway.platforms.matrix: Matrix: using access token for @onibot:matrix.org (device oniricbot) 2026-05-20 07:34:35,417 INFO gateway.platforms.matrix: Matrix: E2EE enabled (store: ~/.hermes/platforms/matrix/store/crypto.db, device_id=oniricbot) 2026-05-20 07:34:35,512 INFO gateway.platforms.matrix: Matrix: initial sync complete, joined 3 rooms 2026-05-20 07:34:35,591 INFO gateway.platforms.matrix: Matrix: invited to !xuDolrLzyeQYmVuWuH:matrix.org — joining 2026-05-20 07:34:35,591 INFO gateway.platforms.matrix: Matrix: invited to !flzsxTDIHKfKGgNAyX:matrix.org — joining 2026-05-20 07:34:35,591 INFO gateway.platforms.matrix: Matrix: invited to !UicHSCnxJaAhfCcUpD:matrix.org — joining 2026-05-20 07:34:35,592 INFO gateway.platforms.matrix: Matrix: reconciling pending invite for !UicHSCnxJaAhfCcUpD:matrix.org 2026-05-20 07:35:05,143 WARNING gateway.run: Reconnect matrix error: matrix connect timed out after 30s, next retry in 300s 2026-05-20 07:35:05,148 WARNING gateway.run: matrix paused after 10 consecutive failures (matrix connect timed out after 30s) — fix the underlying issue then run /platform resume matrix to retry, or hermes gateway restart to restart the gateway. 2026-05-20 07:35:21,012 INFO gateway.memory_monitor: [MEMORY] rss=167MB gc=(19, 7, 4) threads=12 uptime=2100s 2026-05-20 07:36:17,550 WARNING gateway.platforms.matrix: Matrix: error joining !UicHSCnxJaAhfCcUpD:matrix.org: No known servers 2026-05-20 07:40:21,014 INFO gateway.memory_monitor: [MEMORY] rss=176MB gc=(59, 3, 6) threads=8 uptime=2400s

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/I0LQN
  agent.log    https://paste.rs/D3fnD
  gateway.log  https://paste.rs/nQHxZ

Operating System

Arch Linux

Python Version

No response

Hermes Version

$ hermes version Hermes Agent v0.14.0 (2026.5.16) Project: /home/emili/.hermes/hermes-agent Python: 3.11.15 OpenAI SDK: 2.24.0 Update available: 361 commits behind — run 'hermes update'

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

I guess here gateway/platforms/matrix.py

Proposed Fix (optional)

I think room invitations should be processed asynchronously or in a non-blocking background task AFTER the main platform connection is established and marked as READY.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING