matrix-org / matrix-org/matrix-bifrost

Crash on room join

Open
#335 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
187
Forks
38
PR merge metrics
No merged PRs in 30d

Description

```
DEBUG 16:14:32:273 [ProfileSync] Checking for profile updates for @xmpp_user=40xmpp.domain.element.dev:subdomain.domain.element.d
INFO 16:14:32:273 [ProfileSync] Fetching user info for user@xmpp.domain.element.dev
INFO 16:14:32:273 [XmppJsInstance] Fetching vCard for user@xmpp.domain.element.dev
DEBUG 16:14:32:275 [XmppJsInstance] Stanza: {
name: 'iq',
attrs: {
type: 'result',
id: '27daecdc-1cd6-49a4-9963-1b2da5e9c826',
from: 'user@xmpp.domain.element.dev',
to: 'matrix.xmpp.domain.element.dev'
},
children: [ { name: 'vCard', attrs: [Object], children: [Array] } ]
}
INFO 16:14:32:275 [XmppJsInstance] Got iq from=user@xmpp.domain.element.dev to=matrix.xmpp.domain.element.dev isOurs=true
DEBUG 16:14:32:275 [ProfileSync] getUserInfo got: {
Nickname: 'user',
Avatar: 'image/jpeg|',
eventName: '-unused-',
who: 'user@xmpp.domain.element.dev',
account: { protocol_id: '', username: '' }
}
DEBUG 16:14:32:276 [ProfileSync] Got an avatar, setting
ERROR 16:14:32:276 [ProfileSync] Failed to update avatar_url for user: Error: Avatar uri was malformed
at XmppJsGateway.getAvatarBuffer (/app/src/xmppjs/XJSGateway.ts:511:19)
at ProfileSync.updateProfile (/app/src/ProfileSync.ts:84:52)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at GatewayHandler.handleRoomJoin (/app/src/GatewayHandler.ts:193:17)
INFO 16:14:32:278 [GatewayHandler] Attempting to join #unencryptedpublic:subdomain.domain.element.dev
DEBUG 16:14:32:278 [MatrixHttpClient] (REQ-34) GET https://matrix.subdomain.domain.element.dev/_matrix/client/v3/directory/room/%23unen
DEBUG 16:14:32:283 [PgDatstore] Getting room !dOkmYxmKXexmUqNSGW:subdomain.domain.element.dev
DEBUG 16:14:32:284 [PgDatstore] Found room {"gateway":true,"room_name":"#unencryptedpublic#subdomain.domain.element.dev@matrix.xmpp.em
DEBUG 16:14:32:285 [XmppJsGateway] Handling remote join for PHByZXNlbmNlIHRvPSIjdW5lbmNyeXB0ZWRwdWJsaWMjcmhlbC5lbXMtc3VwcG9ydC5lbGVtZW5
INFO 16:14:32:285 [XmppJsGateway] Updating membership for #unencryptedpublic#subdomain.domain.element.dev@matrix.xmpp.domain.eleme
ERROR 16:14:32:285 [XmppJsGateway] Conflicting nickname, not joining
WARN 16:14:32:286 [GatewayHandler] Failed to join room: Conflicting nickname, not joining
DEBUG 16:14:32:286 [XmppJsGateway] Handling remote join for PHByZXNlbmNlIHRvPSIjdW5lbmNyeXB0ZWRwdWJsaWMjcmhlbC5lbXMtc3VwcG9ydC5lbGVtZW5
ERROR 16:14:32:286 [XmppJsGateway] Could not find stanza in cache for remoteJoin. Cannot handle
DEBUG 16:14:32:286 [MatrixHttpClient] (REQ-35) POST https://matrix.subdomain.domain.element.dev/_matrix/client/v3/rooms/!dOkmYxmKXexmUq
Error: Stanza for join not in cache, cannot handle
at XmppJsGateway.onRemoteJoin (/app/src/xmppjs/XJSGateway.ts:284:19)
at GatewayHandler.handleRoomJoin (/app/src/GatewayHandler.ts:231:39)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Stream closed EOF for element-onprem/instance-bifrost-0 (bifrost)
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing GatewayHandler.handleRoomJoin in src/GatewayHandler.ts, then inspect XmppJsGateway.onRemoteJoin and getAvatarBuffer in src/xmppjs/XJSGateway.ts. Use the supplied join logs to follow the conflicting nickname and missing stanza-cache errors; done means the room join no longer crashes or leaves the join unhandled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.