kubernetes/kops · error

requesting agent forwarding: %w

Error message

requesting agent forwarding: %w

What it means

Setting up SSH agent forwarding on the bastion session failed (agent.RequestAgentForwarding); the channel needed to forward the local agent through the bastion to the target node could not be opened.

Source

Thrown at pkg/dump/dumper.go:719

			if useBastion {
				err = agent.ForwardToAgent(client, f.keyRing)
				if err != nil {
					err = fmt.Errorf("forwarding ssh auth to keyring: %w", err)
				}
			}
		}

		if err == nil && useBastion {
			session, err := client.NewSession()
			if err != nil {
				finished <- fmt.Errorf("creating ssh session: %w", err)
				return
			}
			defer session.Close()

			err = agent.RequestAgentForwarding(session)
			if err != nil {
				finished <- fmt.Errorf("requesting agent forwarding: %w", err)
				return
			}
		}

		finished <- err
	}()

	select {
	case <-ctx.Done():
		klog.Infof("cancelling SSH tcp connection due to context completion")
		conn.Close() // Close the TCP connection to force cancellation
		<-finished   // Wait for cancellation
		return nil, ctx.Err()
	case err := <-finished:
		if err != nil {
			return nil, err
		}
		if !useBastion {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the SSH server on the bastion permits agent forwarding
  2. Ensure a local ssh-agent with loaded keys is available
  3. Retry the dump; transient session-setup failures occur
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/dump/dumper.go:719 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/29ac9f5d10f87612. Report an issue: GitHub.