Skip to content

Bare-name commands fail "An item with the same key has already been added. Key: host" on a multi-port tunnel #641

@joetossell

Description

@joetossell

Summary

Once a tunnel has more than one port, every bare-name devtunnel command that targets it
by its short id fails with:

An item with the same key has already been added. Key: host

Passing the cluster-qualified id (<id>.<cluster>) makes the identical command succeed.
This is independent of how many clusters the id exists in — it reproduces with the tunnel
in a single cluster.

Environment

  • devtunnel CLI 1.0.1824+9e602bae78
  • Linux x64 (also seen interactively)
  • Microsoft Entra ID auth

Repro

devtunnel create my-tunnel                                   # lands in nearest cluster, e.g. uks1
devtunnel port create my-tunnel.uks1 -p 3000 --protocol http
devtunnel port create my-tunnel.uks1 -p 8080 --protocol https

devtunnel list | grep my-tunnel                              # single copy, two ports

devtunnel host        my-tunnel         # -> An item with the same key has already been added. Key: host
devtunnel show        my-tunnel --json  # -> same
devtunnel access list my-tunnel --json  # -> same

devtunnel host        my-tunnel.uks1        # hosts cleanly
devtunnel show        my-tunnel.uks1 --json # ok
devtunnel access list my-tunnel.uks1 --json # ok

Deterministic: bare crashes, qualified succeeds, across host, show, and access list.

Impact

Any tooling that drives devtunnel by bare id cannot host or query a tunnel that exposes
two or more ports, and the error gives no hint that qualifying the id is the workaround.

Expected

Bare-name resolution should behave the same as the cluster-qualified form for a tunnel
that resolves unambiguously, regardless of port count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions