{"record":{"id":"5290cc1a76ae4178","repo":"kubernetes/kops","slug":"error-rendering-scaleway-file-w","errorCode":null,"errorMessage":"error rendering Scaleway file: %w","messagePattern":"error rendering Scaleway file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/s3fs.go","lineNumber":737,"sourceCode":"\t\tif endpoint == \"\" {\n\t\t\treturn errors.New(\"S3 Endpoint is empty\")\n\t\t}\n\t\tregion := strings.Split(endpoint, \".\")[0]\n\n\t\ttf := &terraformDOFile{\n\t\t\tBucket:  p.Bucket(),\n\t\t\tRegion:  region,\n\t\t\tKey:     p.Key(),\n\t\t\tContent: content,\n\t\t}\n\t\treturn w.RenderResource(\"digitalocean_spaces_bucket_object\", name, tf)\n\n\t\t// render Scaleway's Terraform objects\n\tcase \"scw\":\n\n\t\tcontent, err := w.AddFileBytes(\"scaleway_object\", name, \"content\", bytes, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error rendering Scaleway file: %w\", err)\n\t\t}\n\n\t\ttf := terraformScwFile{\n\t\t\tBucket:  p.Bucket(),\n\t\t\tKey:     p.Key(),\n\t\t\tContent: content,\n\t\t}\n\t\treturn w.RenderResource(\"scaleway_object\", name, tf)\n\n\tdefault:\n\t\tbucketDetails, err := p.getBucketDetails(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ttfProviderArguments := map[string]string{\n\t\t\t\"region\": bucketDetails.region,\n\t\t}","sourceCodeStart":719,"sourceCodeEnd":755,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/s3fs.go#L719-L755","documentation":"This error is returned by S3Path.RenderTerraform in util/pkg/vfs/s3fs.go when the TerraformWriter fails while registering a Scaleway object-storage file resource (scaleway_object) during kops' terraform rendering. AddFileBytes hashes/records the file bytes for the terraform output; any failure there (typically I/O or writer-state problems) is wrapped with this message. It only fires for vfs paths whose scheme is 'scw'.","triggerScenarios":"Calling RenderTerraform on an S3Path created with scheme 'scw' (e.g. a state store or cluster manifest location using scw://) where w.AddFileBytes(\"scaleway_object\", name, \"content\", bytes, false) returns an error — e.g. the underlying terraform writer fails to buffer/hash the file content.","commonSituations":"Running `kops update cluster --target=terraform` with a Scaleway-compatible S3 endpoint; misconfigured VFS state store; terraform output directory not writable causing the writer to fail while adding the file bytes.","solutions":["Check the wrapped cause (%w) for the real failure — usually a filesystem or terraform-writer error, not a Scaleway API error","Ensure the --out terraform directory exists and is writable","Verify the state store path really uses the scw scheme intentionally; if you meant AWS S3, fix the cluster config so the default (aws) branch is used","Re-run with --v=2 or higher logging to see the underlying AddFileBytes failure"],"exampleFix":"// before\ncontent, err := w.AddFileBytes(\"scaleway_object\", name, \"content\", bytes, false)\nif err != nil {\n\treturn fmt.Errorf(\"error rendering Scaleway file: %w\", err)\n}\n// after\n// inspect the wrapped error to find the real cause:\ncontent, err := w.AddFileBytes(\"scaleway_object\", name, \"content\", bytes, false)\nif err != nil {\n\treturn fmt.Errorf(\"error rendering Scaleway file: %w\", err) // log err with %+v to see the root cause\n}","handlingStrategy":"validation","validationCode":"// before rendering, ensure the terraform output dir is writable\nif info, err := os.Stat(outDir); err != nil || !info.IsDir() {\n\tos.MkdirAll(outDir, 0o755)\n}","typeGuard":null,"tryCatchPattern":"if err := p.RenderTerraform(w, name, data, acl); err != nil {\n\tvar wrapped error\n\tif errors.Unwrap(err) != nil { wrapped = errors.Unwrap(err) }\n\treturn fmt.Errorf(\"scaleway terraform render failed (cause: %v): %w\", wrapped, err)\n}","preventionTips":["Confirm the state store scheme is intentionally 'scw' before running --target=terraform","Pre-create and chmod the terraform output directory","Check disk space before large terraform renders","Read errors.Unwrap output to find the true root cause"],"tags":["terraform","scaleway","vfs","object-storage"],"backgroundTag":"terraform-render-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}