matrix-org / matrix-org/mjolnir
Mjolnirs Native Encryption Doesn't Support v12 (Management) Rooms
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 445
- Forks
- 75
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 3
Description
When switching our deployment from mjolnir on NixOS using pantalaimon to mjolnir on Docker using the new native encryption backend, I noticed that mjolnir would refuse to start up. Investigation showed that the problem lies in our management room being room version 12, indicating that the native encryption backend doesn't support that room version.
Workaround of using a v11 management room worked.
Here are some of the logs:
```
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-175) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//state/m.room.power_levels/
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-176) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//state/m.room.create/
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-177) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//members
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-178) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//members
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [ERROR] [Mjolnir] Error during startup:
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [ERROR] [Mjolnir] Error: Room ID does not have a valid server_name
mjolnir-1 | at /node_modules/@vector-im/matrix-bot-sdk/lib/e2ee/RustEngine.js:143:62
mjolnir-1 | at /node_modules/async-lock/lib/index.js:171:12
mjolnir-1 | at AsyncLock._promiseTry (/node_modules/async-lock/lib/index.js:306:31)
mjolnir-1 | at exec (/node_modules/async-lock/lib/index.js:170:9)
mjolnir-1 | at AsyncLock.acquire (/node_modules/async-lock/lib/index.js:189:3)
mjolnir-1 | at RustEngine.prepareEncrypt (/node_modules/@vector-im/matrix-bot-sdk/lib/e2ee/RustEngine.js:142:25)
mjolnir-1 | at async CryptoClient.encryptRoomEvent (/node_modules/@vector-im/matrix-bot-sdk/lib/e2ee/CryptoClient.js:202:9)
mjolnir-1 | at async MatrixClient.sendEvent (/node_modules/@vector-im/matrix-bot-sdk/lib/MatrixClient.js:1246:23)
mjolnir-1 | at async descriptor.value (/node_modules/@vector-im/matrix-bot-sdk/lib/metrics/decorators.js:19:32)
mjolnir-1 | at async descriptor.value (/node_modules/@vector-im/matrix-bot-sdk/lib/metrics/decorators.js:19:32) {
mjolnir-1 | code: 'GenericFailure'
mjolnir-1 | }
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [INFO] [Mjolnir] Stopping Mjolnir...
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-179) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//state/m.room.canonical_alias/
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-180) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//members
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [DEBUG] [MatrixHttpClient] (REQ-181) GET https://matrix.hamburg.ccc.de/_matrix/client/v3/rooms//members
mjolnir-1 | Wed, 11 Feb 2026 00:20:28 GMT [ERROR] [Mjolnir@startup] Startup failed due to error - see console
mjolnir-1 | Mjolnir failed to start: Error: Room ID does not have a valid server_name
mjolnir-1 | node:internal/process/promises:391
mjolnir-1 | triggerUncaughtException(err, true /* fromPromise */);
mjolnir-1 | ^
mjolnir-1 |
mjolnir-1 | Error: Room ID does not have a valid server_name
mjolnir-1 | at /node_modules/@vector-im/matrix-bot-sdk/lib/e2ee/RustEngine.js:143:62
mjolnir-1 | at /node_modules/async-lock/lib/index.js:171:12
mjolnir-1 | at AsyncLock._promiseTry (/node_modules/async-lock/lib/index.js:306:31)
mjolnir-1 | at exec (/node_modules/async-lock/lib/index.js:170:9)
mjolnir-1 | at AsyncLock.acquire (/node_modules/async-lock/lib/index.js:189:3)
mjolnir-1 | at RustEngine.prepareEncrypt (/node_modules/@vector-im/matrix-bot-sdk/lib/e2ee/RustEngine.js:142:25)
mjolnir-1 | at async CryptoClient.encryptRoomEvent (/node_modules/@vector-im/matrix-bot-sdk/lib/e2ee/CryptoClient.js:202:9)
mjolnir-1 | at async MatrixClient.sendEvent (/node_modules/@vector-im/matrix-bot-sdk/lib/MatrixClient.js:1246:23)
mjolnir-1 | at async descriptor.value (/node_modules/@vector-im/matrix-bot-sdk/lib/metrics/decorators.js:19:32)
mjolnir-1 | at async descriptor.value (/node_modules/@vector-im/matrix-bot-sdk/lib/metrics/decorators.js:19:32) {
mjolnir-1 | code: 'GenericFailure'
mjolnir-1 | }
mjolnir-1 |
mjolnir-1 | Node.js v20.19.4
```
- I also noticed that mention forwarding doesn't work in v12 rooms. I don't know, if this worked before, but it might be affected by the native crypto as well.
- Mention spam protection also doesn't work at all (neither in a v12 nor in a v10 room I tested), tho that worked with the old crypto before.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the native encryption path in @vector-im/matrix-bot-sdk/lib/e2ee/RustEngine.js, following CryptoClient.encryptRoomEvent and MatrixClient.sendEvent during management-room startup. Reproduce the failure with a v12 management room and compare it with the reported v11 workaround. Done means Mjolnir starts with v12 rooms; investigate mention forwarding and spam protection separately because the issue reports both as additional failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100