{"record":{"id":"492790a28c8ca49d","repo":"fatedier/frp","slug":"failed-to-load-config-from-sources-w","errorCode":null,"errorMessage":"failed to load config from sources: %w","messagePattern":"failed to load config from sources: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/frpc/sub/root.go","lineNumber":167,"sourceCode":"\t\t}\n\n\t\ts, err := source.NewStoreSource(source.StoreSourceConfig{\n\t\t\tPath: storePath,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create store source: %w\", err)\n\t\t}\n\t\tstoreSource = s\n\t}\n\n\taggregator := source.NewAggregator(configSource)\n\tif storeSource != nil {\n\t\taggregator.SetStoreSource(storeSource)\n\t}\n\n\tproxyCfgs, visitorCfgs, err := aggregator.Load()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to load config from sources: %w\", err)\n\t}\n\n\tproxyCfgs, visitorCfgs = config.FilterClientConfigurers(result.Common, proxyCfgs, visitorCfgs)\n\tproxyCfgs = config.CompleteProxyConfigurers(proxyCfgs)\n\tvisitorCfgs = config.CompleteVisitorConfigurers(visitorCfgs)\n\n\twarning, err := validation.ValidateAllClientConfig(result.Common, proxyCfgs, visitorCfgs, unsafeFeatures)\n\tif warning != nil {\n\t\tfmt.Printf(\"WARNING: %v\\n\", warning)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn startServiceWithAggregator(result.Common, aggregator, unsafeFeatures, cfgFilePath)\n}\n\nfunc startServiceWithAggregator(","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/cmd/frpc/sub/root.go#L149-L185","documentation":"The source aggregator (config source plus optional store source) failed its Load() pass, which re-reads and decodes all proxy/visitor configs, merging anything present in the store cache. The wrapped error comes from the aggregator/store decode path rather than initial file parsing.","triggerScenarios":"aggregator.Load() errors when a store cache file contains data that cannot be decoded into current configurers (schema drift after upgrade) or when a source returns entries that fail typed decoding.","commonSituations":"Upgrading frpc while an old-format store cache file persists on disk; a store cache written by a different user with different permissions; a hand-edited or truncated cache file.","solutions":["Delete the store cache file (path from common.store.path, resolved relative to cfgFile) and let frpc rebuild it.","If it recurs after rebuild, check the inner error for the exact entry and compare your frpc version with the one that wrote the cache.","Run once with the store disabled to confirm the file-based configs alone load cleanly, isolating the store as the culprit."],"exampleFix":"# remove stale store cache, then restart\nrm -f /etc/frp/frpc_cache\n# path = the [store] path value, or its default alongside cfgFile","handlingStrategy":"fallback","validationCode":"// On upgrade, remove or validate the store cache before start\nif _, err := os.Stat(resolvedStorePath); err == nil {\n    // decode-check or delete: the store is a rebuildable cache\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := aggregator.Load(); err != nil && storeSource != nil {\n    os.Remove(storePath) // cache corrupt after upgrade: rebuild, then retry once\n}","preventionTips":["Delete store cache files across frp upgrades","Treat the store as disposable cache; never hand-edit it","Pin one frpc version per environment to avoid schema drift"],"tags":["store","config","upgrade","frpc"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}