{"record":{"id":"73e2ec9ff3e53faf","repo":"fatedier/frp","slug":"load-additional-config-from-s-error-v","errorCode":null,"errorMessage":"load additional config from %s error: %v","messagePattern":"load additional config from (.+?) error: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/load.go","lineNumber":526,"sourceCode":"\t\t\treturn nil, nil, err\n\t\t}\n\t\tif _, err := os.Stat(absDir); os.IsNotExist(err) {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfiles, err := os.ReadDir(absDir)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfor _, fi := range files {\n\t\t\tif fi.IsDir() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tabsFile := filepath.Join(absDir, fi.Name())\n\t\t\tif matched, _ := filepath.Match(filepath.Join(absDir, filepath.Base(path)), absFile); matched {\n\t\t\t\t// support yaml/json/toml\n\t\t\t\tcfg := v1.ClientConfig{}\n\t\t\t\tif err := LoadConfigureFromFile(absFile, &cfg, strict); err != nil {\n\t\t\t\t\treturn nil, nil, fmt.Errorf(\"load additional config from %s error: %v\", absFile, err)\n\t\t\t\t}\n\t\t\t\tfor _, c := range cfg.Proxies {\n\t\t\t\t\tproxyCfgs = append(proxyCfgs, c.ProxyConfigurer)\n\t\t\t\t}\n\t\t\t\tfor _, c := range cfg.Visitors {\n\t\t\t\t\tvisitorCfgs = append(visitorCfgs, c.VisitorConfigurer)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn proxyCfgs, visitorCfgs, nil\n}\n","sourceCodeStart":508,"sourceCodeEnd":539,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/load.go#L508-L539","documentation":"In the new-format client config loader, each glob under includes is expanded and every matched file is loaded as a full v1.ClientConfig via LoadConfigureFromFile (yaml/json/toml all supported). Any decode/validation failure in one included file aborts with 'load additional config from <absFile> error: <cause>', naming the offending file.","triggerScenarios":"frpc.toml with includes = [\"/etc/frp/conf/*.toml\"] where one matched file has a TOML syntax error, a wrong-typed field, an unknown proxy type, or cannot be parsed at all; the wrapper names exactly which file failed.","commonSituations":"Splitting proxy definitions into per-service files; one broken fragment (typo, bad type) taking down the whole frpc start; editor temp files matching the glob.","solutions":["Open the named file and fix the wrapped error (usually a syntax or type error)","Narrow the include glob so only intended files match (exclude .bak/.swp)","Run frpc verify after fixing to validate the merged view"],"exampleFix":"# before (/etc/frp/conf/db.toml has: bindPort = \"3306\")\n# after (in /etc/frp/conf/db.toml)\nbindPort = 3306","handlingStrategy":"try-catch","validationCode":"// pre-load every included file standalone\nfor _, f := range expandedIncludeFiles {\n    tmp := v1.ClientConfig{}\n    if err := config.LoadConfigureFromFile(f, &tmp, strict); err != nil { return fmt.Errorf(\"include %s invalid: %w\", f, err) }\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := config.LoadClientConfigWithIncludes(...); err != nil { if i := strings.Index(err.Error(), \"load additional config from \"); i >= 0 { /* substring names the broken file; fix only that file */ } }","preventionTips":["Verify each include file independently in CI","Tighten include globs","Write include files atomically"],"tags":["config","includes","toml","yaml","frpc"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}