Botwarden and docker : mass reboots

Hi.

i hope you guys could help me, i really need help.
i got a raspberry pi 3 and i’m running docker on it. All my containers are working fine except bitwarden.
i tried to install bitwarden on docker from the official source here : https://bitwarden.com/help/article/install-on-premise/

i did all it asked and i also create a docker-compose.override file to add modifications to my containers.
When i start the containers i don’t have any problems and everything seems to be ok but all my containers are rebooting every time without any error message.

here is the override file :

`version: '3'`

services:
  mssql:
    image:  hypriot/rpi-mysql
    restart: unless-stopped
    volumes:
      - 'mssql-data:/var/opt/mssql/data'
      - 'mssql-logs:/var/opt/mssql/log'
      - 'mssql-backups:/etc/bitwarden/mssql/backups'
  web:
    restart: unless-stopped  
    volumes:
      - 'web:/etc/bitwarden/web'
  attachments:
    restart: unless-stopped
    volumes:
      - 'attachments:/etc/bitwarden/core/attachments'
  api:
    restart: unless-stopped
    volumes:
      - 'api-core:/etc/bitwarden/core'
      - 'api-ca-certificates:/etc/bitwarden/ca-certificates'
      - 'api-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  
  identity:
    restart: unless-stopped
    volumes:
      - 'identity:/etc/bitwarden/identity'
      - 'identity-core:/etc/bitwarden/core'
      - 'identity-ca-certificates:/etc/bitwarden/ca-certificates'
      - 'identity-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  
  admin:
    restart: unless-stopped
    volumes:
      - 'admin-core:/etc/bitwarden/core'
      - 'admin-ca-certificates:/etc/bitwarden/ca-certificates'
      - 'admin-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public      
  icons:
    restart: unless-stopped
    volumes:
      - 'icons-ca-certificates:/etc/bitwarden/ca-certificates'
      - 'icons-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public      
  notifications:
    restart: unless-stopped
    volumes:
      - 'notifications-ca-certificates:/etc/bitwarden/ca-certificates'
      - 'notifications-logs:/etc/bitwarden/logs'
  events:
    restart: unless-stopped
    volumes:
      - 'events-ca-certificates:/etc/bitwarden/ca-certificates'
      - 'events-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public
  nginx:
    ports:
      - '8000:8080'
      - '443:8443'
    restart: unless-stopped
    volumes:
      - 'nginx:/etc/bitwarden/nginx'
      - 'nginx-letsencrypt:/etc/letsencrypt'
      - 'nginx-ssl:/etc/ssl'
      - 'nginx-logs:/var/log/nginx'
    networks:
      - bitwarden-default
      - bitwarden-public      
volumes:
 mssql-data:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/mssql/data"
 mssql-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/mssql/logs"
 mssql-backups:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/mssql/backups"
 web:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/web"   
 attachments:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/attachments"
 api-core:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/api/core"
 api-ca-certificates:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/api/ca-certificates"   
 api-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/api/logs" 
 identity:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/identity/identity" 
 identity-core:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/identity/core" 
 identity-ca-certificates:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/identity/ca-certificates" 
 identity-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/identity/logs"    
 admin-core:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/admin/core"    
 admin-ca-certificates:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/admin/ca-certificates"    
 admin-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/admin/logs"    
 icons-ca-certificates:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/icons/ca-certificates"       
 icons-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/icons/logs" 
 notifications-ca-certificates:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/notifications/ca-certificates"    
 notifications-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/notifications/logs"  
 events-ca-certificates:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/events/ca-certificates"  
 events-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/events/logs"  
 nginx:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/nginx/nginx"
 nginx-letsencrypt:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/nginx/letsencrypt"
 nginx-ssl:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/nginx/ssl"
 nginx-logs:
  driver: local
  driver_opts:
   type: nfs
   o: addr=192.168.1.31,rw,nolock
   device: ":/volume1/Docker-Volumes/bitwarden/nginx/logs"   
