matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

panic before crash after moving dendrite to a subdomain #1898

Closed TheJoYo closed 3 years ago

TheJoYo commented 3 years ago

Background information

0.3.11 Monolith SQLite3 Docker

Description

I deployed monolith on the same server as nginx but ended up needing to move it to another server and configuring nginx to reverse proxy at a subdomain and forward paths to well-known from the root domain. Federation passes from https://federationtester.matrix.org/#thejoyo.com and the server functions fine until I create a user and attempt to join a remote room.

Below is a sanitized copy of the panic message produced on the server.

time="2021-07-01T21:42:37.993781160Z" level=info msg="Enabled perspective key fetcher" func="NewInternalAPI\n\t" file=" [github.com/matrix-org/dendrite/signingkeyserver/signingkeyserver.go:103]" num_public_keys=2 server_name=matrix.org
time="2021-07-01T21:42:38.049240324Z" level=panic msg="roomserver output log: write room event failure" func="onMessage\n\t" file=" [github.com/matrix-org/dendrite/federationsender/consumers/roomserver.go:113]" add="[$vQXj4wh5ikIq0d3o4YP-R9JSfxVLyYeN1wN4lRbnEME]" del="[$yNaAliPolhDitOYu0arjawZbIe8Av-g1T1CMc1EJ_1o]" error="UNIQUE constraint failed: federationsender_joined_hosts.event_id" event="{\"auth_events\":[\"$qRKdTK1CmBa1OMamnCC7FKEAbiI0gMRdHquE6w2FGyM\",\"$abbq6G7XTHgPggQWOiiTnGR7UKwGza4OrKC9mZxhT1Q\",\"$NKbP1_SmVp0w1ibXd9vI2kFilb6zs3ac5yo9sv2SF90\",\"$yNaAliPolhDitOYu0arjawZbIe8Av-g1T1CMc1EJ_1o\"],\"content\":{\"displayname\":\"JoYo\",\"membership\":\"join\"},\"depth\":23424,\"hashes\":{\"sha256\":\"BmMImxY0mwpqI6rjCCVULYI9RNHnZZqP+7r3OB2KL1c\"},\"origin\":\"thejoyo.com\",\"origin_server_ts\":1625171310648,\"prev_events\":[\"$gm3vrntP9GHNSLuLx3WWlLEnsIpDLeWAsZkDOQlByxU\"],\"prev_state\":[],\"room_id\":\"!yomrOFwgFXzmeMAbzX:matrix.org\",\"sender\":\"@joyo:thejoyo.com\",\"signatures\":{\"thejoyo.com\":{\"ed25519:8KV0b9\":\"this might be key material so I removed it for bug report"}},\"state_key\":\"@joyo:thejoyo.com\",\"type\":\"m.room.member\"}" event_id="$vQXj4wh5ikIq0d3o4YP-R9JSfxVLyYeN1wN4lRbnEME"
panic: (*logrus.Entry) 0xc000309030

goroutine 39 [running]:
github.com/sirupsen/logrus.Entry.log(0xc0000dac40, 0xc000392120, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    github.com/sirupsen/logrus@v1.7.0/entry.go:255 +0x325
github.com/sirupsen/logrus.(*Entry).Log(0xc000308fc0, 0x0, 0xc0001c99a8, 0x1, 0x1)
    github.com/sirupsen/logrus@v1.7.0/entry.go:283 +0xf0
github.com/sirupsen/logrus.(*Entry).Logf(0xc000308fc0, 0xc000000000, 0x118d600, 0x2f, 0x0, 0x0, 0x0)
    github.com/sirupsen/logrus@v1.7.0/entry.go:329 +0xe5
github.com/sirupsen/logrus.(*Entry).Panicf(...)
    github.com/sirupsen/logrus@v1.7.0/entry.go:367
github.com/matrix-org/dendrite/federationsender/consumers.(*OutputRoomEventConsumer).onMessage(0xc000215b40, 0xc0003110e0, 0x1, 0x101)
    github.com/matrix-org/dendrite/federationsender/consumers/roomserver.go:113 +0x6f1
github.com/matrix-org/dendrite/internal.(*ContinualConsumer).consumePartition(0xc0002fe8a0, 0x12e7fc0, 0xc0001f98a0)
    github.com/matrix-org/dendrite/internal/consumers.go:126 +0xe2
created by github.com/matrix-org/dendrite/internal.(*ContinualConsumer).StartOffsets
    github.com/matrix-org/dendrite/internal/consumers.go:107 +0x545
kegsay commented 3 years ago

Fixed in https://github.com/matrix-org/dendrite/pull/1824