caddyserver/caddy · error
error loading ECH config metadata (%v) and cleaning up paren
Error message
error loading ECH config metadata (%v) and cleaning up parent storage key %s: %v
What it means
Error "error loading ECH config metadata (%v) and cleaning up parent storage key %s: %v" thrown in caddyserver/caddy.
Source
Thrown at modules/caddytls/ech.go:583
if err := cfg.UnmarshalBinary(echConfigBytes); err != nil {
delErr := storage.Delete(ctx, cfgIDKey)
if delErr != nil {
return echConfig{}, fmt.Errorf("error loading ECH config (%v) and cleaning up parent storage key %s: %v", err, cfgIDKey, delErr)
}
logger.Warn("could not load ECH config; deleted its config folder",
zap.String("config_id", configID),
zap.Error(err))
return echConfig{}, nil
}
metaBytes, err := storage.Load(ctx, metaKey)
if errors.Is(err, fs.ErrNotExist) {
logger.Warn("ECH config metadata file missing; will recreate at next publication",
zap.String("config_id", configID),
zap.Error(err))
} else if err != nil {
delErr := storage.Delete(ctx, cfgIDKey)
if delErr != nil {
return echConfig{}, fmt.Errorf("error loading ECH config metadata (%v) and cleaning up parent storage key %s: %v", err, cfgIDKey, delErr)
}
logger.Warn("could not load ECH config metadata; deleted its folder",
zap.String("config_id", configID),
zap.Error(err))
return echConfig{}, nil
}
var meta echConfigMeta
if len(metaBytes) > 0 {
if err := json.Unmarshal(metaBytes, &meta); err != nil {
// even though it's just metadata, reset the whole config since we can't reliably maintain it
delErr := storage.Delete(ctx, cfgIDKey)
if delErr != nil {
return echConfig{}, fmt.Errorf("error decoding ECH metadata (%v) and cleaning up parent storage key %s: %v", err, cfgIDKey, delErr)
}
logger.Warn("could not JSON-decode ECH metadata; deleted its config folder",
zap.String("config_id", configID),
zap.Error(err))
return echConfig{}, nilView on GitHub (pinned to 50e54ee279)
Solutions
- Inspect both wrapped errors: the ECH config metadata failed to load, and cleanup of its storage key also failed. Check storage health.
When it happens
Trigger: Thrown at modules/caddytls/ech.go:583 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of caddyserver/caddy@50e54ee279 (2026-08-15).
Data as JSON: /api/errors/2da727bf140a9bcd.
Report an issue: GitHub.