networks:
 bitwarden-default:
  driver: bridge
  ipam:
   config:
    - subnet: 172.23.4.0/24
 bitwarden-public:
  driver: bridge
  ipam:
   config:
    - subnet: 172.23.5.0/24

Do you have any idea why i got reboots ?

Thx

Hello @DockerMan,

From the information given, I can’t really address the exact problem but we can eliminate some pretty quickly.

Eliminate resource requirements and arm architecture:
Try your configuration in a virtual machine with docker & docker-compose installed.
If you use Vagrant, you can use this link https://app.vagrantup.com/lala/boxes/docker-compose

Hi @Pulsar and thx for your quick reply.
Can you tell me witch informations you need ?

here is my setup :

i got 2 NAS and 1 Raspberry pi 3.
my others containers are using volumes fo share files with a NAS so i can make some backup and restore everything quickly if i delete my containers.
i dod the same here with the override file. all the volumes are from a nas.
It seems the problem isnt here sine i can see some files in the nas folder.

all i did was following the steps on the official bitwarden link i wrote in my last comment. Then i created the ovveride file i also worte here.

i don’t think this is a problem from requirements and arm architecture but you’re right. i will make a vm and try to run everything on it then i will let you know.

Thx

I tried to replicate your environment you’ve given.
As far as I understand, the problem seems to be limited to volume paths. Shared volumes between containers may not be shared (see below), data inside volumes might be missing, or permissions might be wrong (improbable in this case).

Example: volumes ending with ca-certificates should be the same volume and in my test case, they need the files inside bwdata/ca-certificates.

I suggest you use a mind mapping tool and place the services on each branch with volumes as subbranches. Then eliminate/ or merge common branches. That way you will find which volumes are shared between services and need the exact same files.

PS:

You can look at docker-compose logs with:

cd <installation_path>/bwdata/docker
docker-compose logs -f

or use also grep to filter logs by specific container, example : docker-compose logs -f | grep "api"

Hello @DockerMan,
this is my modified working docker-compose override file. Modify named volumes to suit your needs but don’t add or remove them (at least for the first test). Uncomment mssql image when using on rpi.

version: '3'
services:

  mssql:
    # image:  hypriot/rpi-mysql
    restart: unless-stopped
    volumes:
      - 'mssql-data:/var/opt/mssql/data'
      - 'mssql-backups:/etc/bitwarden/mssql/backups'
      - 'mssql-logs:/var/opt/mssql/log'

  web:
    restart: unless-stopped  
    volumes:
      - 'web:/etc/bitwarden/web'

  attachments:
    restart: unless-stopped
    volumes:
      # - 'attachments:/etc/bitwarden/core/attachments'
      - 'core:/etc/bitwarden/core'

  api:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'api-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  

  identity:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'identity:/etc/bitwarden/identity'
      - 'identity-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public

  admin:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'admin-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  

  icons:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'icons-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  
          
  notifications:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'notifications-logs:/etc/logs/bitwarden'
  events:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'events-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public
  nginx:
    ports:
      - '8000:8080'
      - '443:8443'
    restart: unless-stopped
    volumes:
      - 'nginx-letsencrypt:/etc/certs'
      - 'nginx-logs:/var/log/nginx'
    networks:
      - bitwarden-default
      - bitwarden-public
volumes:      
  mssql-data:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/mssql/data"
  mssql-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/mssql"
  mssql-backups:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/mssql/backups"
  web:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/web"   
  core:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/core"
  ca-certificates:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/ca-certificates"   
  api-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/api" 
  identity:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/identity" 
  identity-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/identity"       
  admin-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/admin"         
  icons-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/icons"    
  notifications-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/notifications"  
  events-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/events"  
  nginx-letsencrypt:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/letsencrypt"
  nginx-logs:
    driver_opts:
      type: none
      o: bind
      device: "/home/user/Git-Repos/BITWARDEN/install-test/bwdata/logs/nginx"   
networks:
  bitwarden-default:
    driver: bridge
    ipam:
      config:
        - subnet: 172.23.4.0/24
  bitwarden-public:
    driver: bridge
    ipam:
      config:
        - subnet: 172.23.5.0/24

