kubernetes/kops · error

Unable to parse Google Cloud Storage URL: %q

Error message

Unable to parse Google Cloud Storage URL: %q

What it means

buildVFSPath converts HTTPS URLs of copied assets into s3:// or gs:// VFS paths; this error fires when an https://storage.googleapis.com URL has an unexpected shape that cannot be split into bucket/object. Local and scheme-native targets are returned unchanged before this parse, so only malformed GCS HTTPS URLs hit this guard.

Source

Thrown at pkg/assets/assetcopy/copyfile.go:200

	if !strings.Contains(target, "://") || strings.HasPrefix(target, "memfs://") || strings.HasPrefix(target, "file://") ||
		strings.HasPrefix(target, "gs://") || strings.HasPrefix(target, "s3://") || strings.HasPrefix(target, "azureblob://") {
		return target, nil
	}

	var vfsPath string

	// Matches all S3 regional naming conventions:
	// https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
	// and converts to a s3://<bucket>/<path> vfsPath
	s3VfsPath, err := vfs.VFSPath(target)
	if err == nil {
		vfsPath = s3VfsPath
	} else {
		// Convert a GCS URL in the https://storage.googleapis.com/<bucket>/<path> form to the
		// equivalent gs:// vfsPath. The gs:// form itself was already passed through above.
		u, err := url.Parse(target)
		if err != nil {
			return "", fmt.Errorf("Unable to parse Google Cloud Storage URL: %q", target)
		}
		if u.Host == "storage.googleapis.com" {
			vfsPath = "gs:/" + u.Path
		}
	}

	if vfsPath == "" {
		klog.Errorf("Unable to determine VFS path from supplied URL: %s", target)
		klog.Errorf("S3, Google Cloud Storage, and File Paths are supported.")
		klog.Errorf("For S3, please make sure that the supplied file repository URL starts with s3:// or adheres to S3 naming conventions.")
		klog.Errorf("For GCS, please make sure that the supplied file repository URL starts with gs:// or https://storage.googleapis.com/")
		if err != nil { // print the S3 error for more details
			return "", fmt.Errorf("Error Details: %v", err)
		}
		return "", fmt.Errorf("unable to determine vfs type for %q", target)
	}

	return vfsPath, nil

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Use s3:// or gs:// URLs directly
  2. Fix malformed URL characters in the file repository URL
  3. Use a plain file path for local assets
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/assets/assetcopy/copyfile.go:200 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/2133428d0aaf1788. Report an issue: GitHub.