From 9bdd8e5b093bc7070f067c11d30f9e187c768125 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Mon, 27 Mar 2023 15:17:54 +0000 Subject: [PATCH 1/2] fix: remove excess newlines from server startup --- cli/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/server.go b/cli/server.go index 28c57f5580132..da84b8ded0bc7 100644 --- a/cli/server.go +++ b/cli/server.go @@ -484,7 +484,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd. tunnelDone <-chan struct{} = make(chan struct{}, 1) ) if cfg.AccessURL.String() == "" { - cliui.Infof(inv.Stderr, "Opening tunnel so workspaces can connect to your deployment. For production scenarios, specify an external access URL\n") + cliui.Infof(inv.Stderr, "Opening tunnel so workspaces can connect to your deployment. For production scenarios, specify an external access URL") tunnel, err = devtunnel.New(ctx, logger.Named("devtunnel"), cfg.WgtunnelHost.String()) if err != nil { return xerrors.Errorf("create tunnel: %w", err) @@ -531,7 +531,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd. } // A newline is added before for visibility in terminal output. - cliui.Infof(inv.Stdout, "\nView the Web UI: %s\n", cfg.AccessURL.String()) + cliui.Infof(inv.Stdout, "\nView the Web UI: %s", cfg.AccessURL.String()) // Used for zero-trust instance identity with Google Cloud. googleTokenValidator, err := idtoken.NewValidator(ctx, option.WithoutAuthentication()) From e8a8fb62282b482d400a60f687f9743dd97d9cc4 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Mon, 27 Mar 2023 15:56:45 +0000 Subject: [PATCH 2/2] Don't log benign closed pipe errors --- coderd/workspaceagents.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index 6fa5118345bee..1d4290f485145 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -774,7 +774,11 @@ func (api *API) dialWorkspaceAgentTailnet(agentID uuid.UUID) (*codersdk.Workspac go func() { err := (*api.TailnetCoordinator.Load()).ServeClient(serverConn, uuid.New(), agentID) if err != nil { - api.Logger.Warn(ctx, "tailnet coordinator client error", slog.Error(err)) + // Sometimes, we get benign closed pipe errors when the server is + // shutting down. + if api.ctx.Err() == nil { + api.Logger.Warn(ctx, "tailnet coordinator client error", slog.Error(err)) + } _ = agentConn.Close() } }()