hi @Pulsar !
Thx again for your help and for the time you share with me.
It seems you’re right i may have some problems with my volumes.

I will add the changes you wrote and make soem test but i what is the “bind” option in the driver please ?
Will it store all my configuration files to the NAS or in the docker host ?
i’d like to store everything in the NAS.
Thx

i did some changes and now my containerswon’t start
here is the new docker file :

version: '3'

services:
  mssql:
    image:  hypriot/rpi-mysql
    restart: unless-stopped
    volumes:
      - 'mssql-data:/var/opt/mssql/data'
      - 'mssql-logs:/var/opt/mssql/log'
      - 'mssql-backups:/etc/bitwarden/mssql/backups'
  web:
    restart: unless-stopped  
    volumes:
      - 'web:/etc/bitwarden/web'
  attachments:
    restart: unless-stopped
    volumes:
      - 'core:/etc/bitwarden/core'
  api:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'api-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  
  identity:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'identity:/etc/bitwarden/identity'
      - 'identity-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  
  admin:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'admin-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public      
  icons:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'icons-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public      
  notifications:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'notifications-logs:/etc/logs/bitwarden'
  events:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'events-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public
  nginx:
    ports:
      - '8000:8080'
      - '443:8443'
    restart: unless-stopped
    volumes:
      - 'nginx-letsencrypt:/etc/certs'
      - 'nginx-logs:/var/log/nginx'
    networks:
      - bitwarden-default
      - bitwarden-public      
volumes:
  mssql-data:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/opt/mssql/data"
  mssql-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/opt/mssql/log"
  mssql-backups:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/mssql/backups"
  web:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/web"
  core:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/core"
  ca-certificates:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates"
  api-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/logs"
  identity:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/identity"
  identity-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/logs"
  admin-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/logs"
  icons-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/logs"
  notifications-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/logs/bitwarden"
  events-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/logs"
  nginx-letsencrypt:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/certs"
  nginx-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/nginx"
networks:
 bitwarden-default:
  driver: bridge
  ipam:
   config:
    - subnet: 172.23.4.0/24
 bitwarden-public:
  driver: bridge
  ipam:
   config:
    - subnet: 172.23.5.0/24

i got those errors and logs :

RROR: for bitwarden-mssql  Cannot start service mssql: error while mounting volume '/var/lib/docker/volumes/docker_mssql-backups/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/mssql/backups:/Creating bitwarden-notifications ... error
Creating bitwarden-attachments   ... error
Creating bitwarden-identity      ... error
ocker_web/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for bitwarden-attachments  Cannot start service attachments: error while mounting volume '/var/lib/docker/volumes/docker_core/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/core:/var/lib/docker/volumes/docker_core/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for bitwarden-notifications  Cannot start service notifications: error while mounting volume '/var/lib/docker/volumes/docker_ca-certificates/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates:/var/lib/docker/volumes/docker_ca-certificates/_data, data: addr=192.168.1.31,nolock: invalid argument

Creating bitwarden-icons         ... error
lib/docker/volumes/docker_identity/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for bitwarden-events  Cannot start service events: error while mounting volume '/var/lib/docker/volumes/docker_ca-certificates/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificCreating bitwarden-api           ... error

