{"record":{"id":"6c8e6a1d43e2c3a0","repo":"kubernetes/kops","slug":"error-writing-s-v-6c8e6a","errorCode":null,"errorMessage":"error writing %s: %v","messagePattern":"error writing (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/swiftfs.go","lineNumber":399,"sourceCode":"\t\tkey:        joined,\n\t}\n}\n\nfunc (p *SwiftPath) WriteFile(ctx context.Context, data io.ReadSeeker, acl ACL) error {\n\tdone, err := RetryWithBackoff(swiftWriteBackoff, func() (bool, error) {\n\t\tclient, err := p.getClient(ctx)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tklog.V(4).Infof(\"Writing file %q\", p)\n\t\tif _, err := data.Seek(0, 0); err != nil {\n\t\t\treturn false, fmt.Errorf(\"error seeking to start of data stream for %s: %v\", p, err)\n\t\t}\n\n\t\tcreateOpts := swiftobject.CreateOpts{Content: data}\n\t\tif _, err := swiftobject.Create(ctx, client, p.bucket, p.key, createOpts).Extract(); err != nil {\n\t\t\treturn false, fmt.Errorf(\"error writing %s: %v\", p, err)\n\t\t}\n\n\t\treturn true, nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t} else if done {\n\t\treturn nil\n\t} else {\n\t\t// Shouldn't happen - we always return a non-nil error with false.\n\t\treturn wait.ErrWaitTimeout\n\t}\n}\n\n// To prevent concurrent creates on the same file while maintaining atomicity of writes,\n// we take a process-wide lock during the operation.\n// Not a great approach, but fine for a single process (with low concurrency).\n// TODO: should we enable versioning?","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/swiftfs.go#L381-L417","documentation":"Returned inside SwiftPath.WriteFile's retry loop when the Swift object create (upload) call fails other than with not-found. The object storage rejected the write — auth expiry, container permissions, quota, or a transient proxy 5xx — and RetryWithBackoff re-attempts the upload with swiftWriteBackoff timing.","triggerScenarios":"Thrown at util/pkg/vfs/swiftfs.go:399 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify container write permissions and account quota","Allow the backoff loop to handle transient proxy errors; inspect the wrapped error if retries exhaust","Re-seek the data stream before retrying, since each attempt reads it from the start"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}