[URGENT] Caddy does not start

1. The problem I’m having:

Caddy does not start when running caddy start or caddy run

2. Error messages and/or full log output:

2024/09/17 17:38:30.085 INFO    using adjacent Caddyfile
2024/09/17 17:38:30.092 INFO    adapted config to JSON  {"adapter": "caddyfile"}
2024/09/17 17:38:30.093 WARN    Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies    {"adapter": "caddyfile", "file": "Caddyfile", "line": 6}
2024/09/17 17:38:30.095 INFO    admin   admin endpoint started  {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2024/09/17 17:38:30.096 INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0xc000427000"}
2024/09/17 17:38:30.096 INFO    http.auto_https 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}
2024/09/17 17:38:30.096 INFO    http.auto_https enabling automatic HTTP->HTTPS redirects        {"server_name": "srv0"}
2024/09/17 17:38:30.097 WARN    http.auto_https server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv1", "http_port": 80}
2024/09/17 17:38:30.100 INFO    http    enabling HTTP/3 listener        {"addr": ":443"}
2024/09/17 17:38:30.102 INFO    http.log        server running  {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2024/09/17 17:38:30.102 INFO    http.log        server running  {"name": "srv1", "protocols": ["h1", "h2", "h3"]}
2024/09/17 17:38:30.102 INFO    http    enabling automatic TLS certificate management   {"domains": ["about.julimiro.eu", "docs.julimiro.eu", "s3.storage.julimiro.eu", "webmail.julimiro.eu", "juli.furryplace.eu", "eepykitty.lol", "radio.rainbowpaws.club", "www.julimiro.eu", "bin.julimiro.eu", "rainbowpaws.club", "julimiro.eu", "api.julimiro.eu"]}
2024/09/17 17:38:30.120 INFO    tls.cache.maintenance   stopped background certificate maintenance      {"cache": "0xc000427000"}
2024/09/17 17:38:30.120 WARN    http.acme_client        HTTP request failed; retrying   {"url": "https://acme-v02.api.letsencrypt.org/directory", "error": "performing request: Get \"https://acme-v02.api.letsencrypt.org/directory\": context canceled"}
2024/09/17 17:38:30.120 ERROR   tls     failed updating renewal info from ACME CA       {"identifiers": ["docs.julimiro.eu"], "cert_hash": "cfdf6d279018f2d990bae58c40949acc97786f7dcc65a5bac022940c1c6c53f5", "ari_unique_id": "kydGmAOpUWiOmNbEQkjbI79YlNI.A2WKaYiPCocmO00xDghl81yp", "cert_expiry": "2024/12/09 17:59:05.000", "issuer": "acme-v02.api.letsencrypt.org-directory", "error": "provisioning client: context canceled"}
Error: loading initial config: loading new config: http app module: start: finalizing automatic HTTPS: managing certificates for [about.julimiro.eu docs.julimiro.eu s3.storage.julimiro.eu webmail.julimiro.eu juli.furryplace.eu eepykitty.lol radio.rainbowpaws.club www.julimiro.eu bin.julimiro.eu rainbowpaws.club julimiro.eu api.julimiro.eu]: automate: manage [about.julimiro.eu docs.julimiro.eu s3.storage.julimiro.eu webmail.julimiro.eu juli.furryplace.eu eepykitty.lol radio.rainbowpaws.club www.julimiro.eu bin.julimiro.eu rainbowpaws.club julimiro.eu api.julimiro.eu]: julimiro.eu: caching certificate: decoding certificate metadata: unexpected end of JSON input
Error: caddy process exited with error: exit status 1

3. Caddy version:

v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=

4. How I installed and ran Caddy:

a. System environment:

AMD64 debian installed through APT

b. Command:

caddy start

c. Service/unit/compose file:

d. My complete Caddy config:

eepykitty.lol {
        reverse_proxy :3000
        header * {
                X-Powered-By "gayness and paws"
        }

}
docs.julimiro.eu {
        root * /var/www/docs
        file_server {
                hide .git
        }
        header * {
                X-Powered-By "gayness and paws"
        }
}
rainbowpaws.club {
        root * /var/www/paws
        file_server {
                hide .git
        }
        header * {
                X-Powered-By "gayness and paws"
        }
}
about.julimiro.eu {
        root * /var/www/about
        file_server {
                hide .git
        }
        header * {
                X-Powered-By "gayness and paws"
        }
}
julimiro.eu {
        root * /var/www/html
        file_server {
                index index.html index.htm index.php
                hide .git
        }
        header * {
                X-Powered-By "gayness and paws"
                -Strict-Transport-Security
        }
}
http://insec.julimiro.eu {
        root * /var/www/html
        file_server {
                index index.html index.htm index.php
                hide .git
        }
        php_fastcgi 127.0.0.1:9000
        header * {
                X-Powered-By "gayness and paws"
        }
        tls {
                on_demand
        }
}
api.julimiro.eu {
        root * /var/www/api
        file_server {
                hide .git
        }
        php_fastcgi 127.0.0.1:9000
        header * {
                Access-Control-Allow-Origin "*"
        }
}

www.julimiro.eu {
        redir https://julimiro.eu
}
juli.furryplace.eu {
        root * /var/www/html
        file_server {
                index index.php index.html index.htm
                hide .git
        }
        php_fastcgi 127.0.0.1:9000
        header * {
                X-Powered-By "gayness and paws"
        }
}

webmail.julimiro.eu {
        reverse_proxy :8083
        header * {
                X-Powered-By "gayness and paws"
        }
}

bin.julimiro.eu {
        reverse_proxy :6157
        header * {
                X-Powered-By "gayness and paws"
        }
}
radio.rainbowpaws.club {
        reverse_proxy :3088
}
s3.storage.julimiro.eu {
        reverse_proxy 147.160.139.6:3902
}

5. Links to relevant resources:

For some reason, the certificate and ACME account files were corrupted. One fix for now is to delete the caddy data directory (check link) and let Caddy get new ones.

We’re working on a more rebust implementation of the data file locking, which should reduce any chance of data corruption.

2 Likes

Thanks! did this fix it!

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