{"record":{"id":"49f3a3914585a040","repo":"fatedier/frp","slug":"invalid-argument-proxy-name-is-required","errorCode":null,"errorMessage":"invalid argument: proxy name is required","messagePattern":"invalid argument: proxy name is required","errorType":"http","errorClass":"ErrInvalidArgument","httpStatus":400,"severity":"error","filePath":"client/config_manager.go","lineNumber":163,"sourceCode":"\nfunc (m *serviceConfigManager) StoreEnabled() bool {\n\tm.svr.reloadMu.Lock()\n\tstoreSource := m.svr.storeSource\n\tm.svr.reloadMu.Unlock()\n\treturn storeSource != nil\n}\n\nfunc (m *serviceConfigManager) ListStoreProxies() ([]v1.ProxyConfigurer, error) {\n\tstoreSource, err := m.storeSourceOrError()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn storeSource.GetAllProxies()\n}\n\nfunc (m *serviceConfigManager) GetStoreProxy(name string) (v1.ProxyConfigurer, error) {\n\tif name == \"\" {\n\t\treturn nil, fmt.Errorf(\"%w: proxy name is required\", configmgmt.ErrInvalidArgument)\n\t}\n\n\tstoreSource, err := m.storeSourceOrError()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcfg := storeSource.GetProxy(name)\n\tif cfg == nil {\n\t\treturn nil, fmt.Errorf(\"%w: proxy %q\", configmgmt.ErrNotFound, name)\n\t}\n\treturn cfg, nil\n}\n\nfunc (m *serviceConfigManager) CreateStoreProxy(cfg v1.ProxyConfigurer) (v1.ProxyConfigurer, error) {\n\tif err := m.validateStoreProxyConfigurer(cfg); err != nil {\n\t\treturn nil, fmt.Errorf(\"%w: validation error: %v\", configmgmt.ErrInvalidArgument, err)\n\t}","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/client/config_manager.go#L145-L181","documentation":"Returned by GetStoreProxy when the name argument is the empty string. The store-proxy API identifies entries by name (GET /api/store/proxies/{name}), so an empty name is rejected up front with configmgmt.ErrInvalidArgument before the store source is even consulted.","triggerScenarios":"Calling the Go method GetStoreProxy(\"\") directly, or hitting the admin route with an empty name segment (URLs like /api/store/proxies/ or /api/store/proxies/%20 that decode to empty).","commonSituations":"Scripts building the URL by string concatenation with an unset variable: /api/store/proxies/$PROXY_NAME with PROXY_NAME empty; Go client code passing a struct field that was never populated.","solutions":["Pass a non-empty, exact proxy name: GET /api/store/proxies/my-tcp-proxy.","Trace where the empty name comes from (unset env var, empty JSON field) and fix the producer.","List names first with GET /api/store/proxies to confirm valid identifiers."],"exampleFix":"# before\nname=\"\"\ncurl http://127.0.0.1:7400/api/store/proxies/$name   # 400 proxy name is required\n\n# after\nname=\"ssh-tunnel\"\ncurl http://127.0.0.1:7400/api/store/proxies/$name","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(name) == \"\" {\n    return fmt.Errorf(\"proxy name must be non-empty\")\n}\np, err := mgr.GetStoreProxy(name)","typeGuard":null,"tryCatchPattern":"if _, err := mgr.GetStoreProxy(name); err != nil {\n    if errors.Is(err, configmgmt.ErrInvalidArgument) { /* fix caller: empty/bad name */ }\n    if errors.Is(err, configmgmt.ErrNotFound) { /* no such proxy */ }\n}","preventionTips":["Build URLs with net/url path segments, never string concatenation of possibly-empty vars","Guard loops: skip empty entries in name lists"],"tags":["frp","frpc","store","proxy","validation"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}