1. The problem I’m having:
Hi - my other assertions in my test are passing, but the test overall is failing because of this failure:
/Users/daaronch/code/spartacus/caddytest.go:102: failed ensuring config is running: EnsureConfigRunning: POSTed configuration isn't active
/Users/daaronch/code/spartacus/caddytest.go:126: unable to read the current config
I can’t even figure out where this comes from Any suggestions on how to debug?
2. Error messages and/or full log output:
{"level":"info","ts":1715389096.919395,"logger":"http.handlers.spartacus","msg":"Koala config is empty"}
{"level":"info","ts":1715389096.9193962,"logger":"http.handlers.spartacus","msg":"Development mode is disabled"}
{"level":"info","ts":1715389096.9231339,"logger":"pki.ca.local","msg":"root certificate is already trusted by system","path":"storage:pki/authorities/local/root.crt"}
{"level":"info","ts":1715389096.923208,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
{"level":"debug","ts":1715389096.923472,"logger":"http","msg":"starting server loop","address":"[::]:443","tls":true,"http3":true}
{"level":"debug","ts":1715389096.9235132,"logger":"http","msg":"starting server loop","address":"[::]:80","tls":false,"http3":true}
{"level":"info","ts":1715389096.92352,"logger":"http.log","msg":"server running","name":"spartacus_server","protocols":["h1","h2","h3"]}
{"level":"info","ts":1715389096.923538,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["127.0.0.1","localhost"]}
{"level":"warn","ts":1715389096.923753,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [127.0.0.1]: no OCSP server specified in certificate","identifiers":["127.0.0.1"]}
{"level":"debug","ts":1715389096.9237618,"logger":"tls.cache","msg":"added certificate to cache","subjects":["127.0.0.1"],"expiration":1715410164,"managed":true,"issuer_key":"local","hash":"d815544ac6b10fd22d74fbf23b3dd6e27a19058fdf96e96592821e311faf2dfb","cache_size":1,"cache_capacity":10000}
{"level":"debug","ts":1715389096.923771,"logger":"events","msg":"event","name":"cached_managed_cert","id":"4e9163ad-7d2b-452e-bd15-a97a4d96b0f0","origin":"tls","data":{"sans":["127.0.0.1"]}}
{"level":"warn","ts":1715389096.923981,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [localhost]: no OCSP server specified in certificate","identifiers":["localhost"]}
{"level":"debug","ts":1715389096.923986,"logger":"tls.cache","msg":"added certificate to cache","subjects":["localhost"],"expiration":1715410164,"managed":true,"issuer_key":"local","hash":"934c50b1ce4ec856822a51fa1724d48379de4d47ca00129c72d34f918d81179a","cache_size":2,"cache_capacity":10000}
{"level":"debug","ts":1715389096.9239922,"logger":"events","msg":"event","name":"cached_managed_cert","id":"5e8b605b-5b84-4536-bbe0-88ac0c0968d7","origin":"tls","data":{"sans":["localhost"]}}
{"level":"warn","ts":1715389096.924292,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/Users/daaronch/Library/Application Support/Caddy","instance":"9cfc62d9-28c4-469a-bdd5-97fb30adf0e9","try_again":1715475496.9242911,"try_again_in":86399.999999833}
{"level":"info","ts":1715389096.924354,"msg":"autosaved config (load with --resume flag)","file":"/Users/daaronch/Library/Application Support/Caddy/autosave.json"}
{"level":"info","ts":1715389096.9243588,"logger":"admin.api","msg":"load complete"}
{"level":"info","ts":1715389096.9244869,"msg":"caddytest: config load time took 7.7645ms"}
{"level":"info","ts":1715389096.9245172,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":1715389096.926425,"logger":"admin","msg":"stopped previous server","address":"localhost:2999"}
{"level":"info","ts":1715389106.9449542,"msg":"caddytest: redirecting the dialer from 127.0.0.1:443 to 127.0.0.1:443"}
3. Caddy version:
❯ xcaddy version
v0.4.0 h1:V4n6nNlkRPmrgE+npteBjS7hgMfw24UEmiIONDpIWSo=
❯ ./caddy version
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
Built caddy with the module.
a. System environment:
MacOS
b. Command:
go test
d. My complete Caddy config:
{
"logging": {
"logs": {
"default": {
"level": "DEBUG",
"writer": {
"output": "stdout"
}
},
"spartacusStdOutLogs": {
"level": "DEBUG",
"writer": {
"output": "stdout"
},
"include": [
"http.*",
"admin.*"
]
},
"spartacusFileLogs": {
"level": "DEBUG",
"writer": {
"output": "file",
"filename": "/tmp/spartacus.log"
},
"include": [
"http.*",
"admin.*"
]
}
}
},
"apps": {
"http": {
"servers": {
"spartacus_server": {
"listen": [
":443",
":80"
],
"routes": [
{
"handle": [
{
"handler": "spartacus",
"posthog": {
"Endpoint": "https://iiii.smartmock.io",
"ProjectAPIKey": "phc_REDACT",
"PersonalAPIKey": "phc_REDACT"
},
"development": false
}
]
},
{
"match": [
{
"host": [
"localhost",
"127.0.0.1"
]
}
]
}
],
"logs": {
"default_logger_name": "spartacusStdOutLogs",
"logger_names": {
"localhost": "spartacusStdOutLogs",
"127.0.0.1": "spartacusFileLogs"
}
}
}
}
}
}
}