googleapis/mcp-toolbox · error

failed to get session: %w

Error message

failed to get session: %w

What it means

The Dataproc GetSession RPC failed for the requested session name — the session likely does not exist under the configured project/location, or the call hit permissions/connectivity issues.

Source

Thrown at internal/sources/serverlessspark/serverlessspark.go:432

	}

	sessions, err := ToSessions(sessionPbs)
	if err != nil {
		return nil, err
	}

	return ListSessionsResponse{Sessions: sessions, NextPageToken: nextPageToken}, nil
}

func (s *Source) GetSession(ctx context.Context, name string) (map[string]any, error) {
	client := s.GetSessionControllerClient()
	req := &dataprocpb.GetSessionRequest{
		Name: fmt.Sprintf("projects/%s/locations/%s/sessions/%s", s.GetProject(), s.GetLocation(), name),
	}

	sessionPb, err := client.GetSession(ctx, req)
	if err != nil {
		return nil, fmt.Errorf("failed to get session: %w", err)
	}

	jsonBytes, err := protojson.Marshal(sessionPb)
	if err != nil {
		return nil, fmt.Errorf("failed to marshal session to JSON: %w", err)
	}

	var result map[string]any
	if err := json.Unmarshal(jsonBytes, &result); err != nil {
		return nil, fmt.Errorf("failed to unmarshal session JSON: %w", err)
	}

	consoleUrl, err := SessionConsoleURLFromProto(sessionPb)
	if err != nil {
		return nil, fmt.Errorf("error generating console url: %v", err)
	}
	logsUrl, err := SessionLogsURLFromProto(sessionPb)
	if err != nil {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Confirm the session ID exists in the configured project and location
  2. Check IAM permissions and ADC validity
  3. Retry on transient API errors
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/sources/serverlessspark/serverlessspark.go:432 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/30efdd4ed7a1965b. Report an issue: GitHub.