{"record":{"id":"48fc529a1fa8b43f","repo":"fatedier/frp","slug":"invalid-argument-frpc-has-no-config-file-path","errorCode":null,"errorMessage":"invalid argument: frpc has no config file path","messagePattern":"invalid argument: frpc has no config file path","errorType":"http","errorClass":"ErrInvalidArgument","httpStatus":400,"severity":"error","filePath":"client/config_manager.go","lineNumber":28,"sourceCode":"\t\"github.com/fatedier/frp/client/proxy\"\n\t\"github.com/fatedier/frp/pkg/config\"\n\t\"github.com/fatedier/frp/pkg/config/source\"\n\tv1 \"github.com/fatedier/frp/pkg/config/v1\"\n\t\"github.com/fatedier/frp/pkg/config/v1/validation\"\n\t\"github.com/fatedier/frp/pkg/util/log\"\n)\n\ntype serviceConfigManager struct {\n\tsvr *Service\n}\n\nfunc newServiceConfigManager(svr *Service) configmgmt.ConfigManager {\n\treturn &serviceConfigManager{svr: svr}\n}\n\nfunc (m *serviceConfigManager) ReloadFromFile(strict bool) error {\n\tif m.svr.configFilePath == \"\" {\n\t\treturn fmt.Errorf(\"%w: frpc has no config file path\", configmgmt.ErrInvalidArgument)\n\t}\n\n\tresult, err := config.LoadClientConfigResult(m.svr.configFilePath, strict)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%w: %v\", configmgmt.ErrInvalidArgument, err)\n\t}\n\n\tproxyCfgsForValidation, visitorCfgsForValidation := config.FilterClientConfigurers(\n\t\tresult.Common,\n\t\tresult.Proxies,\n\t\tresult.Visitors,\n\t)\n\tproxyCfgsForValidation = config.CompleteProxyConfigurers(proxyCfgsForValidation)\n\tvisitorCfgsForValidation = config.CompleteVisitorConfigurers(visitorCfgsForValidation)\n\n\tif _, err := validation.ValidateAllClientConfig(result.Common, proxyCfgsForValidation, visitorCfgsForValidation, m.svr.unsafeFeatures); err != nil {\n\t\treturn fmt.Errorf(\"%w: %v\", configmgmt.ErrInvalidArgument, err)\n\t}","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/client/config_manager.go#L10-L46","documentation":"Returned by serviceConfigManager.ReloadFromFile when frpc has no configFilePath — frpc was started without a -c config file (e.g. via admin API-created inline config, environment-only config, or programmatic embedding) so there is no file to reload. It wraps configmgmt.ErrInvalidArgument so callers can classify it.","triggerScenarios":"Starting frpc with only env vars or a config pushed via the admin API, then calling the /api/reload endpoint; embedding frpc as a library (client.NewService) without setting configFilePath; invoking ReloadFromFile on a service constructed from parsed config objects.","commonSituations":"Kubernetes deployments that inject config via API and later trigger a reload; automation scripts calling the reload endpoint on API-configured instances; library users expecting reload to re-read a file that was never registered.","solutions":["If you want file-based reload, start frpc with -c /path/to/frpc.toml so configFilePath is set","If config is API-managed, use the admin API's config endpoints to update config instead of /api/reload","Library users: load config from a known path and construct the service with that path so reload works"],"exampleFix":"# before\nfrpc\n# later: curl -X POST localhost:7400/api/reload -> error\n\n# after\nfrpc -c /etc/frp/frpc.toml\n# now: curl -X POST localhost:7400/api/reload works","handlingStrategy":"type-guard","validationCode":"// Only expose the reload endpoint when a config file backs the service\nif frpcConfigFilePath == \"\" {\n    // skip/503 the /api/reload handler; manage config through the admin API instead\n}","typeGuard":"func canReloadFromFile(svc *client.Service) bool {\n    return svc != nil && svc.ConfigFilePath() != \"\"\n}","tryCatchPattern":"if err := configManager.ReloadFromFile(strict); err != nil {\n    if errors.Is(err, configmgmt.ErrInvalidArgument) && strings.Contains(err.Error(), \"no config file path\") {\n        // service was started API-configured; use API config update, not file reload\n    }\n}","preventionTips":["Standardize on starting frpc with an explicit -c file path in deployments that use hot reload","Document per deployment whether config is file-managed (reload) or API-managed (no reload)"],"tags":["frp","frpc","go","config","reload","admin-api"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}