kubernetes/kops · error

error reading %s: %v

Error message

error reading %s: %v

What it means

Returned by SwiftPath.WriteTo when initiating a Swift object download fails for a reason other than not-found (404 maps to os.ErrNotExist). The Swift GET on the object errored — auth token expired, no read permission, or a proxy failure — so there is no body to stream to the caller.

Source

Thrown at util/pkg/vfs/swiftfs.go:527

// WriteTo implements io.WriterTo
func (p *SwiftPath) WriteTo(out io.Writer) (int64, error) {
	ctx := context.TODO()

	klog.V(4).Infof("Reading file %q", p)

	client, err := p.getClient(ctx)
	if err != nil {
		return 0, err
	}

	opt := swiftobject.DownloadOpts{}
	result := swiftobject.Download(ctx, client, p.bucket, p.key, opt)
	if result.Err != nil {
		if isSwiftNotFound(result.Err) {
			return 0, os.ErrNotExist
		}
		return 0, fmt.Errorf("error reading %s: %v", p, result.Err)
	}
	defer result.Body.Close()

	return io.Copy(out, result.Body)
}

func (p *SwiftPath) readPath(opt swiftobject.ListOpts) ([]Path, error) {
	ctx := context.TODO()

	var ret []Path
	done, err := RetryWithBackoff(swiftReadBackoff, func() (bool, error) {
		client, err := p.getClient(ctx)
		if err != nil {
			return false, err
		}

		var paths []Path
		pager := swiftobject.List(client, p.bucket, opt)

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify read access to the object's container
  2. Re-authenticate: expired tokens surface as 401 on the download call
  3. Retry on transient proxy errors; Swift clusters commonly rate-limit GETs
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at util/pkg/vfs/swiftfs.go:527 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/6f3c49b90b7f8e40. Report an issue: GitHub.