Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied on data directory after redeploy #499

Open
ericlindersson opened this issue Jun 7, 2024 · 5 comments
Open

Permission denied on data directory after redeploy #499

ericlindersson opened this issue Jun 7, 2024 · 5 comments
Labels
type/question 🙋 Further information is requested

Comments

@ericlindersson
Copy link

Hi,
When I use this image in a docker compose stack and make changes to redeploy with the same volume for data I get permission denied when the service tries to take owenership (chown and chmod) of the already existing data.

Is there something I can do to fix this in my setup or is it a bug?
I have tried both mapped nfs volumes and ./postges for the data.

Regards

@VoVAllen
Copy link
Member

VoVAllen commented Jun 7, 2024

Can you post your full error message? We didn't have anything special with permission other than postgres.

@ericlindersson
Copy link
Author

Can you post your full error message? We didn't have anything special with permission other than postgres.

This is the only log, repeating

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted find: ‘/var/lib/postgresql/data’: Permission denied

@VoVAllen
Copy link
Member

VoVAllen commented Jun 7, 2024

Which image are you using? Are you using a CNPG image?

@ericlindersson
Copy link
Author

ericlindersson commented Jun 7, 2024

Which image are you using? Are you using a CNPG image?

I use exactly this image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0

I now realized this only happens when I use a mapped volume

This is the config:
database:
container_name: immich_postgres
image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
restart: always
command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]

@gaocegege gaocegege added the type/question 🙋 Further information is requested label Jun 14, 2024
@ArjenR
Copy link

ArjenR commented Sep 25, 2024

@ericlindersson I am hitting this issue at the moment. Did you find a way to resolve this other than setting selinux to permissive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question 🙋 Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants