Hi, I’m trying to install Vaultwarden on my server, but after creation of service, when I start it, it couldn’t access to the data folder.
Environement :
User and Group : bitwarden
Installation folder : /opt/vaultwarden
Data folder : /home/bitwarden/vaultdata
The installation and data folder are set to bitwarden user and group, with drwxr-xr-x mode …
But when I start the service, the service return the status failed, with this error :
Aug 06 11:59:23 smtp.magicseeserver vaultwarden[9351]: [INFO] No .env file found.
Aug 06 11:59:23 smtp.magicseeserver vaultwarden[9351]: [2022-08-06 11:59:23.192][vaultwarden][ERROR] Data folder '/home/bitwarden/v>
Aug 06 11:59:23 smtp.magicseeserver vaultwarden[9351]: [2022-08-06 11:59:23.192][vaultwarden][ERROR] Create the data folder and try>
Aug 06 11:59:23 smtp.magicseeserver systemd[1]: vaultwarden.service: Main process exited, code=exited, status=1/FAILURE
Aug 06 11:59:23 smtp.magicseeserver systemd[1]: vaultwarden.service: Failed with result 'exit-code'.
Service has this 3 options set :
User=bitwarden
Group=bitwarden
EnvironmentFile=/etc/vaultwarden.env
It can start with a service file.
Just point either run the Vaultwarden binary from the location where the .env file is located, or place the .env file at the same location as the binary, and run it from there.
Hum, it seems to be definitively a service problem … If I start the execution file, it’s ok, it start and create all files in data folder … But If I start service, it says :
[ERROR] Data folder ‘/home/bitwarden/vaultdata’ doesn’t exist.
The .env file INFO message is because Vaultwarden it self couldn’t find that file it self.
If you load that file via systemd or any other option it’s normal that Vaultwarden doesn’t see that file it self. And it doesn’t need to.
Vaultwarden needs the environment populated with all the config options. Systemd does this for you. Or Vaultwarden tries to read a .env file when available.
So tldr, when using systemd, you will get that message. And it is no issue.