What happens
On hc auth login, fetchRegistryURL (cmd/auth/login.go) calls
GET {apiURL}/gateway/har/api/v3/system/info?accountIdentifier=<accountId>
to populate RegistryURL. For an account with no HAR (Artifact Registry)
license, this endpoint returns:
{"message":"license not found."}
Instead of surfacing that, login.go swallows it into a generic
Warning: Failed to fetch registry URL: ..., saves RegistryURL: "" to
~/.harness/auth.json anyway, and reports login as successful.
Then on every subsequent hc invocation — regardless of command — a
startup check re-reads the saved empty RegistryURL and reprints:
RegistryURL missing , Please logout and login again
This happens even for commands that have nothing to do with registries
(hc version, hc auth status, hc help).
Why this is misleading
"Please logout and login again" is actively bad advice here: the root
cause is that the account has no HAR license, so logging out and back in
reproduces the exact same warning every time, with no path to actually
clear it short of licensing HAR. The message gives no indication that a
licensing issue, rather than a stale session, is the actual cause.
Suggested fix
- Surface the real upstream error (e.g. "license not found") instead of
a generic "missing" message, so a user isn't sent looking for an auth
problem that doesn't exist.
- Don't suggest logging out/in when the root cause isn't session-related.
- Consider only checking/warning about
RegistryURL for subcommands that
actually need it (registry/artifact/pkgmgr), rather than on every
invocation at startup.
Repro
On an account with no HAR license: hc auth login (succeeds, with the
warning), then run any other command, e.g. hc version — the same
warning reprints unconditionally.
Version
hc version 1.3.43, built with go1.25.0
What happens
On
hc auth login,fetchRegistryURL(cmd/auth/login.go) callsGET {apiURL}/gateway/har/api/v3/system/info?accountIdentifier=<accountId>to populate
RegistryURL. For an account with no HAR (Artifact Registry)license, this endpoint returns:
Instead of surfacing that, login.go swallows it into a generic
Warning: Failed to fetch registry URL: ..., savesRegistryURL: ""to~/.harness/auth.jsonanyway, and reports login as successful.Then on every subsequent
hcinvocation — regardless of command — astartup check re-reads the saved empty
RegistryURLand reprints:This happens even for commands that have nothing to do with registries
(
hc version,hc auth status,hc help).Why this is misleading
"Please logout and login again" is actively bad advice here: the root
cause is that the account has no HAR license, so logging out and back in
reproduces the exact same warning every time, with no path to actually
clear it short of licensing HAR. The message gives no indication that a
licensing issue, rather than a stale session, is the actual cause.
Suggested fix
a generic "missing" message, so a user isn't sent looking for an auth
problem that doesn't exist.
RegistryURLfor subcommands thatactually need it (
registry/artifact/pkgmgr), rather than on everyinvocation at startup.
Repro
On an account with no HAR license:
hc auth login(succeeds, with thewarning), then run any other command, e.g.
hc version— the samewarning reprints unconditionally.
Version
hc version 1.3.43, built with go1.25.0