{"record":{"id":"47f43e0861fb83ab","repo":"caddyserver/caddy","slug":"deleting-expired-ech-config-v","errorCode":null,"errorMessage":"deleting expired ECH config: %v","messagePattern":"deleting expired ECH config: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/ech.go","lineNumber":263,"sourceCode":"\t\t\t\tmetaBytes, err := json.Marshal(ech.configs[publicName][i].meta)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"marshaling updated ECH config metadata: %v\", err)\n\t\t\t\t}\n\t\t\t\tif err := storage.Store(ctx, echMetaKey(cfg.ConfigID), metaBytes); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"storing updated ECH config metadata: %v\", err)\n\t\t\t\t}\n\n\t\t\t\tech.configs[publicName] = append(ech.configs[publicName], newCfg)\n\n\t\t\t\tlogger.Debug(\"rotated ECH key\",\n\t\t\t\t\tzap.String(\"public_name\", cfg.RawPublicName),\n\t\t\t\t\tzap.Uint8(\"old_id\", cfg.ConfigID),\n\t\t\t\t\tzap.Uint8(\"new_id\", newCfg.ConfigID))\n\t\t\t} else if time.Since(cfg.meta.Created) >= deleteAfter && !cfg.meta.Replaced.IsZero() {\n\t\t\t\t// key has expired and is no longer supported; delete it from storage and memory\n\t\t\t\tcfgIDKey := path.Join(echConfigsKey, strconv.Itoa(int(cfg.ConfigID)))\n\t\t\t\tif err := storage.Delete(ctx, cfgIDKey); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"deleting expired ECH config: %v\", err)\n\t\t\t\t}\n\n\t\t\t\tech.configs[publicName] = append(ech.configs[publicName][:i], ech.configs[publicName][i+1:]...)\n\t\t\t\ti--\n\n\t\t\t\tlogger.Debug(\"deleted expired ECH key\",\n\t\t\t\t\tzap.String(\"public_name\", cfg.RawPublicName),\n\t\t\t\t\tzap.Uint8(\"id\", cfg.ConfigID),\n\t\t\t\t\tzap.Duration(\"age\", time.Since(cfg.meta.Created)))\n\t\t\t}\n\t\t}\n\t}\n\n\tech.updateKeyList()\n\n\treturn nil\n}\n","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/ech.go#L245-L281","documentation":"Error \"deleting expired ECH config: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/ech.go:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check storage backend availability and permissions; the expired ECH config could not be deleted."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}