Problem with Phoenix #289

Closed
opened 2022-11-18 12:28:42 +00:00 by nithou · 21 comments

I try to move from Pleroma to Akkoma in a Docker, but I keep encountering this error when I try to start the Pleroma_web container, any idea how I could fix it?

2022-11-18T12:22:54.416543256Z stdout -- Waiting for database...
2022-11-18T12:22:53.168659349Z stdout (elixir 1.13.4) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
2022-11-18T12:22:53.168624144Z stdout | ^
2022-11-18T12:22:53.168579995Z stdout 1 | defmodule <%= inspect auth_module %> do
2022-11-18T12:22:53.168545021Z stdout |
2022-11-18T12:22:53.168492224Z stdout ** (SyntaxError) lib/phoenix-1.6.11/priv/templates/phx.gen.auth/auth.ex:1:13: syntax error before: '='
2022-11-18T12:22:53.168382921Z stdout == Compilation error in file lib/phoenix-1.6.11/priv/templates/phx.gen.auth/auth.ex ==

I try to move from Pleroma to Akkoma in a Docker, but I keep encountering this error when I try to start the Pleroma_web container, any idea how I could fix it? 2022-11-18T12:22:54.416543256Z stdout -- Waiting for database... 2022-11-18T12:22:53.168659349Z stdout (elixir 1.13.4) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7 2022-11-18T12:22:53.168624144Z stdout | ^ 2022-11-18T12:22:53.168579995Z stdout 1 | defmodule <%= inspect auth_module %> do 2022-11-18T12:22:53.168545021Z stdout | 2022-11-18T12:22:53.168492224Z stdout ** (SyntaxError) lib/phoenix-1.6.11/priv/templates/phx.gen.auth/auth.ex:1:13: syntax error before: '=' 2022-11-18T12:22:53.168382921Z stdout == Compilation error in file lib/phoenix-1.6.11/priv/templates/phx.gen.auth/auth.ex ==

gonna need way more info here - pleroma_web isn't a container that we have in our supported socker-compose file

are you using some external repo?

gonna need way more info here - `pleroma_web` isn't a container that we have in our supported socker-compose file are you using some external repo?
Author

Was coming from this installation : https://github.com/angristan/docker-pleroma

Changed this in the Dockerfile :

FROM elixir:1.13-alpine
RUN git clone -b stable https://akkoma.dev/AkkomaGang/akkoma.git /pleroma \

Reimported the pleroma_db to a new container then when I try to start it back I have the phoenix error :/

Was coming from this installation : https://github.com/angristan/docker-pleroma Changed this in the Dockerfile : FROM elixir:1.13-alpine RUN git clone -b stable https://akkoma.dev/AkkomaGang/akkoma.git /pleroma \ Reimported the pleroma_db to a new container then when I try to start it back I have the phoenix error :/
1.1 KiB

i would highly recommend saving your pleroma_db container and using it in the official docker-compose method

https://docs.akkoma.dev/stable/installation/docker_en/

i would highly recommend saving your `pleroma_db` container and using it in the official docker-compose method https://docs.akkoma.dev/stable/installation/docker_en/
Author

Tried it, but then the container got stuck with errors like this and never started :/

10:13:37.384 [error] QUERY OK db=0.4ms
server_1 | begin []
server_1 |
server_1 |
server_1 | 10:13:37.388 [error] QUERY OK source="oban_jobs" db=2.8ms
server_1 | UPDATE "public"."oban_jobs" AS o0 SET "state" = $1 WHERE (o0."id" IN (SELECT so0."id" FROM "public"."oban_jobs" AS so0 WHERE (so0."state" IN ('scheduled','retryable')) AND (so0."queue" = $2) AND (so0."scheduled_at" <= $3) FOR UPDATE SKIP LOCKED)) ["available", "token_expiration", ~U[2022-11-18 10:13:37.384205Z]]

Tried it, but then the container got stuck with errors like this and never started :/ 10:13:37.384 [error] QUERY OK db=0.4ms server_1 | begin [] server_1 | server_1 | server_1 | 10:13:37.388 [error] QUERY OK source="oban_jobs" db=2.8ms server_1 | UPDATE "public"."oban_jobs" AS o0 SET "state" = $1 WHERE (o0."id" IN (SELECT so0."id" FROM "public"."oban_jobs" AS so0 WHERE (so0."state" IN ('scheduled','retryable')) AND (so0."queue" = $2) AND (so0."scheduled_at" <= $3) FOR UPDATE SKIP LOCKED)) ["available", "token_expiration", ~U[2022-11-18 10:13:37.384205Z]]

did you run migrations?

those logs alone doesn't show anything really

did you run migrations? those logs alone doesn't show anything really
Author

Yes as I was coming from an older version of Postgres, I remimported the database through sudo docker-compose exec -T db psql -U pleroma < dumpfile, did I forgot something?

Yes as I was coming from an older version of Postgres, I remimported the database through sudo docker-compose exec -T db psql -U pleroma < dumpfile, did I forgot something?

by migrations, i mean did you run ./docker-resources/manage.sh mix ecto.migrate?

by migrations, i mean did you run `./docker-resources/manage.sh mix ecto.migrate`?
Author

