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

dendrite not working after last patch from today on master #1949

Closed r3k2 closed 3 years ago

r3k2 commented 3 years ago

will have posted this on the #dendrite channel but cant login to matrix since server is down, sorry. I did a git pull and ./build.sh then restart as usually I do everyday but this time there are issues with the latest patches.

seDendrite file="github.com/matrix-org/dendrite/setup/base.go:146"
time="2021-07-28T18:08:18.716407887Z" level=panic msg="failed to connect to accounts db" func="github.com/matrix-org/dendrite/setup.(*BaseDendrite).CreateAccountsDB" file="github.com/matrix-org/dendrite/setup/base.go:286" error="pq: column \"etag\" of relation \"account_e2e_room_keys_versions\" does not exist"
time="2021-07-28T18:08:20.943605160Z" level=info msg="Dendrite version 0.4.1+ed409782" func=github.com/matrix-org/dendrite/setup.NewBaseDendrite file="github.com/matrix-org/dendrite/setup/base.go:113"
time="2021-07-28T18:08:20.944201744Z" level=info msg="DNS cache enabled (size 256, lifetime 300ns)" func=github.com/matrix-org/dendrite/setup.NewBaseDendrite file="github.com/matrix-org/dendrite/setup/base.go:146"
time="2021-07-28T18:08:20.964828404Z" level=panic msg="failed to connect to accounts db" func="github.com/matrix-org/dendrite/setup.(*BaseDendrite).CreateAccountsDB" file="github.com/matrix-org/dendrite/setup/base.go:286" error="pq: column \"etag\" of relation \"account_e2e_room_keys_versions\" does not exist"

seems a pq panic. nothing is working as of now. @neilalexander @kegsay

more info from pq log

Jul 28 18:13:51 matrix postgres[3303]: 2021-07-28 18:13:51.715 UTC [3303] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does >
Jul 28 18:13:51 matrix postgres[3303]: 2021-07-28 18:13:51.715 UTC [3303] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorith>
Jul 28 18:13:53 matrix postgres[3311]: 2021-07-28 18:13:53.964 UTC [3311] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does >
Jul 28 18:13:53 matrix postgres[3311]: 2021-07-28 18:13:53.964 UTC [3311] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorith>
Jul 28 18:13:56 matrix postgres[3320]: 2021-07-28 18:13:56.215 UTC [3320] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does >
Jul 28 18:13:56 matrix postgres[3320]: 2021-07-28 18:13:56.215 UTC [3320] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorith>
Jul 28 18:13:58 matrix postgres[3329]: 2021-07-28 18:13:58.464 UTC [3329] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does >
Jul 28 18:13:58 matrix postgres[3329]: 2021-07-28 18:13:58.464 UTC [3329] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorith>
Jul 28 18:14:00 matrix postgres[3337]: 2021-07-28 18:14:00.715 UTC [3337] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does >
Jul 28 18:14:00 matrix postgres[3337]: 2021-07-28 18:14:00.715 UTC [3337] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorit

edit: the whole lines:

Jul 28 18:18:41 matrix postgres[4458]: 2021-07-28 18:18:41.715 UTC [4458] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does not exist at character 75
Jul 28 18:18:41 matrix postgres[4458]: 2021-07-28 18:18:41.715 UTC [4458] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorithm, auth_data, etag) VALUES ($1, $2, $3, $4) RETURNING version
Jul 28 18:18:43 matrix postgres[4466]: 2021-07-28 18:18:43.964 UTC [4466] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does not exist at character 75
Jul 28 18:18:43 matrix postgres[4466]: 2021-07-28 18:18:43.964 UTC [4466] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorithm, auth_data, etag) VALUES ($1, $2, $3, $4) RETURNING version
Jul 28 18:18:46 matrix postgres[4475]: 2021-07-28 18:18:46.215 UTC [4475] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does not exist at character 75
Jul 28 18:18:46 matrix postgres[4475]: 2021-07-28 18:18:46.215 UTC [4475] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorithm, auth_data, etag) VALUES ($1, $2, $3, $4) RETURNING version
Jul 28 18:18:48 matrix postgres[4484]: 2021-07-28 18:18:48.464 UTC [4484] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does not exist at character 75
Jul 28 18:18:48 matrix postgres[4484]: 2021-07-28 18:18:48.464 UTC [4484] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorithm, auth_data, etag) VALUES ($1, $2, $3, $4) RETURNING version
Jul 28 18:18:50 matrix postgres[4494]: 2021-07-28 18:18:50.715 UTC [4494] ERROR:  column "etag" of relation "account_e2e_room_keys_versions" does not exist at character 75
Jul 28 18:18:50 matrix postgres[4494]: 2021-07-28 18:18:50.715 UTC [4494] STATEMENT:  INSERT INTO account_e2e_room_keys_versions(user_id, algorithm, auth_data, etag) VALUES ($1, $2, $3, $4) RETURNING version

any fast fix ?

HenrikSolver commented 3 years ago

There were some discussions about this in #dendrite room earlier today (I had the same problem). The solution is to DROP TABLE account_e2e_room_keys_versions from the accounts db.

r3k2 commented 3 years ago

There were some discussions about this in #dendrite room earlier today (I had the same problem). The solution is to DROP TABLE account_e2e_room_keys_versions from the accounts db.

thanks so much! I will try that. and will post here in case others come looking.

[update] This does work. Thanks

S7evinK commented 3 years ago

@r3k2 you probably also want to change your global.dns_cache.cache_lifetime value as there were changes in #1926. Yours is set to 300ns right now.

r3k2 commented 3 years ago

@r3k2 you probably also want to change your global.dns_cache.cache_lifetime value as there were changes in #1926. Yours is set to 300ns right now.

@S7evinK thanks, I just changed it to 5m as on that PR.

kegsay commented 3 years ago

This seems resolved now. Closing.