#22116·meshery

[Server] Connections endpoint masks provider HTTP statuses as 500

Author: maverickaayushCreated Sep 27, 2026Updated Sep 28, 2026

Description

GET /api/integrations/connections converts every provider failure into HTTP 500 instead of preserving the provider's HTTP status. This differs from neighboring handlers and prevents clients from distinguishing service unavailability, authorization/session failures, and other provider responses.

Current Behavior

When the provider returns an error carrying HTTP 503, GetConnections responds with HTTP 500 and replaces the provider error with ErrQueryGet.

Expected Behavior

The handler should use the provider-derived status, consistent with the other connection/environment handlers that call providerStatus(err).

Steps to Reproduce

  1. Invoke GetConnections with a provider stub whose GetConnections returns an error tagged with HTTP 503.
  2. Record the response.
  3. Observe status 500 rather than 503.

Evidence

$ go test ./server/handlers -run '^TestReproGetConnectionsPropagatesRemoteProviderStatus$' -count=1
status = 500, want provider status 503
FAIL

Root Cause

GetConnections discards err when building the response and hard-codes http.StatusInternalServerError. Nearby handlers retain the provider error and use providerStatus(err).

Affected Components

  • Meshery Server
  • Connections REST API
  • Remote/local provider error propagation

Validation

Executed on master commit 5b75615243e92b088b4ebf6e7bff82d6f60e5462:

go test ./server/handlers -run '^TestReproGetConnectionsPropagatesRemoteProviderStatus$' -count=1

Result: deterministic failure; a tagged 503 is emitted as 500.

Acceptance Criteria

  • Provider failures retain the appropriate HTTP status through GetConnections.
  • The response preserves a useful wrapped cause rather than replacing it with a cause-free query error.
  • Regression tests cover at least one non-500 provider status.

References