cilium/cilium · error

failed to submit SPIRE entries task for %q: %w

Error message

failed to submit SPIRE entries task for %q: %w

What it means

This error wraps a failure returned while scheduling a worker-pool task in cilium-cli's sysdump collector that collects SPIRE server 'entries' output for a given pod. It is thrown by SubmitSpireEntriesSubtask when the submitted task function (which runs 'spire-server entry list'-style collection via WithFileSink and pod exec) returns an error. The %q is the pod name; the wrapped %w error is the underlying collection failure.

Source

Thrown at cilium-cli/sysdump/sysdump.go:2701

				return fmt.Errorf("failed to pick exec target: %w", err)
			}
			defer func() {
				err := cleanupFunc(ctx)
				if err != nil {
					c.logWarn("Failed to clean up exec target: %v", err)
				}
			}()

			command := []string{"/opt/spire/bin/spire-server", "entry", "show", "-output", "json"}
			if err := c.WithFileSink(fmt.Sprintf(ciliumSPIREServerEntriesFileName, p.Name), func(out io.Writer) error {
				return c.Client.ExecInPodWithWriters(ctx, nil, p.Namespace, p.Name, containerName, command, out, k8s.StderrAsError)
			}); err != nil {
				return fmt.Errorf("failed to collect 'spire-server' output for %q in namespace %q: %w", p.Name, p.Namespace, err)
			}

			return nil
		}); err != nil {
			return fmt.Errorf("failed to submit SPIRE entries task for %q: %w", p.Name, err)
		}
	}
	return nil
}

func extractGopsPID(output string) (string, error) {
	for entry := range strings.SplitSeq(output, "\n") {
		match := gopsRegexp.FindStringSubmatch(entry)
		if len(match) > 0 {
			result := make(map[string]string)
			for i, name := range gopsRegexp.SubexpNames() {
				if i != 0 && name != "" {
					result[name] = match[i]
				}
			}
			return result["pid"], nil
		}
	}

View on GitHub (pinned to ac7b90affa)

Solutions

  1. Inspect the wrapped cause (%w) to find the real failure (exec error, sink write error) and fix that first
  2. Verify the SPIRE server pod is Running and its container name matches what the sysdump expects
  3. Re-run 'cilium-cli sysdump' with retries or after the cluster stabilizes
  4. Ensure kubectl-style exec is permitted in the namespace (admission policies, RBAC pods/exec)

Example fix

// before: collection task fails inside submit
return fmt.Errorf("failed to submit SPIRE entries task for %q: %w", p.Name, err)
// after: guard pod readiness before submitting
if p.Status.Phase != corev1.PodRunning || p.DeletionTimestamp != nil {
    log.Printf("skipping SPIRE entries for non-running pod %s", p.Name)
    continue
}
if err := c.Pool.Submit(...); err != nil {
    return fmt.Errorf("failed to submit SPIRE entries task for %q: %w", p.Name, err)
}
Defensive patterns

Strategy: try-catch

Validate before calling

for _, p := range spirePods {
    if p.Status.Phase != corev1.PodRunning || p.DeletionTimestamp != nil {
        fmt.Printf("skipping SPIRE pod %s (phase=%s)\n", p.Name, p.Status.Phase)
    }
}

Type guard

func spireServerReady(p *corev1.Pod) bool {
    return p != nil && p.Status.Phase == corev1.PodRunning && p.DeletionTimestamp == nil
}

Try / catch

if err := collector.SubmitSpireEntriesSubtask(ctx, pods); err != nil {
    var wrapped interface{ Unwrap() error }
    if errors.As(err, &target) { log.Printf("root cause: %v", target) }
    // non-fatal: continue collecting the rest of the sysdump
}

Prevention

When it happens

Trigger: Collector.SubmitSpireEntriesSubtask iterates SPIRE server pods and calls c.Pool.Submit for each; the inner task errors (e.g. ExecInPodWithWriters on the spire-server container fails) and the returned error is wrapped with the pod name.

Common situations: SPIRE server pod is terminating/restarting during sysdump; container name mismatch; exec denied by PodSecurity or missing tty support; cluster connectivity dropped mid-collection.

Related errors


AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31). Data as JSON: /api/errors/b73a92ed0ac4e489. Report an issue: GitHub.