spinnaker/spinnaker · error

Execute pipeline failed with response

Error message

Execute pipeline failed with response: %v and error: %s

What it means

This error is returned by executePipeline in the spin CLI when the Gate API call to invoke a pipeline (InvokePipelineConfig) returns a transport-level error. The CLI wraps the HTTP response body and the underlying error into a single message so the developer can see both what the server responded and why the request failed. It does not indicate the pipeline ran and failed; it means the invocation request itself did not succeed.

Solutions

  1. Check the response and error text in the message: a 404 means the application/pipeline name is wrong, a 401/403 means credentials are bad
  2. Verify connectivity to Gate: curl the configured gate endpoint's health endpoint
  3. Confirm the pipeline exists: `spin pipeline list --application <app>`
  4. Re-authenticate or refresh credentials (e.g. `spin auth` config or update ~/.spin/config)
  5. If a proxy/firewall is involved, fix proxy env vars or allowlist the Gate host

Example fix

// before: retries blindly and hides the cause
if _, err := runPipeline(app, name); err != nil {
    log.Fatal(err)
}
// after: inspect status-specific causes
if _, err := runPipeline(app, name); err != nil {
    var respErr *gate.GenericOpenAPIError
    if errors.As(err, &respErr) && strings.Contains(respErr.Error(), "404") {
        log.Fatalf("pipeline %s/%s not found in Spinnaker", app, name)
    }
    log.Fatal(err)
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Go: validate inputs and endpoint before invoking
if options.application == "" || options.name == "" {
    return errors.New("application and pipeline name are required")
}
if options.GateClient == nil {
    return errors.New("gate client not configured; check ~/.spin/config")
}

Type guard

func hasGateClient(o *executeOptions) bool { return o != nil && o.GateClient != nil && o.GateClient.Context != nil }

Try / catch

resp, err := req.Execute()
if err != nil {
    var apiErr *gate.GenericOpenAPIError
    if errors.As(err, &apiErr) {
        return fmt.Errorf("gate rejected invocation: %w (check app/name and auth)", apiErr)
    }
    return err // network-level failure
}

Prevention

When it happens

Trigger: Calling `spin pipeline execute` where the Gate client's PipelineControllerAPI.InvokePipelineConfig(...).Execute() returns a non-nil error: Gate unreachable, 401/403 auth failure, unknown application or pipeline name (404), malformed trigger payload, or TLS/network errors.

Common situations: Wrong gate endpoint or --gate-endpoint configured; expired or missing auth token; typo in application or pipeline name; pipeline config deleted in Spinnaker while the CLI script still references it; corporate proxy blocking the request.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of spinnaker/spinnaker@1d4a5d0f6d (2026-09-10). Data as JSON: /api/errors/2c407488bb630483. Report an issue: GitHub.

Appendix: source

Thrown at spin/cmd/pipeline/execute.go:114

			"type": "manual",
		},
	}
	if len(parameters) > 0 {
		trigger["trigger"]["parameters"] = parameters
	}

	if _, ok := artifactsFile["artifacts"]; ok {
		artifacts := artifactsFile["artifacts"].([]interface{})
		if len(artifacts) > 0 {
			trigger["trigger"]["artifacts"] = artifacts
		}
	}

	_, resp, err := options.GateClient.PipelineControllerAPI.InvokePipelineConfig(options.GateClient.Context,
		options.application,
		options.name).RequestBody(trigger).Execute()
	if err != nil {
		return fmt.Errorf("Execute pipeline failed with response: %v and error: %s\n", resp, err)
	}

	if resp.StatusCode != http.StatusAccepted {
		return fmt.Errorf("Encountered an error executing pipeline, status code: %d\n", resp.StatusCode)
	}

	options.Ui.Success("Pipeline execution started")

	return nil
}

View on GitHub (pinned to 1d4a5d0f6d)