{"record":{"id":"c6c6006caf407fdd","repo":"kubernetes/kops","slug":"s3-endpoint-is-empty","errorCode":null,"errorMessage":"S3 Endpoint is empty","messagePattern":"S3 Endpoint is empty","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/s3fs.go","lineNumber":720,"sourceCode":"\n\tbytes, err := io.ReadAll(data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading data: %v\", err)\n\t}\n\n\t// render DO's terraform\n\tswitch p.scheme {\n\tcase \"do\":\n\n\t\tcontent, err := w.AddFileBytes(\"digitalocean_spaces_bucket_object\", name, \"content\", bytes, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error rendering DO file: %w\", err)\n\t\t}\n\n\t\t// retrieve space region from endpoint\n\t\tendpoint := os.Getenv(\"S3_ENDPOINT\")\n\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}","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/s3fs.go#L702-L738","documentation":"While rendering Terraform for a DigitalOcean Spaces (do://) bucket object, the code derives the bucket region from the S3_ENDPOINT environment variable. This guard fires when S3_ENDPOINT is unset or empty, so the region cannot be inferred and Terraform rendering aborts.","triggerScenarios":"Thrown at util/pkg/vfs/s3fs.go:720 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set S3_ENDPOINT to the Spaces endpoint whose first label is the region, e.g. ams3.digitaloceanspaces.com","Verify the variable is exported in the environment running kops","Confirm the bucket URL uses the do:// scheme matching a configured Spaces endpoint"],"exampleFix":null,"handlingStrategy":"validation","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-12T07:17:12.445Z"}