ERROR: for bitwarden-icons  Cannot start service icons: error while mounting volume '/var/lib/docker/volumes/docker_ca-certificates/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates:/var/lib/docker/volumes/docker_ca-certificates/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for bitwarden-api  Cannot start service api: error while mounting volume '/var/lib/docker/volumes/docker_core/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/core:/var/lib/docker/volumes/docker_core/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for mssql  Cannot start service mssql: error while mounting volume '/var/lib/docker/volumes/docker_mssql-backups/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/mssql/backups:/var/lib/docker/volumes/docker_mssql-backups/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for web  Cannot start service web: error while mounting volume '/var/lib/docker/volumes/docker_web/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/web:/var/lib/docker/volumes/docker_web/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for attachments  Cannot start service attachments: error while mounting volume '/var/lib/docker/volumes/docker_core/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/core:/var/lib/docker/volumes/docker_core/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for notifications  Cannot start service notifications: error while mounting volume '/var/lib/docker/volumes/docker_ca-certificates/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates:/var/lib/docker/volumes/docker_ca-certificates/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for identity  Cannot start service identity: error while mounting volume '/var/lib/docker/volumes/docker_identity/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/identity:/var/lib/docker/volumes/docker_identity/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for events  Cannot start service events: error while mounting volume '/var/lib/docker/volumes/docker_ca-certificates/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates:/var/lib/docker/volumes/docker_ca-certificates/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for icons  Cannot start service icons: error while mounting volume '/var/lib/docker/volumes/docker_ca-certificates/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates:/var/lib/docker/volumes/docker_ca-certificates/_data, data: addr=192.168.1.31,nolock: invalid argument

ERROR: for api  Cannot start service api: error while mounting volume '/var/lib/docker/volumes/docker_core/_data': failed to mount local volume: mount /volume1/Docker-Volumes/bitwarden/etc/bitwarden/core:/var/lib/docker/volumes/docker_core/_data, data: addr=192.168.1.31,nolock: invalid argument
ERROR: Encountered errors while bringing up the project.



[email protected]:~/bitwarden/bwdata/docker# docker-compose logs -f
Attaching to bitwarden-web, bitwarden-api, bitwarden-events, bitwarden-attachments, bitwarden-icons, bitwarden-mssql, bitwarden-notifications, bitwarden-identity
bitwarden-api exited with code 128
bitwarden-events exited with code 128
bitwarden-attachments exited with code 128
bitwarden-identity exited with code 128
bitwarden-icons exited with code 128
bitwarden-mssql exited with code 128
bitwarden-notifications exited with code 128
bitwarden-web exited with code 128

Most likely problems:

  1. You need to delete existing named volumes (as they will be configured again).
    You can check existing volumes with docker volume ls
    You can delete existing volume with docker volume rm <volume-name>

  2. The path mentioned, does not exist
    Try to open the path, example: cd /volume1/Docker-Volumes/bitwarden/etc/bitwarden/mssql/backups.
    If so, then create them by the following command mkdir -p <directory-path>, example:
    mkdir -p /volume1/Docker-Volumes/bitwarden/etc/bitwarden/mssql/backups

  3. Permissions (unlikely)

this is strange because i checked and all path i use exist.
i also always user docker-compose down -v when i stop my containers so i got no more volumes, containers and network.

Just for testing purposes, I suggest you start with local volumes on your system (rpi). If that works, then switch the volumes one by one. If on any switch you see an error, solve it, then continue.

I’ve modified a little bit your compose file. What I’ve found is that some volume paths were the same (they should not). The previous configuration, works fine on my PC, but I can’t test the one below.

version: '3'
services:

  mssql:
    image:  hypriot/rpi-mysql
    restart: unless-stopped
    volumes:
      - 'mssql-data:/var/opt/mssql/data'
      - 'mssql-logs:/var/opt/mssql/log'
      - 'mssql-backups:/etc/bitwarden/mssql/backups'
  web:
    restart: unless-stopped  
    volumes:
      - 'web:/etc/bitwarden/web'

  attachments:
    restart: unless-stopped
    volumes:
      - 'core:/etc/bitwarden/core'

  api:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'api-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public 

  identity:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'identity:/etc/bitwarden/identity'
      - 'identity-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public  
      
  admin:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'core:/etc/bitwarden/core'
      - 'admin-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public      
  icons:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'icons-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public      
  notifications:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'notifications-logs:/etc/logs/bitwarden'
  events:
    restart: unless-stopped
    volumes:
      - 'ca-certificates:/etc/bitwarden/ca-certificates'
      - 'events-logs:/etc/bitwarden/logs'
    networks:
      - bitwarden-default
      - bitwarden-public
  nginx:
    ports:
      - '8000:8080'
      - '443:8443'
    restart: unless-stopped
    volumes:
      - 'nginx-letsencrypt:/etc/certs'
      - 'nginx-logs:/var/log/nginx'
    networks:
      - bitwarden-default
      - bitwarden-public      
