I’m using a second server as an ACME agent to generate certificates for my Vaultwarden instance. I’m using an automated scp command to send the certificate files to the Vaultwarden server.
I have previously just used the ACME agent on the same box that Vaultwarden is installed which was working just fine. I was trying to simplify my life and have 1 instance of ACME for all my devices.
The ACME server produces 3 .pem files (cert.pem, chain.pem, fullchain.pem). When I copy those 3 files to my Vaultwarden server, it kills the entire Vaultwarden service and I have to restore the entire diet-pi instance from backup. I’ve tried to delete the new files and just put the original .pem files (that were working) back and it doesn’t matter. Once the service is failed, it will never start again unless I reload from backup which makes troubleshooting really difficult.
I’m honestly a little stuck.
I’m not sure why the certificates are making the Vaultwarden service fail endlessly.
I have no earthly idea as to why restoring the original files back to their original locations doesn’t fix the problem and I have to resort to a backup.
I’m looking for any guidance that can be provided.
Creating a bug report/issue
Required Information
DietPi version | 8.18.2
Distro version | bullseye 0
Kernel version | Linux 6.1.21-v8+ aarch64 GNU/Linux
Architecture | arm64
SBC model | RPi3
Power supply used | Generic 5v 2.1a
SD card used | SanDisk
Additional Information (if applicable)
Software title | Vaultwarden
Was the software title installed freshly or updated/migrated? | software hasn’t been changed other than the certificates that I’m working with.
Can this issue be replicated on a fresh installation of DietPi? | haven’t tried that.
Steps to reproduce
Make copies of current certificate files (cert.pem, fullchain.pem, privkey.pem) in /mnt/dietpi_userdata/vaultwarden
Create new certificate files from external ACME server
Copy newly created cert.pem, chain.pem, fullchain.pem files from the external ACME server to the /mnt/dietpi_userdata/vaultwarden directory on the Vaultwarden server.
Reboot Vaultwarden server.
Expected behaviour
Vaultwarden uses the new certificate files that were copied over from the external ACME server
Actual behaviour
Vaultwarden service fails to start
systemctl status vaultwarden.service
● vaultwarden.service - vaultwarden (DietPi)
Loaded: loaded (/lib/systemd/system/vaultwarden.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-06-30 20:07:46 CDT; 5s ago
Docs: GitHub - dani-garcia/vaultwarden: Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
Process: 1581 ExecStart=/opt/vaultwarden/vaultwarden (code=exited, status=1/FAILURE)
Main PID: 1581 (code=exited, status=1/FAILURE)
CPU: 300ms
vaultwarden.service: Scheduled restart job, restart counter is at 5.
Stopped vaultwarden (DietPi).
vaultwarden.service: Start request repeated too quickly.
vaultwarden.service: Failed with result ‘exit-code’.
Failed to start vaultwarden (DietPi).
Extra details
Attempted to send ‘reset-failed vaultwarden.service’ to restore the failed service, but the process will not start and ultimately fails again.
Please fill out the trouble shoot template.
Also, what webserver do you use? The vaultwarden internal one or an external one?
And when you copied the certs and restarting vaultwarden, can you have a look into journalctl -u vaultwarden.service.
Do you know which device 172.16.0.20 is? As well, it might be a good idea to contact Vaultwarden developer in parallel. Maybe he has an idea what the error message is about exactly. For me it seems to be an issue with the certificate.
172.16.0.20 is my workstation.
I can completely understand if there was an issue with the certificate. I would expect to just get a certificate error on the site if the cert I’m using is bad. However what I don’t understand is that changing the cert makes the entire service stop working. On top of that, restoring the certificate that was there before doesn’t fix the issue either. I have to restore a backup to get the system stable again.