truenas / charts

TrueNAS SCALE Apps Catalogs & Charts
BSD 3-Clause "New" or "Revised" License
296 stars 282 forks source link

Gitea installation failed [TrueNAS-SCALE-23.10.2] #2248

Closed BalancedTernary closed 6 months ago

BalancedTernary commented 6 months ago
2024-03-04 17:47:59
Back-off restarting failed container gitea in pod gitea-cb78d9b7d-tz6vd_ix-gitea(d24fcbb9-c8a7-4183-a02d-e9607caf11ee)
2024-03-04 17:47:54
Container image "gitea/gitea:1.21.7-rootless" already present on machine
2024-03-04 17:47:50
Created container gitea
2024-03-04 17:47:50
Started container gitea
2024-03-04 17:47:49
Successfully pulled image "gitea/gitea:1.21.7-rootless" in 8m22.101021886s (8m22.101034523s including waiting)
2024-03-04 17:39:27
Pulling image "gitea/gitea:1.21.7-rootless"
2024-03-04 17:39:00
Started container gitea-init-postgres-wait
2024-03-04 17:39:00
Created container gitea
2024-03-04 17:39:00
Started container gitea
2024-03-04 17:38:59
Successfully pulled image "postgres:15.2" in 23m45.433988458s (23m45.433999325s including waiting)
2024-03-04 17:38:59
Successfully pulled image "postgres:15.2" in 23m45.441707405s (23m45.441769188s including waiting)
2024-03-04 17:38:59
Created container gitea-init-postgres-wait
2024-03-04 17:15:14
Pulling image "postgres:15.2"
2024-03-04 17:15:14
Pulling image "postgres:15.2"
2024-03-04 17:15:13
Created container gitea-install-permissions
2024-03-04 17:15:13
Started container gitea-install-permissions
2024-03-04 17:15:12
Add eth0 [172.16.0.10/16] from ix-net
2024-03-04 17:15:12
Container image "bash:4.4.23" already present on machine
2024-03-04 17:15:12
Container image "bash:4.4.23" already present on machine
2024-03-04 17:15:12
Created container gitea-install-01-permissions
2024-03-04 17:15:12
Started container gitea-install-01-permissions
2024-03-04 17:15:11
Scaled up replica set gitea-cb78d9b7d to 1
2024-03-04 17:15:11
Scaled up replica set gitea-postgres-5ff5c47f9d to 1
2024-03-04 17:15:11
Created pod: gitea-postgres-5ff5c47f9d-fsqhc
2024-03-04 17:15:11
Created pod: gitea-cb78d9b7d-tz6vd
2024-03-04 17:15:11
Successfully assigned ix-gitea/gitea-postgres-5ff5c47f9d-fsqhc to ix-truenas
2024-03-04 17:15:11
Successfully assigned ix-gitea/gitea-cb78d9b7d-tz6vd to ix-truenas

gitea-postgres pod log

