{"record":{"id":"d18d66ab2a98e645","repo":"OpenNHP/opennhp","slug":"config-load-error-d18d66","errorCode":null,"errorMessage":"config load error","messagePattern":"config load error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"endpoints/server/config.go","lineNumber":64,"sourceCode":"\t\treturn nil, fmt.Errorf(\"base64 decode failed: %w\", err)\n\t}\n\tif len(raw) != 32 {\n\t\treturn nil, fmt.Errorf(\"cookie signing key must be exactly 32 bytes after base64 decode, got %d\", len(raw))\n\t}\n\treturn raw, nil\n}\n\nvar (\n\tbaseConfigWatch  io.Closer\n\thttpConfigWatch  io.Closer\n\tacConfigWatch    io.Closer\n\tagentConfigWatch io.Closer\n\tresConfigWatch   io.Closer\n\tsrcipConfigWatch io.Closer\n\tdbConfigWatch    io.Closer\n\trelayConfigWatch io.Closer\n\tteeWatch         io.Closer\n\terrLoadConfig    = fmt.Errorf(\"config load error\")\n)\n\ntype ServerEtcdConfig struct {\n\tBaseConfig    Config\n\tHttpConfig    HttpConfig\n\tACs           []*core.UdpPeer\n\tAgents        []*core.UdpPeer\n\tDBs           []*core.UdpPeer\n\tAuthServiceId []*common.AuthServiceProviderData\n\tSrcIps        []*SrcIpMap\n}\n\ntype SrcIpMap struct {\n\tSrcIp string\n\tIp    []string\n}\n\ntype Config struct {","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/OpenNHP/opennhp/blob/6e04ca5ff03222a699c24205cd4bf8fee9af7ffe/endpoints/server/config.go#L46-L82","documentation":"A package-level sentinel error (errLoadConfig, mirrored in the ac package) used as a placeholder: updateBaseConfig and the etcd config watchers set it via CatchPanicThenRun so that a panic during config processing is converted into this generic 'config load error' return value. Seeing it means some deeper config-update operation panicked and was swallowed into this sentinel, not that a specific field failed validation.","triggerScenarios":"Thrown at endpoints/server/config.go:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look for a preceding panic/stack in the logs to identify the real failing operation","Enable debug logging around config updates to surface the panic cause","Fix the underlying panic (usually malformed config content reaching a code path without nil/type checks)","Keep the sentinel but add context wrapping so the original panic reason is preserved"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e04ca5ff03222a699c24205cd4bf8fee9af7ffe","analyzedAt":"2026-09-07T15:44:59.941Z","contentChangedAt":"2026-09-07T15:44:59.941Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}