{"record":{"id":"e2862820deba6f6c","repo":"fatedier/frp","slug":"parse-config-error-v","errorCode":null,"errorMessage":"parse config error: %v","messagePattern":"parse config error: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/legacy/parse.go","lineNumber":44,"sourceCode":"\tproxyCfgs map[string]ProxyConf,\n\tvisitorCfgs map[string]VisitorConf,\n\terr error,\n) {\n\tvar content []byte\n\tcontent, err = GetRenderedConfFromFile(filePath)\n\tif err != nil {\n\t\treturn\n\t}\n\tconfigBuffer := bytes.NewBuffer(nil)\n\tconfigBuffer.Write(content)\n\n\t// Parse common section.\n\tcfg, err = UnmarshalClientConfFromIni(content)\n\tif err != nil {\n\t\treturn\n\t}\n\tif err = cfg.Validate(); err != nil {\n\t\terr = fmt.Errorf(\"parse config error: %v\", err)\n\t\treturn\n\t}\n\n\t// Aggregate proxy configs from include files.\n\tvar buf []byte\n\tbuf, err = getIncludeContents(cfg.IncludeConfigFiles)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"getIncludeContents error: %v\", err)\n\t\treturn\n\t}\n\tconfigBuffer.WriteString(\"\\n\")\n\tconfigBuffer.Write(buf)\n\n\t// Parse all proxy and visitor configs.\n\tproxyCfgs, visitorCfgs, err = LoadAllProxyConfsFromIni(cfg.User, configBuffer.Bytes(), cfg.Start)\n\tif err != nil {\n\t\treturn\n\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/legacy/parse.go#L26-L62","documentation":"This is the wrapper error produced when the legacy INI client config passes initial parsing but fails ClientCommonConf.Validate — i.e. the real cause is one of the [common]-section validation errors (heartbeat ordering, invalid protocol, include problems) surfaced as 'parse config error: <cause>'. The %v embeds the specific validation message.","triggerScenarios":"Calling the legacy client config load path (legacy INI frpc.ini with a [common] section) where Validate() returns an error: heartbeat_timeout < heartbeat_interval, protocol outside tcp/kcp/quic/websocket/wss, or an unresolvable/missing include directory.","commonSituations":"frpc fails at startup with 'parse config error: ...' — the tail of the message names the actual problem (e.g. 'parse config error: invalid protocol'). Common after hand-editing INI files or copying configs between environments.","solutions":["Read the suffix of the message after 'parse config error:' — it is the root cause (see the heartbeat/protocol/include errors)","Fix the named field in the [common] section of frpc.ini","Re-run frpc verify (frpc verify -c frpc.ini) to confirm validation passes"],"exampleFix":"# console: parse config error: invalid protocol\n# before\n[common]\nprotocol = http\n\n# after\n[common]\nprotocol = tcp","handlingStrategy":"try-catch","validationCode":"// run ClientCommonConf.Validate() yourself before load\nif err := commonConf.Validate(); err != nil {\n    return fmt.Errorf(\"pre-flight validation failed: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := legacy.LoadConfigure(path); err != nil {\n    if idx := strings.Index(err.Error(), \"parse config error: \"); idx >= 0 {\n        root := err.Error()[idx+len(\"parse config error: \"):]\n        // branch on root: heartbeat / protocol / include fixes\n    }\n    return err\n}","preventionTips":["Treat 'parse config error:' as a wrapper; always resolve the suffix","Add frpc verify to CI","Keep [common] fields in one reviewed template"],"tags":["config","validation","legacy-ini","frpc","error-wrapping"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}