Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Postgres container fails to start due to permissions issue#1215

achint740 started this conversation inGeneral
Discussion options

Hello everyone,

I know this issueFATAL: data directory "/var/lib/postgresql/data" has wrong ownership has been discussed a lot of times. I've gone through a lot of such issues and tried to fix it at my end, but none has been helpful. I will list down more details below.

I am using this docker image :postgres:12.5-alpine. I have a NFS mount like/<nfs_mount_name>/postgres/data.
Earlier my deployment was using docker-compose through the root user but recently I am trying to shift to using podman.

The NFS mount has permissionsdrwxr-xr-x with the owner being, say user 'A' and group 'B'. Now, I try to run a container usingpodman run --user <uid_of_user_A>:<gid_of_user_B> -v <my_nfs_mount>:/var/lib/postgresql/data --env-file .env.pg postgres:12.5-alpine
The.env.pg containsPOSTGRES_USER andPOSTGRES_PASSWORD.

The detailed error look like :

chmod: /var/lib/postgresql/data: Operation not permittedchmod: /var/run/postgresql: Operation not permittedPostgreSQL Database directory appears to contain a database; Skipping initialization FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership HINT:  The server must be started by the user that owns the data directory.

Let me know for any additonal information required. Any help would be much appreciated!
Thanks

You must be logged in to vote

Replies: 2 comments

Comment options

@yosifkit if you might have more context and can help here? Sorry for tagging, but I noticed your solutions in a couple of similar cases to be useful.
Thanks

You must be logged in to vote
0 replies
Comment options

... podman run --user <uid_of_user_A>:<gid_of_user_B> -v <my_nfs_mount>:/var/lib/postgresql/data

This documentation athttps://github.com/eriksjolund/podman-detect-option#example-3-use-detected-option-when-running-postgres-on-macos recommends using--userns=keep-id:uid=999,gid=999 on macOS

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@achint740@ImreSamu
Converted from issue

This discussion was converted from issue #1213 on March 22, 2024 16:14.


[8]ページ先頭

©2009-2025 Movatter.jp