{"record":{"id":"ecf7626dc76508da","repo":"sipeed/picoclaw","slug":"failed-to-load-security-config-w","errorCode":null,"errorMessage":"failed to load security config: %w","messagePattern":"failed to load security config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/config.go","lineNumber":1507,"sourceCode":"\t\t\t\"config migrate success\",\n\t\t\tmap[string]any{\"from\": versionInfo.Version, \"to\": CurrentVersion},\n\t\t)\n\tcase CurrentVersion:\n\t\t// Current version\n\t\tcfg, err = loadConfig(data)\n\t\tif err != nil {\n\t\t\tlogger.ErrorCF(\n\t\t\t\t\"config\",\n\t\t\t\tformatDiagnosticLogMessage(\"Failed to load config\", err),\n\t\t\t\tmap[string]any{\"path\": path},\n\t\t\t)\n\t\t\treturn nil, err\n\t\t}\n\t\t// Load security configuration\n\t\tsecPath := securityPath(path)\n\t\terr = loadSecurityConfig(cfg, secPath)\n\t\tif err != nil && !errors.Is(err, os.ErrNotExist) {\n\t\t\treturn nil, fmt.Errorf(\"failed to load security config: %w\", err)\n\t\t}\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported config version: %d\", versionInfo.Version)\n\t}\n\n\tapplyLegacyBindingsMigration(data, cfg)\n\n\tgatewayHostBeforeEnv := cfg.Gateway.Host\n\n\tif err = env.Parse(cfg); err != nil {\n\t\treturn nil, err\n\t}\n\tapplySkillsRegistryEnvCompat(cfg)\n\n\tif err = InitChannelList(cfg.Channels); err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":1489,"sourceCodeEnd":1525,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/config.go#L1489-L1525","documentation":"Returned during config load of an already-current-version config: loading the companion security file (securityPath(path)) failed with something other than os.ErrNotExist — parse error, permission denied, or schema mismatch. The wrapped %w carries the security-config error; a simply missing file is tolerated, so this error means the file exists but is unreadable or invalid.","triggerScenarios":"Thrown at pkg/config/config.go:1507 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check file permissions on the security config next to the main config","Validate its format (YAML syntax, expected schema) and fix parse errors","If the file is leftover garbage, move it aside — absence is handled gracefully"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}