Could proceed as at this line :
"docker-compose run --rm akkoma psql -h db -U akkoma -f config/setup_db.psql"

It returned an error:
psql: error: could not translate host name "db" to address: Name does not resolve

Could proceed as at this line : "docker-compose run --rm akkoma psql -h db -U akkoma -f config/setup_db.psql" It returned an error: psql: error: could not translate host name "db" to address: Name does not resolve

yes, there are setup steps above it

you need to get the DB running

yes, there are setup steps above it you need to get the DB running
Author

I'll try to restart from the start

I'll try to restart from the start
https://docs.akkoma.dev/stable/installation/docker_en/#setting-up-the-database
Author

Just one question when should I run the db import? After or before the ecto.migrate?

Just one question when should I run the db import? After or before the ecto.migrate?

before

before
Author

Ok, first problem I encounter is this one:

addgroup: gid '0' in use
The command '/bin/sh -c addgroup -g $GID $UNAME' returned a non-zero code: 1

Do I edit the build.sh to force use of another UIG/GID ?

Sorry so much for the questions, I'm not used to dig that much in Docker so it's beyond my skills

Ok, first problem I encounter is this one: addgroup: gid '0' in use The command '/bin/sh -c addgroup -g $GID $UNAME' returned a non-zero code: 1 Do I edit the build.sh to force use of another UIG/GID ? Sorry so much for the questions, I'm not used to dig that much in Docker so it's beyond my skills

the only chance you have to run into this issue is if you

  1. are running as root (please do not do that)
  2. skipped https://docs.akkoma.dev/stable/installation/docker_en/#set-up-basic-configuration
the only chance you have to run into this issue is if you 1. are running as root (please do not do that) 2. skipped https://docs.akkoma.dev/stable/installation/docker_en/#set-up-basic-configuration
Author

Ok I was indeed using sudo, as when I try to not use it it gives me a Permission Denied when trying to run docker-compose, but it might be due to something blocking it in Synology

Ok I was indeed using sudo, as when I try to not use it it gives me a Permission Denied when trying to run docker-compose, but it might be due to something blocking it in Synology

sudo usermod -a -G docker <myuser>

then re-login

`sudo usermod -a -G docker <myuser>` then re-login
Author

Synology refuses usermod, I had to do the following steps:https://davejansen.com/manage-docker-without-needing-sudo-on-your-synology-nas

But now it gives the same error with

addgroup: gid '100' in use
The command '/bin/sh -c addgroup -g $GID $UNAME' returned a non-zero code: 1

Synology refuses usermod, I had to do the following steps:https://davejansen.com/manage-docker-without-needing-sudo-on-your-synology-nas But now it gives the same error with addgroup: gid '100' in use The command '/bin/sh -c addgroup -g $GID $UNAME' returned a non-zero code: 1

can't really help you with custom linux distributions, you're on your own here

can't really help you with custom linux distributions, you're on your own here
Author

Ok I forced a GUID & UID in build.sh and it was able to build :) Now reaching the steps for the db it gives this :

Creating akkoma_db_run ... done
akkoma_db_run_615f5c9efd58
[NASAADRESS]:/volume1/docker/akkoma$ docker-compose run --rm akkoma psql -h db -U akkoma -f config/setup_db.psql
Creating akkoma_akkoma_run ... done
psql: error: could not translate host name "db" to address: Name does not resolve
ERROR: 2

Ok I forced a GUID & UID in build.sh and it was able to build :) Now reaching the steps for the db it gives this : Creating akkoma_db_run ... done akkoma_db_run_615f5c9efd58 [NASAADRESS]:/volume1/docker/akkoma$ docker-compose run --rm akkoma psql -h db -U akkoma -f config/setup_db.psql Creating akkoma_akkoma_run ... done psql: error: could not translate host name "db" to address: Name does not resolve ERROR: 2
Author

It does look like the db has permissions issues too

2022-11-18T13:29:01.713147361Z stdout fixing permissions on existing directory /var/lib/postgresql/data ...
2022-11-18T13:29:01.682355179Z stdout
2022-11-18T13:29:01.682313173Z stdout Data page checksums are disabled.
2022-11-18T13:29:01.682278413Z stdout
2022-11-18T13:29:01.682228303Z stdout The default text search configuration will be set to "english".
2022-11-18T13:29:01.682181329Z stdout The default database encoding has accordingly been set to "UTF8".
2022-11-18T13:29:01.682052738Z stdout The database cluster will be initialized with locale "en_US.utf8".
2022-11-18T13:29:01.682046887Z stderr initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

It does look like the db has permissions issues too 2022-11-18T13:29:01.713147361Z stdout fixing permissions on existing directory /var/lib/postgresql/data ... 2022-11-18T13:29:01.682355179Z stdout 2022-11-18T13:29:01.682313173Z stdout Data page checksums are disabled. 2022-11-18T13:29:01.682278413Z stdout 2022-11-18T13:29:01.682228303Z stdout The default text search configuration will be set to "english". 2022-11-18T13:29:01.682181329Z stdout The default database encoding has accordingly been set to "UTF8". 2022-11-18T13:29:01.682052738Z stdout The database cluster will be initialized with locale "en_US.utf8". 2022-11-18T13:29:01.682046887Z stderr initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma#289
No description provided.