dendrite
dendrite copied to clipboard
One-off `index out of range` runtime error
Background information
- Dendrite version or git SHA: 0.12.0
- SQLite3 or Postgres?: Postgres 14.5
- Running in Docker?: no
go version: 1.19.6- Client used (if applicable):
Description
- When did this first appear: Soon after upgrading from Dendrite 0.11.1
- What is the problem: Dendrite panicked with "index out of range" error:
panic: runtime error: index out of range [0] with length 0
goroutine 247562 [running]: github.com/matrix-org/gomatrixserverlib.ParseAndValidateServerName({0xc042e862b8?, 0xc05b11a2d0?})
github.com/matrix-org/[email protected]/federationtypes.go:41 +0x1fa
github.com/matrix-org/gomatrixserverlib.resolveServer({0x558846c4ff50, 0xc08ba235c0}, {0xc042e862b8, 0x4}, 0x0) github.com/matrix-org/[email protected]/resolve.go:46 +0x59
github.com/matrix-org/gomatrixserverlib.resolveServer({0x558846c4ff50, 0xc08ba235c0}, {0xc06621ed29, 0x1c}, 0x1)
github.com/matrix-org/[email protected]/resolve.go:98 +0x2e9 github.com/matrix-org/gomatrixserverlib.ResolveServer(...)
github.com/matrix-org/[email protected]/resolve.go:39
github.com/matrix-org/gomatrixserverlib.(*destinationTripper).RoundTrip(0xc000522460, 0xc08bc28600)
github.com/matrix-org/[email protected]/client.go:262 +0x325
net/http.send(0xc08bc28500, {0x558846c45900, 0xc000522460}, {0x558846bf3120?, 0x5588456b3b01?, 0x558847670b20?})
net/http/client.go:251 +0x5f7
net/http.(*Client).send(0xc00008c540, 0xc08bc28500, {0x7f17a4ce7060?, 0x110?, 0x558847670b20?})
net/http/client.go:175 +0x9b
net/http.(*Client).do(0xc00008c540, 0xc08bc28500)
net/http/client.go:715 +0x8fc
net/http.(*Client).Do(...)
net/http/client.go:581
github.com/matrix-org/gomatrixserverlib.(*Client).DoHTTPRequest(0xc00008c540, {0x558846c4ff18, 0xc08b641d40}, 0xc08bc28400)
github.com/matrix-org/[email protected]/client.go:568 +0x485
github.com/matrix-org/gomatrixserverlib.(*Client).DoRequestAndParseResponse(0x558846c4fee0?, {0x558846c4ff18?, 0xc08b641d40?}, 0xc08bc28400, {0x558846a7a0e0, 0xc042a97a00})
github.com/matrix-org/[email protected]/client.go:505 +0x73
github.com/matrix-org/gomatrixserverlib.(*Client).GetServerKeys(0x20?, {0x558846c4ff18, 0xc08b641d40}, {0xc08afac362?, 0x558846a58ea0?})
github.com/matrix-org/[email protected]/client.go:380 +0x1f5
github.com/matrix-org/gomatrixserverlib.(*DirectKeyFetcher).fetchKeysForServer(0xc003ad7d50, {0x558846c4ff50?, 0xc08b46c450?}, {0xc08afac362, 0x1c})
github.com/matrix-org/[email protected]/keyring.go:526 +0xca github.com/matrix-org/gomatrixserverlib.(*DirectKeyFetcher).FetchKeys.func1(0x0?)
github.com/matrix-org/[email protected]/keyring.go:492 +0x116 created by github.com/matrix-org/gomatrixserverlib.(*DirectKeyFetcher).FetchKeys
github.com/matrix-org/[email protected]/keyring.go:511 +0x4f3
Latest log entries:
ERRO[2023-03-15T10:57:11.984793320Z] Failed to fetch key for server context=missing error="Post \"matrix://phlipbox.com/_matrix/key/v2/query\": x509: certificate has expired or is not yet valid: current time 2023-03-15T10:57:11Z is after 2022-12-02T15:38:09Z" fetcher=DirectKeyFetcher WARN[2023-03-15T10:57:11.984948940Z] Failed to retrieve any keys context=missing fetcher=DirectKeyFetcher WARN[2023-03-15T10:57:11.985675570Z] Couldn't validate signature of event "$e0B6_tbKffysZ2KKR_Evn8NZ0PjEIZQ8XalmHnbKUI8" from /event context=missing error="gomatrixserverlib: could not download key for \"phlipbox.com\"" room_id="!FwbcAdwtvCYkHekZKf:talk.puri.sm" txn_event="$SIt8CSb3H-OqOezt2dWWKW9ZzOmNIFRBmI0B6qEoLyo" txn_prev_events="[$WMGEVQ_3Dw87mMczAPWYM0cxlP3RfYqqa6Y7Rw67dLM]"
ERRO[2023-03-15T10:57:12.122942280Z] Failed to fetch key for server context=missing error="Post \"matrix://jameshjacksonjr.modular.im/_matrix/key/v2/query\": dial tcp: lookup jameshjacksonjr.modular.im on 94.237.127.9:53: no such host" fetcher=DirectKeyFetcher
WARN[2023-03-15T10:57:12.123061670Z] Failed to retrieve any keys context=missing fetcher=DirectKeyFetcher
WARN[2023-03-15T10:57:12.123581370Z] Couldn't validate signature of event "$vuR6xm9WIBRDM1-niXesOdl2XYnrjfTGUPAqMMZn-w8" from /event context=missing error="gomatrixserverlib: could not download key for \"jameshjacksonjr.modular.im\"" room_id="!FwbcAdwtvCYkHekZKf:talk.puri.sm" txn_event="$SIt8CSb3H-OqOezt2dWWKW9ZzOmNIFRBmI0B6qEoLyo" txn_prev_events="[$WMGEVQ_3Dw87mMczAPWYM0cxlP3RfYqqa6Y7Rw67dLM]"
ERRO[2023-03-15T10:57:12.170118480Z] Failed to fetch key for server context=missing error="Post \"matrix://redpill.pw/_matrix/key/v2/query\": dial tcp: lookup redpill.pw on 94.237.127.9:53: no such host" fetcher=DirectKeyFetcher
WARN[2023-03-15T10:57:12.170227430Z] Failed to retrieve any keys context=missing fetcher=DirectKeyFetcher
WARN[2023-03-15T10:57:12.170559660Z] Couldn't validate signature of event "$07W9OSEWDvJ5EBtKbQjwkoRGRmxmMk3jNF09i38ASr8" from /event context=missing error="gomatrixserverlib: could not download key for \"redpill.pw\"" room_id="!FwbcAdwtvCYkHekZKf:talk.puri.sm" txn_event="$SIt8CSb3H-OqOezt2dWWKW9ZzOmNIFRBmI0B6qEoLyo" txn_prev_events="[$WMGEVQ_3Dw87mMczAPWYM0cxlP3RfYqqa6Y7Rw67dLM]"
ERRO[2023-03-15T10:57:12.230813450Z] Failed to fetch key for server context=missing error="Post \"matrix://matrix.foxtrot-community.cc/_matrix/key/v2/query\": dial tcp: lookup matrix.foxtrot-community.cc on 94.237.127.9:53: no such host" fetcher=DirectKeyFetcher
WARN[2023-03-15T10:57:12.231203060Z] Failed to retrieve any keys context=missing fetcher=DirectKeyFetcher
WARN[2023-03-15T10:57:12.231894200Z] Couldn't validate signature of event "$fYOfslGgiMsAkL38qPH1V2-NFy9l_0ccXgnHmkc0l2w" from /event context=missing error="gomatrixserverlib: could not download key for \"matrix.foxtrot-community.cc\"" room_id="!FwbcAdwtvCYkHekZKf:talk.puri.sm" txn_event="$SIt8CSb3H-OqOezt2dWWKW9ZzOmNIFRBmI0B6qEoLyo" txn_prev_events="[$WMGEVQ_3Dw87mMczAPWYM0cxlP3RfYqqa6Y7Rw67dLM]"
Steps to reproduce
"Could not reproduce": I have restarted the server, but it did not crash again within the first ~30min.