2024-03-04 17:39:00.402581+08:00The files belonging to this database system will be owned by user "postgres".
2024-03-04 17:39:00.402658+08:00This user must also own the server process.
2024-03-04 17:39:00.402678+08:002024-03-04T17:39:00.402678351+08:00
2024-03-04 17:39:00.402775+08:00The database cluster will be initialized with locale "en_US.utf8".
2024-03-04 17:39:00.402803+08:00The default database encoding has accordingly been set to "UTF8".
2024-03-04 17:39:00.402811+08:00The default text search configuration will be set to "english".
2024-03-04 17:39:00.402826+08:002024-03-04T17:39:00.402826298+08:00
2024-03-04 17:39:00.402832+08:00Data page checksums are disabled.
2024-03-04 17:39:00.402847+08:002024-03-04T17:39:00.402847904+08:00
2024-03-04 17:39:00.402950+08:00fixing permissions on existing directory /var/lib/postgresql/data ... ok
2024-03-04 17:39:00.404762+08:00creating subdirectories ... ok
2024-03-04 17:39:00.404948+08:00selecting dynamic shared memory implementation ... posix
2024-03-04 17:39:00.434873+08:00selecting default max_connections ... 100
2024-03-04 17:39:00.468729+08:00selecting default shared_buffers ... 128MB
2024-03-04 17:39:00.468932+08:00selecting default time zone ... UTC
2024-03-04 17:39:00.471069+08:00creating configuration files ... ok
2024-03-04 17:39:00.595909+08:00running bootstrap script ... ok
2024-03-04 17:39:00.996969+08:00performing post-bootstrap initialization ... ok
2024-03-04 17:39:01.155908+08:00initdb: warning: enabling "trust" authentication for local connections
2024-03-04 17:39:01.155908+08:00syncing data to disk ... ok
2024-03-04 17:39:01.156076+08:002024-03-04T17:39:01.156076539+08:00
2024-03-04 17:39:01.156089+08:002024-03-04T17:39:01.156089279+08:00
2024-03-04 17:39:01.156099+08:00Success. You can now start the database server using:
2024-03-04 17:39:01.156108+08:002024-03-04T17:39:01.156108193+08:00
2024-03-04 17:39:01.155977+08:00initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
2024-03-04 17:39:01.156116+08:00pg_ctl -D /var/lib/postgresql/data -l logfile start
2024-03-04 17:39:01.156168+08:002024-03-04T17:39:01.156168935+08:00
2024-03-04 17:39:01.249081+08:00waiting for server to start....2024-03-04 09:39:01.248 UTC [35] LOG:  starting PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2024-03-04 17:39:01.250733+08:002024-03-04 09:39:01.250 UTC [35] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-03-04 17:39:01.286341+08:002024-03-04 09:39:01.286 UTC [38] LOG:  database system was shut down at 2024-03-04 09:39:00 UTC
2024-03-04 17:39:01.309055+08:002024-03-04 09:39:01.308 UTC [35] LOG:  database system is ready to accept connections
2024-03-04 17:39:01.400818+08:00done
2024-03-04 17:39:01.400871+08:00server started
2024-03-04 17:39:01.660649+08:00CREATE DATABASE
2024-03-04 17:39:01.662110+08:002024-03-04T17:39:01.662110365+08:00
2024-03-04 17:39:01.662371+08:002024-03-04T17:39:01.662371196+08:00
2024-03-04 17:39:01.662439+08:00/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2024-03-04 17:39:01.662488+08:002024-03-04T17:39:01.662488213+08:00
2024-03-04 17:39:01.665342+08:002024-03-04 09:39:01.665 UTC [35] LOG:  received fast shutdown request
2024-03-04 17:39:01.672660+08:00waiting for server to shut down....2024-03-04 09:39:01.672 UTC [35] LOG:  aborting any active transactions
2024-03-04 17:39:01.675596+08:002024-03-04 09:39:01.675 UTC [35] LOG:  background worker "logical replication launcher" (PID 41) exited with exit code 1
2024-03-04 17:39:01.675644+08:002024-03-04 09:39:01.675 UTC [36] LOG:  shutting down
2024-03-04 17:39:01.685950+08:002024-03-04 09:39:01.685 UTC [36] LOG:  checkpoint starting: shutdown immediate
2024-03-04 17:39:04.651740+08:00..2024-03-04 09:39:04.651 UTC [36] LOG:  checkpoint complete: wrote 918 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.021 s, sync=2.904 s, total=2.976 s; sync files=250, longest=0.037 s, average=0.012 s; distance=4217 kB, estimate=4217 kB
2024-03-04 17:39:04.668545+08:002024-03-04 09:39:04.668 UTC [35] LOG:  database system is shut down
2024-03-04 17:39:04.672624+08:00done
2024-03-04 17:39:04.672671+08:00server stopped
2024-03-04 17:39:04.675644+08:002024-03-04T17:39:04.675644648+08:00
2024-03-04 17:39:04.675716+08:00PostgreSQL init process complete; ready for start up.
2024-03-04 17:39:04.675735+08:002024-03-04T17:39:04.675735842+08:00
2024-03-04 17:39:04.745331+08:002024-03-04 09:39:04.745 UTC [1] LOG:  starting PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2024-03-04 17:39:04.745571+08:002024-03-04 09:39:04.745 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-03-04 17:39:04.745616+08:002024-03-04 09:39:04.745 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-03-04 17:39:04.759616+08:002024-03-04 09:39:04.759 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-03-04 17:39:04.781727+08:002024-03-04 09:39:04.781 UTC [51] LOG:  database system was shut down at 2024-03-04 09:39:04 UTC
2024-03-04 17:39:04.801301+08:002024-03-04 09:39:04.801 UTC [1] LOG:  database system is ready to accept connections
2024-03-04 17:44:04.799259+08:002024-03-04 09:44:04.798 UTC [49] LOG:  checkpoint starting: time
2024-03-04 17:44:08.963540+08:002024-03-04 09:44:08.963 UTC [49] LOG:  checkpoint complete: wrote 44 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.112 s, sync=0.019 s, total=4.165 s; sync files=12, longest=0.009 s, average=0.002 s; distance=252 kB, estimate=252 kB

gitea pod log

2024-03-04 18:13:52.439486+08:00mkdir: can't create directory '/var/lib/gitea/git': Permission denied
2024-03-04 18:13:52.439658+08:00/var/lib/gitea/git is not writable
2024-03-04 18:13:52.439939+08:00docker setup failed
stavros-k commented 6 months ago

Hello, did you used ixVolumes or hostPath for the storage locations? If it was hostPath, did you set the permissions to the same uid/gid as the Run As values?

Thanks

BalancedTernary commented 6 months ago

Hello, did you used ixVolumes or hostPath for the storage locations? If it was hostPath, did you set the permissions to the same uid/gid as the Run As values?

Thanks

Yes, I am using hostPath and I have set appropriate permissions for the dataset (netdata user and docker group). However, upon failure to run it, I found that the docker group permissions were revoked. I opened the app again and ran it again, obtaining the same result.

stavros-k commented 6 months ago

For the database directories (pg data and pgbackup) you need 999:999 and for gitea directories (data and config) you need the user:group you set on the User and Group Configuration section

BalancedTernary commented 6 months ago

For the database directories (pg data and pgbackup) you need 999:999 and for gitea directories (data and config) you need the user:group you set on the User and Group Configuration section

I have granted full access to gitea data and gitea config to root users and groups, as well as admin users and groups. But the same problem still arises.(The database appears to be working properly)

stavros-k commented 6 months ago

Giving access to root and admin wont help. You have to give access to the IDs you set on User and Group Configuration section.

Alternatively you can install it with ixVolumes and see exactly what the persmissions should be.

BalancedTernary commented 6 months ago

Giving access to root and admin wont help. You have to give access to the IDs you set on User and Group Configuration section.

Alternatively you can install it with ixVolumes and see exactly what the persmissions should be.

I don't know how to establish associations between users, groups, and apps. However, I found a built-in user group called Apps. After I granted it permissions, it can now start normally.

stavros-k commented 6 months ago

Yep the 568 id is the apps user.

But containers dont always match 1:1 with host's users. Glad you got it working!

Closing this now!

Thanks!