Stopped background certificate maintenance

1. Caddy version: v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I installed, and run Caddy:

I install & run caddy from official doc. Everything was good. I was serve my domain with Caddy. but when I run “npm run build” in a nuxt js project then Caddy stop.

a. System environment:

Ubuntu

b. Command:

“npm run build” in a nuxt js project

npm run build

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddy config:

some.uihut.com {
  reverse_proxy localhost:3000
}

3. The problem I’m having:

Server Stop working.

4. Error messages and/or full log output:

 Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.0468912,"logger":"http.acme_client","msg":"validations succeeded; finalizing order","order":"https://acme-v02.api.letsencrypt.org/acme/order/952014366/163268940>
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.7899773,"logger":"http.acme_client","msg":"successfully downloaded available certificate chains","count":2,"first_url":"https://acme-v02.api.letsencrypt.org/acm>
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.7907612,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"utm.besnik.net"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.790849,"logger":"tls.obtain","msg":"releasing lock","identifier":"utm.besnik.net"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5809731,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/stop","remote_ip":"127.0.0.1","remote_port":"39336","heade>
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"warn","ts":1675706342.5811977,"logger":"admin.api","msg":"exiting; byeee!! 👋"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5815964,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc0001e1730"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.581959,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5819852,"logger":"admin.api","msg":"shutdown complete","exit_code":0}
Feb 06 17:59:02 staging-server systemd[1]: caddy.service: Deactivated successfully.

5. What I already tried:

I stop, start, and reload server but not work.

6. Links to relevant resources:

Github Issue Link: Suddenly Caddy stop: "stopped background certificate maintenance" · Issue #5386 · caddyserver/caddy · GitHub

Looks like something signaled the server to shut down. I don’t see anything technically wrong here – just check to make sure you or something on the computer aren’t doing something to stop the service, etc.

Those logs are from February 6th. Are you sure they’re the right ones?

Please read this page in the docs, which explains how to correctly read your logs:

1 Like

Hello @francislavoie . Thank you for reply.

Yeah right. I do not know why date show 6th February.
Maybe I was created my caddy server on 6th February.
I was serve multiple domain/subdomain . Everything was good but yesterday( 21th February) stop my server when I was going to deploy new update.

Hello @matt ,
Thank you for your reply.
Please help me to start my server again. I have tried to start caddy server again but I failed.

What’s the output when you start caddy. systemctl start caddy? Using journalctl -u caddy --no-pager | tail -n 100 to extract the last 100 logs so we can help you debug.

2 Likes

Yes sure. Here is the log:

