Where are the caddy logs? Caddy stops working after some days

1. Caddy version (caddy version):

v2.2.2 h1:Ha3bvEvkb/GLGEX648/qI5zTt6uJCnfQhZHmZBxhzDY=

2. How I run Caddy:

(cloudflare) {
  tls {
    dns cloudflare ...............................................
  }
}

arkmap.axi92.at {
  import cloudflare
  reverse_proxy localhost:8080
}

a. System environment:

Ubuntu 18.04

b. Command:

$ sudo caddy start
2020/12/26 15:23:03.768 INFO    using adjacent Caddyfile
2020/12/26 15:23:03.777 INFO    admin   admin endpoint started  {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["127.0.0.1:2019", "localhost:2019", "[::1]:2019"]}
2020/12/26 15:23:03.779 INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0xc000353dc0"}
2020/12/26 15:23:03.818 INFO    http    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}
2020/12/26 15:23:03.818 INFO    http    enabling automatic HTTP->HTTPS redirects        {"server_name": "srv0"}
2020/12/26 15:23:03.822 INFO    http    enabling automatic TLS certificate management   {"domains": ["arkmap.axi92.at"]}
2020/12/26 15:23:03.906 INFO    tls     cleaned up storage units
2020/12/26 15:23:04.172 INFO    autosaved config        {"file": "/home/sunny/.config/caddy/autosave.json"}
2020/12/26 15:23:04.172 INFO    serving initial configuration
Successfully started Caddy (pid=29752) - Caddy is running in the background

c. Service/unit/compose file:

paste full file contents here

d. My complete Caddyfile or JSON config:

(cloudflare) {
        tls {
                dns cloudflare .............................................
        }
}

arkmap.axi92.at {
        import cloudflare
        reverse_proxy localhost:8080
}

3. The problem I’m having:

I run my caddy as described but after som days it stoped working. I have no Idea where the caddy logs are…

4. Error messages and/or full log output:

I like to see the error message, but I can’t find it.

5. What I already tried:

journalctl, dmesg, /var/logs/*

6. Links to relevant resources:

This is the state of caddy when it is not working in htop. I cant stop it with “sudo caddy stop” so I have to kill the process.

v2.2.2 is not a real version – please upgrade to v2.3.0-rc.1 (pre-release) and see if the problem still occurs.

1 Like

Ok I upgraded to v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c= that was the bundle that I got from Download Caddy hence I need the cloudflare plugin.

I have still the same problem with v2.2.1, caddy does not work because my site is offline.
sudo caddy stop never returns, the only workaround that I have is kill the process and restart it. But after some time it stops working.

Where are the caddy logs to find whats the problem?

v2.2.1 does not have the fix, v2.3 does (see my reply above, I recommend v2.3.0 – not 2.2.1). It’s been released now. What is happening is your CDN is DDoSing your server. This is an unusual and inconsiderate choice on Cloudflare’s part. Caddy now mitigates this by default by closing idle connections after some time.

As for the logs, another user who couldn’t find them had a problem with their linux system and described how they fixed it here: Caddy is not generating any logs when launched as a service · Issue #3943 · caddyserver/caddy · GitHub

Ah ok I see. But I cant get the right version from Download Caddy I still get 2.2.1.
Is there another place to get v2.3 with cloudflare?

Really? Hmm… I’ll look into that as soon as I have a chance!

Our install page describes all the various ways we know of to get Caddy:

It’s easy to build Caddy with plugins using xcaddy: Build from source — Caddy Documentation

Can confirm, I’m getting v2.2.1 from the download page as well. :frowning:

With the new version and the change that my problem was that I started caddy only with sudo caddy start
But that was not working so well. It used the /lib/systemd/system/caddy.service for the systemctl.
I removed it and enabled it with the full path to my /etc/systemd/ caddy.service file (from here dist/caddy.service at master · caddyserver/dist · GitHub) with modified config path
Now it is working, also with the logs =)

1 Like

Cool. And I’ll check on why the download page isn’t updated.

Download page is updated! Should be the latest now.

1 Like

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