{"record":{"id":"d8c5ffcff97f5216","repo":"fatedier/frp","slug":"new-proxy-configurer-error","errorCode":null,"errorMessage":"new proxy configurer error","messagePattern":"new proxy configurer error","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/ssh/server.go","lineNumber":280,"sourceCode":"\tcmd := &cobra.Command{\n\t\tUse:   \"ssh v0@{address} [command]\",\n\t\tShort: \"ssh v0@{address} [command]\",\n\t\tRun:   func(*cobra.Command, []string) {},\n\t}\n\tcmd.SetGlobalNormalizationFunc(config.WordSepNormalizeFunc)\n\n\targs := strings.Split(extraPayload, \" \")\n\tif len(args) < 1 {\n\t\treturn nil, nil, helpMessage, fmt.Errorf(\"invalid extra payload\")\n\t}\n\tproxyType := strings.TrimSpace(args[0])\n\tsupportTypes := []string{\"tcp\", \"http\", \"https\", \"tcpmux\", \"stcp\"}\n\tif !slices.Contains(supportTypes, proxyType) {\n\t\treturn nil, nil, helpMessage, fmt.Errorf(\"invalid proxy type: %s, support types: %v\", proxyType, supportTypes)\n\t}\n\tpc := v1.NewProxyConfigurerByType(v1.ProxyType(proxyType))\n\tif pc == nil {\n\t\treturn nil, nil, helpMessage, fmt.Errorf(\"new proxy configurer error\")\n\t}\n\tconfig.RegisterProxyFlags(cmd, pc, config.WithSSHMode())\n\n\tclientCfg := v1.ClientCommonConfig{}\n\tconfig.RegisterClientCommonConfigFlags(cmd, &clientCfg, config.WithSSHMode())\n\n\tcmd.InitDefaultHelpCmd()\n\tif err := cmd.ParseFlags(args); err != nil {\n\t\tif errors.Is(err, flag.ErrHelp) {\n\t\t\thelpMessage = cmd.UsageString()\n\t\t}\n\t\treturn nil, nil, helpMessage, err\n\t}\n\t// if name is not set, generate a random one\n\tif pc.GetBaseConfig().Name == \"\" {\n\t\tid, err := util.RandIDWithLen(8)\n\t\tif err != nil {\n\t\t\treturn nil, nil, helpMessage, fmt.Errorf(\"generate random id error: %v\", err)","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/ssh/server.go#L262-L298","documentation":"Emitted when v1.NewProxyConfigurerByType returns nil for the requested proxy type. Because the type string was already validated against the supported list (tcp/http/https/tcpmux/stcp) immediately before, every accepted value has a registered configurer; this branch is defensive dead code guarding against the supported-types list and the registry drifting apart.","triggerScenarios":"Only reachable if the supportTypes slice and NewProxyConfigurerByType's registry become inconsistent (e.g. a fork adds a type to supportTypes without registering a configurer, or a new core proxy type is added without updating the SSH allowlist).","commonSituations":"Custom frp forks or downstream patches; effectively never in upstream releases.","solutions":["If maintaining a fork, ensure every entry in supportTypes has a corresponding entry in v1's proxy configurer registry.","In upstream builds, treat this as an internal invariant failure — report the frps/client version pair in a bug report."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Upstream builds cannot hit this — no runtime defense needed.","Fork maintainers: keep the supportTypes slice in sync with v1's proxy configurer registry (add a unit test asserting NewProxyConfigurerByType != nil for every entry)."],"tags":["ssh","dead-code","internal-invariant"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}