kubernetes/kops · error

error doing HEAD on

Error message

error doing HEAD on %q: %v

What it means

hashFromHTTPHeader performs an HTTP HEAD against an asset URL to discover its checksum; the request itself failed (DNS, connection refused, 404, proxy failure), so no hash can be obtained.

Solutions

  1. Verify the URL is reachable from the machine running kOps (curl -I)
  2. Fix proxy/TLS settings if the environment blocks the request
  3. Retry — transient network failures are a common cause
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/assetstore.go:184 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/0ae4960bbd83e861. Report an issue: GitHub.

Appendix: source

Thrown at upup/pkg/fi/assetstore.go:184

		klog.Infof("    %s %s", match.Key, match.AssetPath)
	}
	return nil, fmt.Errorf("found multiple matching assets for key: %q", key)
}

// Add an asset into the store, in one of the recognized formats (see Assets in types package)
func (a *AssetStore) AddForTest(id string, path string, content string) {
	a.assets = append(a.assets, &asset{
		Key:       id,
		AssetPath: path,
		resource:  NewStringResource(content),
	})
}

func hashFromHTTPHeader(url string) (*hashing.Hash, error) {
	klog.Infof("Doing HTTP HEAD on %q", url)
	response, err := http.Head(url)
	if err != nil {
		return nil, fmt.Errorf("error doing HEAD on %q: %v", url, err)
	}
	defer response.Body.Close()

	etag := response.Header.Get("ETag")
	etag = strings.TrimSpace(etag)
	etag = strings.Trim(etag, "'\"")

	if etag != "" {
		if len(etag) == 32 {
			// Likely md5
			return hashing.HashAlgorithmMD5.FromString(etag)
		}
	}

	return nil, fmt.Errorf("unable to determine hash from HTTP HEAD: %q", url)
}

// Add an asset into the store, in one of the recognized formats (see Assets in types package)

View on GitHub (pinned to 4c8573c808)