/rsa_key.pem" for writing, No such file or directory

Hello all

I wanted to integrate Bitwarden_rs in my docker environment on a raspi4 behind a traefik as reverse proxy together with a Postgres db.
but the Bitwarden_rs container is in a reset loop with the following log:
[INFO] No .env file found.

OpenSSL 1.1.1d 10 Sep 2019
genrsa: Can’t open “/mnt/ext/bitwardenrs/data/rsa_key.pem” for writing, No such file or directory
Can’t open /mnt/ext/bitwardenrs/data/rsa_key.pem for reading, No such file or directory
3069739024:error:02001002:system library:fopen:No such file or directory:…/crypto/bio/bss_file.c:69:fopen(’/mnt/ext/bitwardenrs/data/rsa_key.pem’,‘r’)
3069739024:error:2006D080:BIO routines:BIO_new_file:no such file:…/crypto/bio/bss_file.c:76:
unable to load Private Key
Can’t open /mnt/ext/bitwardenrs/data/rsa_key.der for reading, No such file or directory
3070078992:error:02001002:system library:fopen:No such file or directory:…/crypto/bio/bss_file.c:69:fopen(’/mnt/ext/bitwardenrs/data/rsa_key.der’,‘rb’)
3070078992:error:2006D080:BIO routines:BIO_new_file:no such file:…/crypto/bio/bss_file.c:76:
unable to load Private Key

Any idea what could be the issue?

thnx

here my docker-compose.yaml with PORT=8443
services:
bitwarden:
image: bitwardenrs/server:latest
restart: unless-stopped
container_name: bitwardenrs
env_file:
- config.env
user: 1000:1000
environment:
- ROCKET_PORT=80
labels:
- “traefik.enable=true”
- “traefik.http.routers.bitwarden.rule=Host(${DOMAIN_NAME})”
- “traefik.http.routers.bitwarden.entrypoints=websecure”
- “traefik.http.routers.bitwarden.tls=true”
- “traefik.http.routers.bitwarden.tls.certresolver=myresolver”
- “traefik.docker.network=mytraefik”
- "traefik.http.services.bitwarden.loadbalancer.server.port={PORT}" volumes: - {DATA_FOLDER}:/data
ports:
- ${PORT}:80
networks:
- mytraefik
- backend

bitwardendb:
image: postgres:12.6-alpine
restart: unless-stopped
environment:
- POSTGRES_USER={POSTGRES_USER} - POSTGRES_PASSWORD={POSTGRES_PASSWORD}
- POSTGRES_DB={POSTGRES_DB} networks: - backend volumes: - {DATABASE_VOLUME}:/var/lib/postgresql/data
- ${BACKUP_DIR}:/dump
- /etc/localtime:/etc/localtime:ro

networks:
mytraefik:
external:
name: mytraefik
backend:
internal: true

It looks like your {DATA_FOLDER} isn’t writable or doesn’t exists.
I think something is overwriting what you want, or some other misconfigured settings which is causing the volume not to exists or writable at all.

It also looks like the volume key is not places correctly, that could be a copy/paste issue, but not sure.
And, should all the ENV variables started with ${} instead of only {}? Never tried that before actually.

Seems to be an paste-copy issue - the same with ${}.
Anyway in the meantime I found that there is a relation to the DB. With SQLITE the issue doesn’t appear. As soon as I enable the db => it crashes.
As I understand the configuration those files the Bitwarden_rs wants to write are from the rocket crate which I don’t enable as I am behind a proxy.

I found the issue => the volume path was not correct - anyway thx