-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helm chart unable to create fresh server: relation "accounts" does not exist
unless db migration job is run manually
#18
Comments
Have you tried restarting (deleting) the sidekiq and web pods? I've seen enough weird behavior similar to what you report on chart based deployments that I restart those two pods as a rule now after release. I have not seen failed migrations. |
This was not a migration. This was a fresh install. (I'm trying out mastodon for the first time), which is I believe, why it was deadlocking. Web container requires the DB tables to start -> DB tables require the DB job to have run atleast once -> DB job currently waits for the web container/sidekiq to be up to run -> ... (deadlock) Side note, I think the jobs containers did not get upgraded to v4? |
I am also talking about a fresh install. A db migration happens both on initial install and on upgrades. This is what determines the version of the db migrate job container: |
Oh, I known what happened with the job's container version. I was testing with v3 to see if the helm chart using V3 would work. I exported to a file to dig around. Must have forgotten to do that before I pulled the jobs to run manually (which was my eventual solution to get mastodon running at all). Regarding restarting, I guess deleting the pods may have caused the jobs to exist but I don't know. It feels really hacky to have that kind of problem, and I feel the original deadlock problem should still be addressed. |
I agree. I think the problem is that the web and sidekiq pods manage to come up partway through the migration, but don't quite end up in the right state. Restarting them after These lines here make an effort to order the job relative to other things: https://github.com/mastodon/mastodon/blob/main/chart/templates/job-db-migrate.yaml#L8-L10 I've not thought about that vs the startup of the other containers. |
I also experience this issue regularly. Makes it rather difficult to run helm from Terraform because an |
I face the same issue. I'm also wondering how I can trigger the run of the initialization of a fresh postgres instance? the error log of the web container shows:
the sidekiq one:
|
As a workaround you can:
This is not great but it should take care of the database initialization. |
Steps to reproduce the problem
Creating a fresh, completely new mastodon server using the helm chart fails to initialize. It appears that the database tables required are not initialized as both the web and sidekiq containers return
relation "accounts" does not exist
From my casual perusal, it appears that the creation of the tables should be done by job-db-migrate.yaml, but it never runs as the web container is never finished installing it needs the tables to be initialized, and is thus stuck in a crash loop.
Executing the template to a file, copying the job from there and manually
kubectl
ing the db migration job results in a deployment.Expected behaviour
Helm chart should spin up database tables
Actual behaviour
Web and sidekiq containers booting
Detailed description
No response
Specifications
Chart v 3.0.0,
Tag: latest (v4.0.2)
K8s
The text was updated successfully, but these errors were encountered: