Caddy won't start

Started by elhippo, January 06, 2025, 10:21:21 PM

Previous topic - Next topic
Hi folks, I am a big fan of opnsense and all of its functionality but on one "machine" I have the problem that Caddy won't start.
All settings are okay, but in the logs the message

"error","ts":"2025-01-06T21:15:37Z","logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: context canceled"}
appears and I don't know how to handle that. Rebooting opnsense and reinstalling did not help. The Firmware version is 24.7.11.

Any suggenstions solving this riddle would be appreciated!

Can you check what the startup log says in /var/log/caddy/caddy.log

Hardware:
DEC740

January 15, 2025, 11:42:28 PM #2 Last Edit: January 15, 2025, 11:52:55 PM by Cerberus
I also have issues on 24.10.1 with caddy no longer starting. /var/log/caddy/caddy.log shows

Error: loading initial config: loading new config: setting up default log: opening log writer using &logging.NetWriter{Address:"unixgram//var/run/caddy/log.sock", DialTimeout:0, SoftStart:false, addr:caddy.NetworkAddress{Network:"unixgram", Host:"/var/run/caddy/log.sock", StartPort:0x0, EndPort:0x0}}: dial unixgram /var/run/caddy/log.sock: connect: no such file or directory
Error: caddy process exited with error: exit status 1

Starting it from console throw the same error:

# caddy run --config /usr/local/etc/caddy/Caddyfile
2025/01/15 22:44:05.709 INFO    using config from file  {"file": "/usr/local/etc/caddy/Caddyfile"}
2025/01/15 22:44:05.709 WARN    No files matching import glob pattern   {"pattern": "/usr/local/etc/caddy/caddy.d/*.global"}
2025/01/15 22:44:05.709 WARN    No files matching import glob pattern   {"pattern": "/usr/local/etc/caddy/caddy.d/*.conf"}
2025/01/15 22:44:05.712 INFO    adapted config to JSON  {"adapter": "caddyfile"}
Error: loading initial config: loading new config: setting up default log: opening log writer using &logging.NetWriter{Address:"unixgram//var/run/caddy/log.sock", DialTimeout:0, SoftStart:false, addr:caddy.NetworkAddress{Network:"unixgram", Host:"/var/run/caddy/log.sock", StartPort:0x0, EndPort:0x0}}: dial unixgram /var/run/caddy/log.sock: connect: no such file or directory

Deleting this the log section from Caddyfile let it start from console, but i prefer to have logs :)

        log {
                output net unixgram//var/run/caddy/log.sock {
                }
                format json {
                        time_format rfc3339
                }
        }

Can you check the directory if the file exists?

la -la /var/run/caddy/log,sock

If its not there, restart syslog to have it recreated. You can also delete it if the file is broken or has wrong permissions.

systemctl syslog restart

If it still does not appear we need to troubleshoot further.
Hardware:
DEC740