{"record":{"id":"575c37a10c45602e","repo":"caddyserver/caddy","slug":"s-is-invalid-policy","errorCode":null,"errorMessage":"%s is invalid policy","messagePattern":"(.+?) is invalid policy","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddyhttp/proxyprotocol/policy.go","lineNumber":78,"sourceCode":"func (x Policy) MarshalText() ([]byte, error) {\n\treturn []byte(policyMap[x]), nil\n}\n\n// UnmarshalText implements the text unmarshaller method.\nfunc (x *Policy) UnmarshalText(text []byte) error {\n\tname := string(text)\n\ttmp, err := parsePolicy(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = tmp\n\treturn nil\n}\n\nfunc parsePolicy(name string) (Policy, error) {\n\tif x, ok := policyMapRev[strings.ToUpper(name)]; ok {\n\t\treturn x, nil\n\t}\n\treturn Policy(0), fmt.Errorf(\"%s is %w\", name, errInvalidPolicy)\n}\n\nvar errInvalidPolicy = errors.New(\"invalid policy\")\n","sourceCodeStart":60,"sourceCodeEnd":83,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddyhttp/proxyprotocol/policy.go#L60-L83","documentation":"loadECHConfig could not load the ECH config bytes (config.bin) from storage, and the cleanup delete of the config folder also failed. Same double-failure shape as the key.bin case: the per-config recovery path assumes deletes work, and they did not.","triggerScenarios":"storage.Load of config.bin errors AND storage.Delete of the folder errors — read-only storage, backend outage, or permissions preventing both operations.","commonSituations":"Read-only data volumes; storage corruption affecting config.bin; storage backends where child-key deletion is disallowed while listing works.","solutions":["Fix storage read/write availability first; the error only clears when deletes can succeed.","Remove the reported ech/configs/<id> folder manually after storage is writable, then restart.","Keep the whole ech/configs tree under one writable, consistent storage backend."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"Parse the named cfgIDKey from the error, restore storage write access, manually remove that folder, and restart — the load path then regenerates the config.","preventionTips":["Keep the ech/configs tree on writable storage.","Use atomic-write storage so config.bin is never truncated.","Include ECH storage keys in backup/restore procedures as whole folders."],"tags":["caddy","caddytls","ech","storage","cleanup"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}