[GH-ISSUE #806] docker-compose and [rocket::config::error][ERROR] I/O error while setting tls.certs: #560

Closed
opened 2026-03-03 01:30:33 +03:00 by kerem · 1 comment
Owner

Originally created by @blotsome on GitHub (Jan 7, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/806

Subject of the issue

Converting a docker run container that works to docker-compose yields this [rocket::config::error][ERROR] I/O error while setting tls.certs:

Your environment

  • Bitwarden_rs version: latest
  • Install method: docker-compose
  • Clients used:
  • Reverse proxy and version: self-signed certificate on lan via IP address

Steps to reproduce

Here is the docker code that works:

docker run -d \
	--name='bitwarden' \
	-e 'SIGNUPS_ALLOWED'='true' \
	-e ROCKET_TLS='{certs="/ssl/certificate.crt",key="/ssl/private.key"}' \
	-p 8343:80/tcp \
	-v /data/bw/:/data/:rw \
	-v /ssl/:/ssl/ \
	bitwardenrs/server:latest

and here is the docker-compose.yml that does not work:

version: '3'
services:
  bitwarden:
    image: bitwardenrs/server
    volumes:
      - /data/bw:/data
      - /ssl:/ssl
    ports:
      - 8343:80
    environment:
      SIGNUPS_ALLOWED: 'true'
      ROCKET_TLS: '{certs = "/ssl/bitwarden.crt", key = "/ssl/bitwarden.key"}'
      LOG_FILE: '/data/bitwarden.log'
    restart: unless-stopped

I've tried adding and removing quotes from the rocket_tls file. I've tried changing the permission of those two ssl files. from 600 to 644. Well the .crt is 644, and the key is 600, and i change key to 644 for testing purposes. I also tried creating a new, blank mnt instead of reusing the mnt point that worked in the docker run command.

Expected behaviour

Create a healthy, running docker the same as the docker run command.

Actual behaviour

Keeps restarting over and over, and showing the errors below.

Relevant logs

I see

bitwarden_1  | [2020-01-07 03:21:10][rocket::config::error][ERROR] I/O error while setting tls.certs:
bitwarden_1  | Logger failed to initialize: attempted to set a logger after the logging system was already initialized

and once it restarts, it just says docker_bitwarden_1 exited with code 1

Originally created by @blotsome on GitHub (Jan 7, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/806 <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unneccessary for your issue, feel free to remove them. Remember to hide/obfuscate personal and confidential information, such as names, global IP/DNS adresses and especially passwords, if neccessary. --> ### Subject of the issue Converting a docker run container that works to docker-compose yields this [rocket::config::error][ERROR] I/O error while setting tls.certs: ### Your environment <!-- The version number, obtained from the logs or the admin page --> * Bitwarden_rs version: latest <!-- How the server was installed: Docker image / package / built from source --> * Install method: docker-compose * Clients used: <!-- if applicable --> * Reverse proxy and version: <!-- if applicable --> self-signed certificate on lan via IP address ### Steps to reproduce Here is the docker code that works: ``` docker run -d \ --name='bitwarden' \ -e 'SIGNUPS_ALLOWED'='true' \ -e ROCKET_TLS='{certs="/ssl/certificate.crt",key="/ssl/private.key"}' \ -p 8343:80/tcp \ -v /data/bw/:/data/:rw \ -v /ssl/:/ssl/ \ bitwardenrs/server:latest ``` and here is the docker-compose.yml that does not work: ``` version: '3' services: bitwarden: image: bitwardenrs/server volumes: - /data/bw:/data - /ssl:/ssl ports: - 8343:80 environment: SIGNUPS_ALLOWED: 'true' ROCKET_TLS: '{certs = "/ssl/bitwarden.crt", key = "/ssl/bitwarden.key"}' LOG_FILE: '/data/bitwarden.log' restart: unless-stopped ``` I've tried adding and removing quotes from the rocket_tls file. I've tried changing the permission of those two ssl files. from 600 to 644. Well the .crt is 644, and the key is 600, and i change key to 644 for testing purposes. I also tried creating a new, blank mnt instead of reusing the mnt point that worked in the docker run command. ### Expected behaviour <!-- Tell us what should happen --> Create a healthy, running docker the same as the docker run command. ### Actual behaviour <!-- Tell us what happens instead --> Keeps restarting over and over, and showing the errors below. ### Relevant logs <!-- Share some logfiles, screenshots or output of relevant programs with us. --> I see ``` bitwarden_1 | [2020-01-07 03:21:10][rocket::config::error][ERROR] I/O error while setting tls.certs: bitwarden_1 | Logger failed to initialize: attempted to set a logger after the logging system was already initialized ``` and once it restarts, it just says `docker_bitwarden_1 exited with code 1`
kerem closed this issue 2026-03-03 01:30:33 +03:00
Author
Owner

@blotsome commented on GitHub (Jan 9, 2020):

Really embarrassed over this one. *.crt and *.key file names are different. D'oh.

<!-- gh-comment-id:572673365 --> @blotsome commented on GitHub (Jan 9, 2020): Really embarrassed over this one. *.crt and *.key file names are different. D'oh.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#560
No description provided.