{"record":{"id":"36dd7bc8c46772f3","repo":"fatedier/frp","slug":"include-directory-of-s-not-exist","errorCode":null,"errorMessage":"include: directory of %s not exist","messagePattern":"include: directory of (.+?) not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/legacy/client.go","lineNumber":393,"sourceCode":"\t\t\tfmt.Println(\"WARNING! tls_key_file is invalid when tls_enable is false\")\n\t\t}\n\n\t\tif cfg.TLSTrustedCaFile != \"\" {\n\t\t\tfmt.Println(\"WARNING! tls_trusted_ca_file is invalid when tls_enable is false\")\n\t\t}\n\t}\n\n\tif !slices.Contains([]string{\"tcp\", \"kcp\", \"quic\", \"websocket\", \"wss\"}, cfg.Protocol) {\n\t\treturn fmt.Errorf(\"invalid protocol\")\n\t}\n\n\tfor _, f := range cfg.IncludeConfigFiles {\n\t\tabsDir, err := filepath.Abs(filepath.Dir(f))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"include: parse directory of %s failed: %v\", f, err)\n\t\t}\n\t\tif _, err := os.Stat(absDir); os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"include: directory of %s not exist\", f)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":375,"sourceCodeEnd":398,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/legacy/client.go#L375-L398","documentation":"For each glob in the legacy frpc includes directive, frp stats the directory portion and rejects the config when it does not exist. It fires before any file matching happens, so even a glob that would match zero files passes, but a missing directory fails hard.","triggerScenarios":"includes = /etc/frp/proxies/*.ini where /etc/frp/proxies does not exist on the machine running frpc; also typos in the directory part, or configs moved between hosts without creating the include directories.","commonSituations":"Deploying the same frpc.ini to many machines where only some have the include dir; renaming directories during refactors; fresh installs where the operator forgot to lay out per-host proxy config files.","solutions":["Create the directory: mkdir -p /etc/frp/proxies","Fix the path/typo in the includes value","If includes are optional per host, remove the includes line on hosts without extra proxies"],"exampleFix":"# before\nincludes = /etc/frp/proxis/*.ini   # typo, dir missing\n\n# after\nmkdir -p /etc/frp/proxies\nincludes = /etc/frp/proxies/*.ini","handlingStrategy":"validation","validationCode":"for _, f := range includeGlobs {\n    if _, err := os.Stat(filepath.Dir(f)); err != nil {\n        return fmt.Errorf(\"include directory missing: %s\", f)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil { if strings.Contains(err.Error(), \"directory of\") && strings.Contains(err.Error(), \"not exist\") { os.MkdirAll(dir, 0o755) /* then retry load once */ } }","preventionTips":["mkdir -p include directories in your provisioning scripts","Fail deployments early with a pre-flight stat check on include dirs","Remove includes lines on hosts that have no extra fragments"],"tags":["config","filesystem","include","legacy-ini","frpc"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}