{"record":{"id":"7ec533a3dc7c13a9","repo":"caddyserver/caddy","slug":"updating-ech-keys-from-storage-v","errorCode":null,"errorMessage":"updating ECH keys from storage: %v","messagePattern":"updating ECH keys from storage: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/ech.go","lineNumber":219,"sourceCode":"\tif !ech.rotationNeeded(rotationInterval, deleteAfter) {\n\t\treturn nil\n\t}\n\n\t// sync this operation across cluster if not already\n\tif !storageSynced {\n\t\tif err := storage.Lock(ctx, echStorageLockName); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif err := storage.Unlock(ctx, echStorageLockName); err != nil {\n\t\t\t\tlogger.Error(\"unable to unlock ECH rotation in storage\", zap.Error(err))\n\t\t\t}\n\t\t}()\n\t}\n\n\t// update what storage has, in case another instance already updated things\n\tif _, err := ech.setConfigsFromStorage(ctx, logger); err != nil {\n\t\treturn fmt.Errorf(\"updating ECH keys from storage: %v\", err)\n\t}\n\n\t// iterate the updated list and do any updates as needed\n\tfor publicName := range ech.configs {\n\t\tfor i := 0; i < len(ech.configs[publicName]); i++ {\n\t\t\tcfg := ech.configs[publicName][i]\n\t\t\tif time.Since(cfg.meta.Created) >= rotationInterval && cfg.meta.Replaced.IsZero() {\n\t\t\t\t// key is due for rotation and it hasn't been replaced yet; do that now\n\t\t\t\tlogger.Debug(\"ECH config is due for rotation\",\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.Time(\"created\", cfg.meta.Created),\n\t\t\t\t\tzap.Duration(\"age\", time.Since(cfg.meta.Created)),\n\t\t\t\t\tzap.Duration(\"rotation_interval\", rotationInterval))\n\n\t\t\t\t// start by generating and storing the replacement ECH config\n\t\t\t\tnewCfg, err := generateAndStoreECHConfig(ctx, publicName)\n\t\t\t\tif err != nil {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/ech.go#L201-L237","documentation":"Error \"updating ECH keys from storage: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/ech.go:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error and storage backend; ECH keys could not be updated from storage."],"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"}