pgvecto.rs icon indicating copy to clipboard operation
pgvecto.rs copied to clipboard

Permission denied on data directory after redeploy

Open ericlindersson opened this issue 1 year ago • 5 comments

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

ericlindersson avatar Jun 07 '24 05:06 ericlindersson

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

VoVAllen avatar Jun 07 '24 06:06 VoVAllen

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

ericlindersson avatar Jun 07 '24 07:06 ericlindersson

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

VoVAllen avatar Jun 07 '24 07:06 VoVAllen

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"]

ericlindersson avatar Jun 07 '24 08:06 ericlindersson

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

ArjenR avatar Sep 25 '24 14:09 ArjenR