{"record":{"id":"eecc82a536c6cf62","repo":"fatedier/frp","slug":"proxy-name-s-is-already-in-use","errorCode":null,"errorMessage":"proxy name [%s] is already in use","messagePattern":"proxy name \\[(.+?)\\] is already in use","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/proxy/proxy.go","lineNumber":588,"sourceCode":"\ntype Manager struct {\n\t// proxies indexed by proxy name\n\tpxys map[string]Proxy\n\n\tmu sync.RWMutex\n}\n\nfunc NewManager() *Manager {\n\treturn &Manager{\n\t\tpxys: make(map[string]Proxy),\n\t}\n}\n\nfunc (pm *Manager) Add(name string, pxy Proxy) error {\n\tpm.mu.Lock()\n\tdefer pm.mu.Unlock()\n\tif _, ok := pm.pxys[name]; ok {\n\t\treturn fmt.Errorf(\"proxy name [%s] is already in use\", name)\n\t}\n\n\tpm.pxys[name] = pxy\n\treturn nil\n}\n\nfunc (pm *Manager) Exist(name string) bool {\n\tpm.mu.RLock()\n\tdefer pm.mu.RUnlock()\n\t_, ok := pm.pxys[name]\n\treturn ok\n}\n\nfunc (pm *Manager) Del(name string) {\n\tpm.mu.Lock()\n\tdefer pm.mu.Unlock()\n\tdelete(pm.pxys, name)\n}","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/server/proxy/proxy.go#L570-L606","documentation":"The server-side proxy Manager rejects Add() when a proxy with the same name already exists in its process-wide map. Proxy names must be unique across the whole frps instance, not just per client or per user. The error is returned while handling the client's NewProxy request, so the proxy fails to start.","triggerScenarios":"Two clients (or two proxy blocks in one client) both declare a proxy named \"web\"; a client reconnects and re-registers before the previous control's cleanup removed the old proxy; the same client config is run twice against one server.","commonSituations":"Copying a client config to a second machine without renaming proxies; running the same frpc config twice; race after an unstable connection where the stale proxy has not yet been released.","solutions":["Give every proxy a globally unique name across all clients (prefix with hostname or user)","Check for a duplicate or stale proxy with the same name in the dashboard/API and stop the other client","If it happens right after a reconnect, wait for the old control to time out or restart the conflicting frpc"],"exampleFix":"# before (two clients both use)\n[[proxies]]\nname = \"web\"\n\n# after (unique per client)\n[[proxies]]\nname = \"host1-web\"","handlingStrategy":"validation","validationCode":"// Client-side: derive a globally unique proxy name before start.\nhost, _ := os.Hostname()\nname := host + \"-\" + baseProxyName\nif seen[name] { /* refuse to start, another local proxy uses it */ }","typeGuard":null,"tryCatchPattern":"if err := pm.Add(name, pxy); err != nil {\n    if strings.Contains(err.Error(), \"already in use\") {\n        // pick a new name or surface a clear config error; retrying unchanged will fail\n    }\n}","preventionTips":["Namespace proxy names with hostname or user so they are unique server-wide","Lint client configs for duplicate names before deployment","After abnormal disconnects, expect a short window where the old name is held; use unique names rather than waiting"],"tags":["frps","proxy","naming","duplicate"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}