Closed fabballe closed 2 years ago
Hi, @fabballe, I'm sorry for the late response. The embedded postgres should be launched under the same user as the build is running (just inheriting it from the parent process), there is currently no option to change that directly from the library. And If you are running the build as root user, that is probably the cause of the problem. Because PostgreSQL has a restriction that the process must be run as non-root user, otherwise the initialization of the database fails.
I'm not an expert in kubernetes, but in general, you need to create a non-root user inside the pod and use it to run the build.
Probably adding nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
to /etc/passwd
will also fix that error as the error indicates the temporary nobody
uid 65534
(which seems to be the default temporary uid for unshare -U
) /etc/passwd
entry is missing.
Hi, I am not able to add new user inside my pod configuration for security reason. For this reason I have to switch to another lib to handle embedded psql inside my UT.
Hi,
First of all , thanks for your amazing lib :+1:
Nevertheless I have an issue while I try to integrate it.
Locally I achieve to launch my test but when I try to launch it through my Jenkins CI (pipeline branch). I got an issue during the init phase:
it seems there is an issue during user match:
initdb: could not look up effective user ID 65534: user does not exist
. As I am inside a temporary kubernetes pod inside my jenkins I work with a root user.Locally everything seems to work
Is there a way to choose the user to use to launch the embedded postgres ? Do you have any hint to fix this ?
My dependencies if it can help
Thanks for you reply