volumes:
  mssql-data:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/opt/mssql/data"
  mssql-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/opt/mssql/log"
  mssql-backups:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/mssql/backups"
  web:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/web"
  core:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/core"
  ca-certificates:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/ca-certificates"
  api-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/api"
  identity:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/bitwarden/identity"
  identity-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/identity"
  admin-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/admin"
  icons-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/icons"
  notifications-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/notifications"
  events-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/events"
  nginx-letsencrypt:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/etc/certs"
  nginx-logs:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.31,rw,nolock
      device: "/volume1/Docker-Volumes/bitwarden/var/log/nginx"
networks:
 bitwarden-default:
  driver: bridge
  ipam:
   config:
    - subnet: 172.23.4.0/24
 bitwarden-public:
  driver: bridge
  ipam:
   config:
    - subnet: 172.23.5.0/24

Did it work on a Virtual Machine?

Hi.
I’ve try with a VM running debian buster and i got the same problems :

  • With my original files (from the 1st post) i still can start containers but i still have reboots.
  • with the modifications from @Pulsar i still got problem with volumes folder. this is strange because i did double check and every path are good.

so 'ive dicided to check my 1st configuration fomr the originaly post. it seems i did some misstakes when i configured everything like said in the bitwarden configuration page : https://bitwarden.com/help/article/install-on-premise/#manual-docker-installations
i did some modification and now i got only one container witch still reboot and it’s the nginx one.
i checked the logs and i got those errors :

bitwarden-nginx  | nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
bitwarden-nginx  | 2020/06/01 15:16:26 [emerg] 1#1: cannot load certificate "/etc/ssl/bitwarden.local/certificate.crt": BIO_new_file() failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/ssl/bitwarden.local/certificate.crt','r') error:2006D002:BIO routines:BIO_new_file:system lib)

so i tried to change chmod and i added 777 and see what happen. it didnt work so i also add acl with setfacl to add “www-data” and “docker” groups.
without success. i still got the same reboots and error message.

2020-06-01_17h19_19

i guess my configuration is good but i got some probem with the perms.

After many attemps i find a strange solution.
IF i remove the “ssl” and “logs” volumes from nginx container every thing’s ok. i dont have any reboot or permission error.

Now i face a new problem.
When the containers are up, i cannot create a new account

i wonder what’s going on.

i also found that the admin containder is unhealthy and i got thise log :

bitwarden-admin  | fail: Bit.Admin.HostedServices.DatabaseMigrationHostedService[0]
bitwarden-admin  |       Database unavailable for migration. Trying again (attempt #3)...
bitwarden-admin  | System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)
bitwarden-admin  |    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
bitwarden-admin  |    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
bitwarden-admin  |    at System.Data.SqlClient.SqlConnection.Open()
bitwarden-admin  |    at Bit.Migrator.DbMigrator.MigrateMsSqlDatabase(Boolean enableLogging, CancellationToken cancellationToken) in /home/appveyor/projects/server/util/Migrator/DbMigrator.cs:line 41
bitwarden-admin  |    at Bit.Admin.HostedServices.DatabaseMigrationHostedService.StartAsync(CancellationToken cancellationToken) in /home/appveyor/projects/server/src/Admin/HostedServices/DatabaseMigrationHostedService.cs:line 40
bitwarden-admin  | ClientConnectionId:00000000-0000-0000-0000-000000000000
bitwarden-admin  | info: Bit.Migrator.DbMigrator[12482444]
bitwarden-admin  |       Migrating database.

all others are ok

