diff --git a/command/agentproxyshared/cache/handler.go b/command/agentproxyshared/cache/handler.go index c51a6b8346..d136983178 100644 --- a/command/agentproxyshared/cache/handler.go +++ b/command/agentproxyshared/cache/handler.go @@ -85,6 +85,10 @@ func ProxyHandler(ctx context.Context, logger hclog.Logger, proxier Proxier, inm logical.RespondError(w, http.StatusInternalServerError, fmt.Errorf("failed to get the response: %w", err)) } return + } else if resp == nil { + metrics.IncrCounter([]string{"agent", "proxy", "error"}, 1) + logical.RespondError(w, http.StatusInternalServerError, fmt.Errorf("failed to get the response: %w", err)) + return } err = sanitizeAutoAuthTokenResponse(ctx, logger, inmemSink, req, resp)