I’m trying to use Caddy to serve my site on Digital Ocean. I followed a recent tutorial (see below for link) but when I check the web browser it says site cannot be found.
One issue that came up during the tutorial was with this command: sudo systemctl start caddy When I run it, I get
**Job for caddy.service failed because the control process exited with error code.**
**See "systemctl status caddy.service" and "journalctl -xeu caddy.service" for details.**
When I do sudo caddy start it does say Caddy is running in a background process. but when I
**Job for caddy.service failed because the control process exited with error code.**
**See "systemctl status caddy.service" and "journalctl -xeu caddy.service" for details.**
curl: (35) OpenSSL/3.0.10: error:0A000438:SSL routines::tlsv1 alert internal error
Hi, I followed the instructions at the webpage (thank you). It turns out I didn’t have the /etc/systemd/system/caddy.service file, nor the Caddyfile in the proper location /etc/caddy/Caddyfile . However, now that I follow the proper instructions, I get this error, when I do systemctl status caddy
× caddy.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sat 2024-02-10 12:29:55 UTC; 2min 12s ago
Duration: 4min 3.200s
Docs: Welcome — Caddy Documentation
Process: 25321 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAI>
Main PID: 25321 (code=exited, status=1/FAILURE)
CPU: 72ms
This is my Caddyfile. I’m not sure if it’s relevant
Thank you for the suggestion. I did exactly as you requested, but the problem is the same. I checked the journal logs again and they are empty.
Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xeu caddy.service" for details.
mike@ubuntu-s-1vcpu-1gb-nyc3-01:/$ journalctl -u caddy --no-pager | less +G
mike@ubuntu-s-1vcpu-1gb-nyc3-01:/$ systemctl status caddy.service
× caddy.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sat 2024-02-10 15:12:19 UTC; 34s ago
Duration: 4min 3.200s
Docs: https://caddyserver.com/docs/
Process: 27515 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAI>
Main PID: 27515 (code=exited, status=1/FAILURE)
CPU: 81ms
You seem to be using DigitalOcean. There’s an issue that causes logs to not be found. Read the answer here for explanation and fix for the logs finding issue. Once you resolve the DO issue, you’ll see the log messages we need to know.
I removed /var/lib/dbus/machine-id and etc/machine-id as it said in that serverfault.com answer. I then did systemctl status caddy and got the same failed status. I checked the journal files journalctl -u caddy --no-pager | less +G and it said there were no entries.
If the journal logs are actually not being found rather than empty, where can they be if the location is determined by the machine-id, which I no longer have?
cat /var/lib/dbus/machine-id
cat: /var/lib/dbus/machine-id: No such file or directory
the answer on serverfault.com you referred me to told me to remove the machine-id files, it didn’t tell me to do anything more, so I don’t know where these journal logs are?
alternatively, is it possible the journal log is really just empty?
The only way it would be is if Caddy crashed instantly because of somekind of kernel/architecture type problem, I think. You would see something otherwise.
I dunno, @Mohammed90 knows more about DigitalOcean than I do but I’ve heard a lot of strange behaviour with their VPSes.
Actually I did shutdown the droplet and reboot it and it has created even more problems, and I still don’t have the logs and caddy isn’t working.and I contacted Digital Ocean support about it and they said caddy is third party software.
That’s why I’m looking for a new place to host my blog with caddy. Can you or @francislavoie recommend another vps provider? Francis said he had heard bad things about DO droplets and I believe him so I assume he might know other cow providers where there are no issues hosting caddy.
The trouble I’ve seen with DO is that they heavily customize their stock Linux images, and those customizations often break assumptions that most users make.
I can confirm for anyone running into the same problem that Caddy became considerably easier to use after switching from Digital Ocean. I was never able to find the logs on DO, and after shutting down my droplet, it wouldn’t restart until I went through a lengthy process of running various scripts. Once the droplet was running again, I had to install a new package with apt but once I did that caddy went down again, and, as before, the journal logs were empty. None of this happened on my new VPN provider. This is not in anyway meant to slag Digital Ocean. They have been very good to me in the past and their support team was very helpful. It just seems that the way they set up their VPNs is a bad fit for Caddy.
Hmm… I would love to know step by step what you did after logging into the server for the first time, to see if we can identify why you are having those troubles. If you happen to start over again, feel free to paste your command log/history here.