[email protected]:~/bwdata/docker# docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS                     PORTS                                                                         NAMES
143686b810c9        bitwarden/nginx:latest           "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)     80/tcp, 0.0.0.0:80->8080/tcp, 0.0.0.0:8000->8080/tcp, 0.0.0.0:443->8443/tcp   bitwarden-nginx
7090d25d094d        bitwarden/admin:latest           "/entrypoint.sh"         15 minutes ago      Up 2 minutes (unhealthy)   5000/tcp                                                                      bitwarden-admin
a0c4fd695843        bitwarden/web:latest             "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)                                                                                   bitwarden-web
1a01fd20e0ef        bitwarden/events:latest          "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)     5000/tcp                                                                      bitwarden-events
8e40efddc129        bitwarden/notifications:latest   "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)     5000/tcp                                                                      bitwarden-notifications
59c3aa3c8950        mysql                            "docker-entrypoint.s…"   15 minutes ago      Up 2 minutes                                                                                             bitwarden-mssql
035ec613132f        bitwarden/api:latest             "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)     5000/tcp                                                                      bitwarden-api
fbbead9902f4        bitwarden/icons:latest           "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)     5000/tcp                                                                      bitwarden-icons
9013330870de        bitwarden/identity:latest        "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)     5000/tcp                                                                      bitwarden-identity
1c0b95d6506e        bitwarden/attachments:latest     "/entrypoint.sh"         15 minutes ago      Up 2 minutes (healthy)                                                                                   bitwarden-attachments

Hello @DockerMan,
sorry for late Reply, I was busy during this time.
I’m happy that you have gotten further. From the errors you got, I suspect two things:

  1. Database password is incorrect
  2. Timeout error (cause by running into hardware limits, example not enough ram for mssql)

Hi @Pulsar don’t worry i know what it is :slight_smile:
btw THX a lot for helping me.

to be clear, the ram the container is using is the ram from my VM right ?
this isnt the ram from the NAS ? my vm is on my computer and got 4Go but my nas where i store volumes only got 1Go.

i suppose it should be a password problem because the ram used by mysql isnt so much

2020-06-03_18h02_59

i need to check the passwords in the config files and i will try to check all the containers logs to see if i don’t have other errors.

Yes, the container uses the RAM from your VM is running in.
Check on globalSettings__sqlServer__connectionString under global.override.env file. There should be the mssql password under ...; Password=...; ...

the password is ok.
i saw all the containers where healthy expect “bitwarden-admin”

i checked the log and i saw this :

bitwarden-admin  | fail: Bit.Admin.HostedServices.DatabaseMigrationHostedService[0]
bitwarden-admin  |       Database unavailable for migration. Trying again (attempt #4)...
bitwarden-admin  | System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)
bitwarden-admin  |    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
bitwarden-admin  |    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
bitwarden-admin  |    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
bitwarden-admin  |    at System.Data.SqlClient.SqlConnection.Open()
bitwarden-admin  |    at Bit.Migrator.DbMigrator.MigrateMsSqlDatabase(Boolean enableLogging, CancellationToken cancellationToken) in /home/appveyor/projects/server/util/Migrator/DbMigrator.cs:line 41
bitwarden-admin  |    at Bit.Admin.HostedServices.DatabaseMigrationHostedService.StartAsync(CancellationToken cancellationToken) in /home/appveyor/projects/server/src/Admin/HostedServices/DatabaseMigrationHostedService.cs:line 40
bitwarden-admin  | ClientConnectionId:00000000-0000-0000-0000-000000000000
bitwarden-admin  | info: Bit.Migrator.DbMigrator[12482444]
bitwarden-admin  |       Migrating database.

i also got other fails in the logs. it seems my containers cannot contact the database.

if i dont use volumes on my NAS and make a local test everything is working but all the volumes are in the same folder with the same nfs rights.

hi @Pulsar !
i did it it’s working right now !

i added a few changes :

  • when i tried with my debian VM i didnt use the good mssql image si i changed it to the official bitwarden mssql
  • i removed the ssl and log volumes from nginx container. this is still a mistery when i add volumes for this container it reboots
  • i added true to the mapping information in the config.yml file
  • i added some squash to the nfs folder on my NAS

i’m pretty happy to be able to run my own bitwarden server with volumes as i wanted :smiley:

i REALLY want to thank you for your help and for your time ! you’re the best :wink:
once again THX !!

I’m glad I could help @DockerMan.

1 Like