Skip to content
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

relation "accounts" does not exist at character 454 #32

Open
major opened this issue Dec 22, 2022 · 10 comments
Open

relation "accounts" does not exist at character 454 #32

major opened this issue Dec 22, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@major
Copy link

major commented Dec 22, 2022

Each time I try to deploy this helm chart with the included postgres, the deployment fails and the postgres container has this in the logs:

2022-12-22 20:13:15.277 GMT [1] LOG:  pgaudit extension initialized
2022-12-22 20:13:15.281 GMT [1] LOG:  starting PostgreSQL 14.2 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2022-12-22 20:13:15.281 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-12-22 20:13:15.282 GMT [1] LOG:  listening on IPv6 address "::", port 5432
2022-12-22 20:13:15.283 GMT [1] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-12-22 20:13:15.287 GMT [155] LOG:  database system was shut down at 2022-12-22 20:13:15 GMT
2022-12-22 20:13:15.309 GMT [1] LOG:  database system is ready to accept connections
2022-12-22 20:13:26.068 GMT [169] ERROR:  relation "accounts" does not exist at character 454
2022-12-22 20:13:26.068 GMT [169] STATEMENT:  SELECT a.attname, format_type(a.atttypid, a.atttypmod),
	       pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
	       c.collname, col_description(a.attrelid, a.attnum) AS comment
	  FROM pg_attribute a
	  LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
	  LEFT JOIN pg_type t ON a.atttypid = t.oid
	  LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
	 WHERE a.attrelid = '"accounts"'::regclass
	   AND a.attnum > 0 AND NOT a.attisdropped
	 ORDER BY a.attnum
@deepy
Copy link
Contributor

deepy commented Dec 22, 2022

Did the -db-migrate job finish successfully?

@CSDUMMI
Copy link

CSDUMMI commented Jan 18, 2023

I'm facing this exact issue on a Mastodon deployment with docker-compose.

How would I check if the -db-migrate job finished successfully?

@deepy
Copy link
Contributor

deepy commented Jan 22, 2023

Is the pod or the job from the migration job still around?
Do you have access to the logs from the migration job?

@dictvm
Copy link

dictvm commented Feb 10, 2023

I'm facing the same issue.

These are the logs of the dbmigrate pod and the job: https://gist.github.com/dictvm/0d8200f323b2d8aeaf9638a1521d20b0

@renchap renchap added the bug Something isn't working label Feb 17, 2023
@JeffBusch
Copy link

I'm getting this same error on a fresh setup. I noticed in my web container I also have the error:

/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `exec': ERROR:  relation "accounts" does not exist (PG::UndefinedTable)
LINE 8:  WHERE a.attrelid = '"accounts"'::regclass

@zolero
Copy link

zolero commented Mar 15, 2023

This issue still exist...

@waldemarschroeder
Copy link

The solution is in https://github.com/felx/mastodon-documentation/blob/master/Running-Mastodon/Docker-Guide.md
I did "docker-compose run --rm web rake mastodon:setup" and build a correct database.

@dictvm
Copy link

dictvm commented Jul 28, 2023

@waldemarschroeder thanks, but this doesn't help when using the Helm Chart. For some reason the db-migrate is not being created when installing the chart.

@waldemarschroeder
Copy link

@dictvm I did a successful Mastodon Installation with docker. With Docker you can use "docker-compose run --rm web rake db:migrate" to do a db migration. In Kubernetes you should be able to do the same with kubectl. Source: https://github.com/felx/mastodon-documentation/blob/master/Running-Mastodon/Docker-Guide.md

@dictvm
Copy link

dictvm commented Jul 29, 2023

Hey there, thanks! We fixed the issue by moving the db-migrate job to an initContainer in the mastodon-web Deployment.

We'll probably provide a PR some time next week, in case anyone else is interested in that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants