Skip to content

Commit

Permalink
tctl: fix error reporting when server is down
Browse files Browse the repository at this point in the history
A regresion in #25780 changed text that used to be reported to
standard output to go to the logger instead. Since the logger
output is only visible when the debug flag is set, this caused
a fatal error to go unreported to the user.

Fixes #28129
  • Loading branch information
zmb3 authored and github-actions committed Jul 19, 2023
1 parent e795806 commit 76ad093
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tool/tctl/common/tctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ func TryRun(commands []CLICommand, args []string) error {
if utils.IsUntrustedCertErr(err) {
err = trace.WrapWithMessage(err, utils.SelfSignedCertsMsg)
}
log.Errorf("Cannot connect to the auth server. Is the auth server running on %q? %v",
cfg.AuthServerAddresses()[0].Addr, err)
fmt.Fprintf(os.Stderr,
"ERROR: Cannot connect to the auth server. Is the auth server running on %q?\n",
cfg.AuthServerAddresses()[0].Addr)
return trace.NewAggregate(&common.ExitCodeError{Code: 1}, err)
}

Expand Down

0 comments on commit 76ad093

Please sign in to comment.