Feb 06 17:24:44 staging-server systemd[1]: Starting Caddy...
Feb 06 17:24:44 staging-server caddy[58600]: caddy.HomeDir=/var/lib/caddy
Feb 06 17:24:44 staging-server caddy[58600]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Feb 06 17:24:44 staging-server caddy[58600]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Feb 06 17:24:44 staging-server caddy[58600]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Feb 06 17:24:44 staging-server caddy[58600]: caddy.Version=v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=
Feb 06 17:24:44 staging-server caddy[58600]: runtime.GOOS=linux
Feb 06 17:24:44 staging-server caddy[58600]: runtime.GOARCH=amd64
Feb 06 17:24:44 staging-server caddy[58600]: runtime.Compiler=gc
Feb 06 17:24:44 staging-server caddy[58600]: runtime.NumCPU=2
Feb 06 17:24:44 staging-server caddy[58600]: runtime.GOMAXPROCS=2
Feb 06 17:24:44 staging-server caddy[58600]: runtime.Version=go1.19.2
Feb 06 17:24:44 staging-server caddy[58600]: os.Getwd=/
Feb 06 17:24:44 staging-server caddy[58600]: LANG=en_US.UTF-8
Feb 06 17:24:44 staging-server caddy[58600]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Feb 06 17:24:44 staging-server caddy[58600]: NOTIFY_SOCKET=/run/systemd/notify
Feb 06 17:24:44 staging-server caddy[58600]: HOME=/var/lib/caddy
Feb 06 17:24:44 staging-server caddy[58600]: LOGNAME=caddy
Feb 06 17:24:44 staging-server caddy[58600]: USER=caddy
Feb 06 17:24:44 staging-server caddy[58600]: INVOCATION_ID=9bd8ecb009cd484d9cc6bda5893f20be
Feb 06 17:24:44 staging-server caddy[58600]: JOURNAL_STREAM=8:104766
Feb 06 17:24:44 staging-server caddy[58600]: SYSTEMD_EXEC_PID=58600
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.9126728,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.919793,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"warn","ts":1675704284.9203715,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.9210298,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.921481,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Feb 06 17:24:44 staging-server systemd[1]: Started Caddy.
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.9223676,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0003573b0"}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.92294,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.9234228,"logger":"tls","msg":"finished cleaning storage units"}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.927475,"msg":"serving initial configuration"}
Feb 06 17:25:09 staging-server systemd[1]: Reloading Caddy...
Feb 06 17:25:09 staging-server caddy[58731]: {"level":"info","ts":1675704309.8779461,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8813076,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"39760","headers":{"Accept-Encoding":["gzip"],"Cache-Control":["must-revalidate"],"Content-Length":["184"],"Content-Type":["application/json"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8832307,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"warn","ts":1675704309.8836088,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8840344,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00037f260"}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8844795,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.884837,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc0003573b0"}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8852694,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8854008,"logger":"admin.api","msg":"load complete"}
Feb 06 17:25:09 staging-server caddy[58600]: {"level":"info","ts":1675704309.8909974,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Feb 06 17:25:09 staging-server systemd[1]: Reloaded Caddy.
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6878228,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"39330","headers":{"Accept-Encoding":["gzip"],"Content-Length":["1612"],"Content-Type":["application/json"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6902158,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"warn","ts":1675706334.6924038,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv1","http_port":80}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.692611,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6927636,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6955428,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6960404,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6959133,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0001e1730"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6965697,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6967964,"logger":"http.log","msg":"server running","name":"srv1","protocols":["h1","h2","h3"]}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.696963,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["utm.besnik.net"]}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6976812,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc00037f260"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.698561,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6990087,"logger":"admin.api","msg":"load complete"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.6998444,"logger":"tls.obtain","msg":"acquiring lock","identifier":"utm.besnik.net"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.7019029,"logger":"tls.obtain","msg":"lock acquired","identifier":"utm.besnik.net"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.7023196,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"utm.besnik.net"}
Feb 06 17:58:54 staging-server caddy[58600]: {"level":"info","ts":1675706334.7035363,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Feb 06 17:58:55 staging-server caddy[58600]: {"level":"info","ts":1675706335.7255528,"logger":"http","msg":"waiting on internal rate limiter","identifiers":["utm.besnik.net"],"ca":"https://acme-v02.api.letsencrypt.org/directory","account":""}
Feb 06 17:58:55 staging-server caddy[58600]: {"level":"info","ts":1675706335.725629,"logger":"http","msg":"done waiting on internal rate limiter","identifiers":["utm.besnik.net"],"ca":"https://acme-v02.api.letsencrypt.org/directory","account":""}
Feb 06 17:58:56 staging-server caddy[58600]: {"level":"info","ts":1675706336.0897298,"logger":"http.acme_client","msg":"trying to solve challenge","identifier":"utm.besnik.net","challenge_type":"http-01","ca":"https://acme-v02.api.letsencrypt.org/directory"}
Feb 06 17:58:56 staging-server caddy[58600]: {"level":"info","ts":1675706336.3996553,"logger":"http","msg":"served key authentication","identifier":"utm.besnik.net","challenge":"http-01","remote":"18.118.151.45:27982","distributed":false}
Feb 06 17:58:56 staging-server caddy[58600]: {"level":"info","ts":1675706336.5061448,"logger":"http","msg":"served key authentication","identifier":"utm.besnik.net","challenge":"http-01","remote":"18.236.105.143:61204","distributed":false}
Feb 06 17:58:56 staging-server caddy[58600]: {"level":"info","ts":1675706336.5743754,"logger":"http","msg":"served key authentication","identifier":"utm.besnik.net","challenge":"http-01","remote":"23.178.112.102:29874","distributed":false}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.0468037,"logger":"http.acme_client","msg":"authorization finalized","identifier":"utm.besnik.net","authz_status":"valid"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.0468912,"logger":"http.acme_client","msg":"validations succeeded; finalizing order","order":"https://acme-v02.api.letsencrypt.org/acme/order/952014366/163268940196"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.7899773,"logger":"http.acme_client","msg":"successfully downloaded available certificate chains","count":2,"first_url":"https://acme-v02.api.letsencrypt.org/acme/cert/03d8a8447abc08156571bbb1adeb13bcf52b"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.7907612,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"utm.besnik.net"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.790849,"logger":"tls.obtain","msg":"releasing lock","identifier":"utm.besnik.net"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5809731,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/stop","remote_ip":"127.0.0.1","remote_port":"39336","headers":{"Accept-Encoding":["gzip"],"Content-Length":["0"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"warn","ts":1675706342.5811977,"logger":"admin.api","msg":"exiting; byeee!! 👋"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5815964,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc0001e1730"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.581959,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5819852,"logger":"admin.api","msg":"shutdown complete","exit_code":0}
Feb 06 17:59:02 staging-server systemd[1]: caddy.service: Deactivated successfully.
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.921481,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Feb 06 17:24:44 staging-server systemd[1]: Started Caddy.
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.9223676,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0003573b0"}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.92294,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.9234228,"logger":"tls","msg":"finished cleaning storage units"}
Feb 06 17:24:44 staging-server caddy[58600]: {"level":"info","ts":1675704284.927475,"msg":"serving initial configuration"}
Feb 06 17:25:09 staging-server systemd[1]: Reloading Caddy...

15 seconds after starting caddy, config is reloaded.

Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.7899773,"logger":"http.acme_client","msg":"successfully downloaded available certificate chains","count":2,"first_url":"https://acme-v02.api.letsencrypt.org/acme/cert/03d8a8447abc08156571bbb1adeb13bcf52b"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.7907612,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"utm.besnik.net"}
Feb 06 17:58:57 staging-server caddy[58600]: {"level":"info","ts":1675706337.790849,"logger":"tls.obtain","msg":"releasing lock","identifier":"utm.besnik.net"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5809731,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/stop","remote_ip":"127.0.0.1","remote_port":"39336","headers":{"Accept-Encoding":["gzip"],"Content-Length":["0"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"warn","ts":1675706342.5811977,"logger":"admin.api","msg":"exiting; byeee!! 👋"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5815964,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc0001e1730"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.581959,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Feb 06 17:59:02 staging-server caddy[58600]: {"level":"info","ts":1675706342.5819852,"logger":"admin.api","msg":"shutdown complete","exit_code":0}
Feb 06 17:59:02 staging-server systemd[1]: caddy.service: Deactivated successfully.

Then nearly 5 minutes later caddy downloaded certificates and received a command to shutdown. Is that when you run npm run build that triggered caddy shutdown? And if npm is not run, caddy will not stop?

Those logs are still from Feb 6th.

Please show your logs from today if you’re still having problems.

Looks like you deactivated the Caddy service. Which explains why it’s not running.

No… Why i stop caddy? My applucation was running from 2 subdomain one with reverse proxy and another phpfpm. When i tried to build last update on nuxt js project then this situation occer.

I do not khow what happen.
1 point: i was run ‘npm i’ and ‘npm run build’ as root user.


I do not know why caddy show Date 6th Feb.
I run ‘journalctl -u caddy --no-pager | tail -n 100’

And also when I run ‘service caddy status’ then show date 6th Feb.

Which means Caddy hasn’t been running since then.

Caddy has nothing to do with npm

Caddy is a Go program. It has nothing to do with a JS dependency tool.

I tried to start again and also reboot server but failed to start.

Same issue.

Now i disable caddy.service daemon and enable again.

And also restart all daemon.

After that caddy working.

But why this issue occer?

Why background certificate stop?

We literally cannot answer that. We don’t know what commands you ran on your server. All I can tell you is that Caddy would never disable itself.

1 Like

Thank you so much.
Caddy community is so active.

I know caddy stop itself but…

Recently we shift to caddy from nginx.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.