Database not properly initialized
While testing the branch backups_role
I found that opencell wasn't willing to wake up. Tracking down the issue, I find that postgres container only has one db that we created (opencell) but not keycloak (!!)
I follow the path from where we init the databases. It's in task "Download init-user-db script file.". So I check it and it is inside the container, well.
Expected:
$ sudo docker exec -it postgres-wildfly psql -U opencell
psql (11.3)
Type "help" for help.
opencell=> \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
keycloak | | {}
opencell | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Found:
$ sudo docker exec -it postgres-wildfly psql -U opencell
psql (11.3)
Type "help" for help.
opencell=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
opencell | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
I don't know why, the input-files have not been mounted well to the postgres docker. In a healthy server, we find this:
$ sudo docker exec -it postgres-wildfly ls -la /docker-entrypoint-initdb.d
total 1040
drwxr-xr-x 1 root root 4096 Jun 6 14:06 .
drwxr-xr-x 1 root root 4096 Jun 6 14:06 ..
-rw-r--r-- 1 1005 root 1050291 Apr 24 14:16 import-postgres.sql
-rw-r--r-- 1 1005 root 1892 Apr 24 14:16 init-user-db.sh
However, in this one, they are directories (!!)
$ sudo docker exec -it postgres-wildfly ls -la /docker-entrypoint-initdb.d
total 16
drwxr-xr-x 1 root root 4096 Jun 21 19:22 .
drwxr-xr-x 1 root root 4096 Jun 21 19:22 ..
drwxr-xr-x 2 root root 4096 Jun 5 09:01 import-postgres.sql
drwxr-xr-x 2 root root 4096 Jun 5 09:01 init-user-db.sh
See the d
and the 4096 size?
Edited by Administrator