Internal error checking workspace agent authorization (after db reinit from dump)
Hi.
Today we tried to update Coder from v2.9.1 to v2.9.3 but the DB got corrupted (probably because of 2 pgsql instances running at the same time, rookie mistake).
We have PG dumps each day, so I tried to run v2.9.3 version and import the backup dump (schema + data) from last known working version; the Coder works, I can access the dashboard, the data is there, but now all workspaces created show me the following error:
Agent side:
Coder side:
I have tried investigating if the problem lies in some schema change, but that didn't help. I have also tried running v2.9.0, no change.
If anybody has any idea, it would be very appreciated!
7 Replies
<#1231901122399047690>
Category
Bug report
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
More detailed query:
Seems like v2.10.1 fixed our problems; there might be some internal schema problem between v2.9 and v2.10, or just a coincidence 🤷♂️
We didn't make any schema changes from 2.9.0 -> 2.9.3 apart from a fix to remove a hardcoded public schema in a migration (https://github.com/coder/coder/issues/12619). That relates to a different table altogether and shouldn't actually change the resulting database schema.
I tried reproducing your issue by running a fresh v2.9.1 install, upgrading to v2.9.3, and downgrading to v2.9.0 but couldn't reproduce the error you provided above.
However, now that you're on v2.10 I would advise against downgrading.
We're running coder from the start of v2 and it sounds like it might have something to do with existing PG dump data not importing correctly on a fresh v2.9 install. But for now the issue is fine on v2.10
hmm.
Maybe it's random 🤷♂️ idk
if it happens again I'll report with more info 😄
Can't exactly share the dump with company data 😅
Would love to cleanup the dump (about 65 MB) sometime as well, some old remnants (after v0 to v2 migration) might be interfering with updates 🤔
You can dump just the schema like we do here: https://github.com/coder/coder/blob/main/coderd/database/gen/dump/main.go#L53
I'm working on some extra tests around migration between versions right now, which is why this is of particular interest to me