Closed ajs6f closed 10 months ago
This error doesn’t look good - I’d try and resolve this first:
db | /usr/local/bin/docker-entrypoint.sh: line 173: /docker-entrypoint-initdb.d/10_create_ckandb.sh: Permission denied
Thank you @kowh-ai, that certainly seems like the root of the problem and I would very much like to fix it. Do you have any suggestions? Do I need to shell into that container and manually execute that script? Do you know why there is a permissions error occurring out of the box? Do I need to use a special user to start these containers?
You shouldn't need to manually run anything. However to troubleshoot this, you will need to try to recreate this error by logging into the db container.
Thank you, I will shell in and try to determine why the script failed to run. Am I correct to assume that the user trying to execute it is postgres
?
I have found the following ownership and perms:
-rwxr-x--- 1 root root 258 Nov 16 17:43 10_create_ckandb.sh
-rwxr-x--- 1 root root 288 Nov 16 17:43 20_create_datastore.sh
-rwxr-x--- 1 root root 232 Nov 16 17:43 30_setup_test_databases.sh
This would seem to conflict with the initialization procedures for the image (see last paragraph under "Additionally, as of..."). Perhaps that ownership somehow got mis-set on my docker compose up
? I am no Docker maven, but I do see that the relevant files are copied here and under the instructions for COPY I see:
All new files and directories are created with a UID and GID of 0, unless the optional --chown flag specifies a given username, groupname, or UID/GID combination to request specific ownership of the copied content.
which would seem to set up this problem?
I can confirm that adding a --chown
flag in the appropriate Dockerfile has solved this problem:
COPY --chown=postgres:postgres docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
although I still do not understand what is going on here. Obviously, the stock Dockerfile you supply works for the great majority of users or you would be inundated with the same report I have made... Since what I have done should, on the face of it, work for other users without causing any new problems, would you like a PR in which to consider this change?
Great!...yes please a PR would be great...thx
I'm trying to start up on RHEL 9.3 using commit b48be9783fd963f51f45a8cb88aead7bc3162663 and having the same db initialization problem that has been reported here before.
First, a section of log to show that I am starting from a clean slate:
Now, I try to start the Docker compose assembly. Please notice the lines:
and
and ultimately
Is there something I need to do here? I'm honestly not sure what else I can clean or prune. This is all happening on an RHEL 9.3 VM that was imaged just for this task and which has nothing else whatsoever going on.
Here is the full log for the
compose up
step, as mentioned above: