{"record":{"id":"29d09d5d4cbf14a9","repo":"cloudflare/cloudflared","slug":"s-is-not-a-valid-client-id-must-be-a-uuid","errorCode":null,"errorMessage":"%s is not a valid client ID (must be a UUID)","messagePattern":"(.+?) is not a valid client ID \\(must be a UUID\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/subcommand_context.go","lineNumber":295,"sourceCode":"\nfunc (sc *subcommandContext) runWithCredentials(credentials connection.Credentials) error {\n\tsc.log.Info().Str(LogFieldTunnelID, credentials.TunnelID.String()).Msg(\"Starting tunnel\")\n\n\treturn StartServer(\n\t\tsc.c,\n\t\tbuildInfo,\n\t\t&connection.TunnelProperties{Credentials: credentials},\n\t\tsc.log,\n\t)\n}\n\nfunc (sc *subcommandContext) cleanupConnections(tunnelIDs []uuid.UUID) error {\n\tparams := cfapi.NewCleanupParams()\n\textraLog := \"\"\n\tif connector := sc.c.String(\"connector-id\"); connector != \"\" {\n\t\tconnectorID, err := uuid.Parse(connector)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"%s is not a valid client ID (must be a UUID)\", connector)\n\t\t}\n\t\tparams.ForClient(connectorID)\n\t\textraLog = fmt.Sprintf(\" for connector-id %s\", connectorID.String())\n\t}\n\n\tclient, err := sc.client()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, tunnelID := range tunnelIDs {\n\t\tsc.log.Info().Msgf(\"Cleanup connection for tunnel %s%s\", tunnelID, extraLog)\n\t\tif err := client.CleanupConnections(tunnelID, params); err != nil {\n\t\t\tsc.log.Error().Msgf(\"Error cleaning up connections for tunnel %v, error :%v\", tunnelID, err)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/subcommand_context.go#L277-L313","documentation":"cloudflared validates the --connector-id flag with uuid.Parse before issuing a cleanup-connections request. If the value is not a syntactically valid UUID the command aborts with this wrapped parse error. It is a pure client-side input validation failure; no API call is made.","triggerScenarios":"`cloudflared tunnel cleanup <tunnel-id> --connector-id <value>` where <value> is not a valid UUID string (typo, truncated ID, bare connector name, extra whitespace).","commonSituations":"Copying a connector ID from logs with surrounding text; passing a connector *name* instead of its UUID; hand-typing the UUID and dropping characters; shell interpolation expanding to empty string.","solutions":["Get the exact connector UUID from `cloudflared tunnel info <tunnel-id>` output and pass it verbatim","Quote the flag value to prevent shell mangling: --connector-id=\"<uuid>\"","Check for typos/truncation — a UUID is 36 chars, 8-4-4-4-12 hex digits","Omit --connector-id entirely if you want to clean up connections for all connectors"],"exampleFix":"// before\ncloudflared tunnel cleanup 6ff42ae2-765d-4adf-8112-afc330cba951 --connector-id my-laptop\n// after\ncloudflared tunnel cleanup 6ff42ae2-765d-4adf-8112-afc330cba951 --connector-id 1e3b1f6a-8f2c-4d09-9e88-3fa2b7c9d4a1","handlingStrategy":"validation","validationCode":"func validUUID(s string) bool {\n    _, err := uuid.Parse(strings.TrimSpace(s))\n    return err == nil\n}\nif !validUUID(connectorID) { return errors.New(\"--connector-id must be a UUID\") }","typeGuard":"func isUUIDString(s string) bool {\n    var id uuid.UUID\n    return uuid.Parse(s, &id) == nil // or: uuid.Validate(s) == nil\n}","tryCatchPattern":"connectorID, err := uuid.Parse(flagValue)\nif err != nil {\n    return fmt.Errorf(\"--connector-id %q is not a valid UUID: %w\", flagValue, err)\n}","preventionTips":["Copy connector UUIDs from `cloudflared tunnel info` output, not from logs with decorations","Quote flag values in shell scripts to avoid mangling","Validate UUID format in wrappers before invoking cloudflared","Omit --connector-id to target all connectors when you don't have a specific UUID"],"tags":["go","cli","uuid","input-validation"],"backgroundTag":"invalid-identifier-format","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}