jaegertracing/jaeger · error

failed to get services: %w

Error message

failed to get services: %w

What it means

The get_services MCP tool handler fetches the full service list via queryService.GetServices(ctx). Any error from the query service/storage is wrapped with "failed to get services". It signals a backend availability or configuration problem, independent of the tool input.

Source

Thrown at cmd/jaeger/internal/extension/jaegerquery/internal/mcptools/internal/handlers/get_services.go:50

func NewGetServicesHandler(
	queryService *querysvc.QueryService,
) mcp.ToolHandlerFor[types.GetServicesInput, types.GetServicesOutput] {
	h := &getServicesHandler{
		queryService: queryService,
	}
	return h.handle
}

// handle processes the get_services tool request.
func (h *getServicesHandler) handle(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input types.GetServicesInput,
) (*mcp.CallToolResult, types.GetServicesOutput, error) {
	// Get all services from storage
	services, err := h.queryService.GetServices(ctx)
	if err != nil {
		return nil, types.GetServicesOutput{}, fmt.Errorf("failed to get services: %w", err)
	}

	// Apply pattern filter if provided
	if input.Pattern != "" {
		re, err := regexp.Compile(input.Pattern)
		if err != nil {
			return nil, types.GetServicesOutput{}, fmt.Errorf("invalid pattern: %w", err)
		}

		filtered := make([]string, 0, len(services))
		for _, service := range services {
			if re.MatchString(service) {
				filtered = append(filtered, service)
			}
		}
		services = filtered
	}

View on GitHub (pinned to 806f444784)

Solutions

  1. Read the wrapped error and jaeger-query logs to identify the storage failure.
  2. Verify storage connectivity and credentials for jaeger-query.
  3. Confirm the storage backend has ingested at least some spans (services list derives from stored data).
  4. Retry the request once the backend is healthy.
Defensive patterns

Strategy: try-catch

Try / catch

out, _, err := handler.Handle(ctx, req, input)
if err != nil && strings.Contains(err.Error(), "failed to get services") {
	if !storageHealthy(ctx) { // probe query API /storage endpoint first
		return retryAfterBackoff()
	}
	return fmt.Errorf("get_services failed: %w", err)
}

Prevention

When it happens

Trigger: Calling get_services when storage is down, the service-names index/collection is missing in the backend, credentials are wrong, or the context times out during the storage query.

Common situations: Fresh Elasticsearch index not yet populated; Cassandra connectivity failure; expired storage credentials; remote storage adapter misconfiguration in jaeger-query.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/1d8b345d85eef2a0. Report an issue: GitHub.