cloudflare/cloudflared · error
error parsing tunnel ID
Error message
error parsing tunnel ID
What it means
`cloudflared tunnel info` resolves its single argument (ID or name) to a tunnel UUID via sc.findID. If the argument is neither a valid UUID nor an existing tunnel name, the error is wrapped as 'error parsing tunnel ID'.
Source
Thrown at cmd/cloudflared/tunnel/subcommands.go:539
CustomHelpTemplate: commandHelpTemplate(),
}
}
func tunnelInfo(c *cli.Context) error {
sc, err := newSubcommandContext(c)
if err != nil {
return err
}
warningChecker := updater.StartWarningCheck(c)
defer warningChecker.LogWarningIfAny(sc.log)
if c.NArg() != 1 {
return cliutil.UsageError(`"cloudflared tunnel info" accepts exactly one argument, the ID or name of the tunnel to get info about.`)
}
tunnelID, err := sc.findID(c.Args().First())
if err != nil {
return errors.Wrap(err, "error parsing tunnel ID")
}
client, err := sc.client()
if err != nil {
return err
}
clients, err := client.ListActiveClients(tunnelID)
if err != nil {
return err
}
sortBy := c.String("sort-by")
invalidSortField := false
sort.Slice(clients, func(i, j int) bool {
cmp := func() bool {
switch sortBy {
case "id":View on GitHub (pinned to 2253eeeb25)
Solutions
- Confirm the exact tunnel name/ID with `cloudflared tunnel list` and retry
- If using a name, re-authenticate (`cloudflared tunnel login`) so the lookup API works
- If using a UUID, verify it is a complete 8-4-4-4-12 hex string
- Check for typos, extra spaces, or wrong credentials-file paths in the argument
Example fix
// before cloudflared tunnel info prod-tunel # typo, not found // after cloudflared tunnel list && cloudflared tunnel info prod-tunnel
Defensive patterns
Strategy: validation
Validate before calling
// resolve name-or-id yourself before calling info:
var tunnelID uuid.UUID
if id, err := uuid.Parse(arg); err == nil {
tunnelID = id
} else {
tunnelID, err = lookupIDByName(arg) // requires valid cert.pem
if err != nil { return err }
} Type guard
func isTunnelUUID(v string) bool {
_, err := uuid.Parse(strings.TrimSpace(v))
return err == nil
} Try / catch
tunnelID, err := sc.findID(c.Args().First())
if err != nil {
return fmt.Errorf("error parsing tunnel ID: %w", err)
} Prevention
- Verify the tunnel name exists with `cloudflared tunnel list` before info
- Ensure cert.pem exists when resolving by name
- Favor UUIDs in automation scripts to skip name resolution
- Quote arguments to prevent shell word-splitting
When it happens
Trigger: Running `cloudflared tunnel info <arg>` with a typo'd tunnel name, a name that doesn't exist in the account, or a malformed UUID — anything for which findID cannot produce a uuid.UUID.
Common situations: Passing a deleted tunnel's name; case-sensitivity/typo in tunnel names; passing the credentials file name instead of the tunnel name; unauthenticated context so the name lookup fails.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- ErrInvalidTunnelID
- Couldn't parse UUID from %s
- failed to create tunnel
- %s is not a valid tunnel ID
- you cannot use UUIDs as tunnel names
AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06).
Data as JSON: /api/errors/bf821df8a921b174.
Report an issue: GitHub.