kubernetes/kops · error

S3 Endpoint is empty

Error message

S3 Endpoint is empty

What it means

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.

Source

Thrown at util/pkg/vfs/s3fs.go:720

	bytes, err := io.ReadAll(data)
	if err != nil {
		return fmt.Errorf("reading data: %v", err)
	}

	// render DO's terraform
	switch p.scheme {
	case "do":

		content, err := w.AddFileBytes("digitalocean_spaces_bucket_object", name, "content", bytes, false)
		if err != nil {
			return fmt.Errorf("error rendering DO file: %w", err)
		}

		// retrieve space region from endpoint
		endpoint := os.Getenv("S3_ENDPOINT")
		if endpoint == "" {
			return errors.New("S3 Endpoint is empty")
		}
		region := strings.Split(endpoint, ".")[0]

		tf := &terraformDOFile{
			Bucket:  p.Bucket(),
			Region:  region,
			Key:     p.Key(),
			Content: content,
		}
		return w.RenderResource("digitalocean_spaces_bucket_object", name, tf)

		// render Scaleway's Terraform objects
	case "scw":

		content, err := w.AddFileBytes("scaleway_object", name, "content", bytes, false)
		if err != nil {
			return fmt.Errorf("error rendering Scaleway file: %w", err)
		}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set S3_ENDPOINT to the Spaces endpoint whose first label is the region, e.g. ams3.digitaloceanspaces.com
  2. Verify the variable is exported in the environment running kops
  3. Confirm the bucket URL uses the do:// scheme matching a configured Spaces endpoint
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at util/pkg/vfs/s3fs.go:720 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/c6c6006caf407fdd. Report an issue: GitHub.