{"record":{"id":"5310c41539a8c740","repo":"caddyserver/caddy","slug":"rotating-ech-configs-w","errorCode":null,"errorMessage":"rotating ECH configs: %w","messagePattern":"rotating ECH configs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/ech.go","lineNumber":140,"sourceCode":"\t\t\t// no config with this public name was loaded, so create one\n\t\t\techCfg, err := generateAndStoreECHConfig(ctx, publicName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tlogger.Debug(\"generated new ECH config\",\n\t\t\t\tzap.String(\"public_name\", echCfg.RawPublicName),\n\t\t\t\tzap.Uint8(\"id\", echCfg.ConfigID))\n\t\t\tech.configs[publicName] = append(ech.configs[publicName], echCfg)\n\t\t\touterNames = append(outerNames, publicName)\n\t\t}\n\t}\n\n\t// convert the configs into a structure ready for the std lib to use\n\tech.updateKeyList()\n\n\t// ensure any old keys are rotated out\n\tif err = ech.rotateECHKeys(ctx, logger, true); err != nil {\n\t\treturn nil, fmt.Errorf(\"rotating ECH configs: %w\", err)\n\t}\n\n\treturn outerNames, nil\n}\n\n// setConfigsFromStorage sets the ECH configs in memory to those in storage.\n// It must be called in a write lock on ech.configsMu.\nfunc (ech *ECH) setConfigsFromStorage(ctx caddy.Context, logger *zap.Logger) ([]string, error) {\n\tstorage := ctx.Storage()\n\n\tech.configs = make(map[string][]echConfig)\n\n\tvar outerNames []string\n\n\t// start by loading all the existing configs (even the older ones on the way out,\n\t// since some clients may still be using them if they haven't yet picked up on the\n\t// new configs)\n\tcfgKeys, err := storage.List(ctx, echConfigsKey, false)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/ech.go#L122-L158","documentation":"Error \"rotating ECH configs: %w\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/ech.go:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error and storage backend; ECH config rotation failed."],"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-15T17:31:12.345Z"}