hashicorp/packer · error

%q not implemented

Error message

%q not implemented

What it means

packer/plugin-getter/release/getter.go's http Getter supports only the download kinds "checksum", "meta", and "zip". Get switches on the `what` argument to build the appropriate releases.hashicorp.com URL; anything else falls into the default case and is rejected. This is a programming/API-misuse guard, not a runtime condition.

Source

Thrown at packer/plugin-getter/release/getter.go:108

		// https://releases.hashicorp.com/packer-plugin-docker/index.json
		url := filepath.ToSlash(officialReleaseURL + ghURI.PluginType() + "/index.json")
		req, err = http.NewRequest("GET", url, nil)
		transform = transformReleasesVersionStream
	case "sha256":
		// https://releases.hashicorp.com/packer-plugin-docker/8.0.0/packer-plugin-docker_1.1.1_SHA256SUMS
		url := filepath.ToSlash(officialReleaseURL + ghURI.PluginType() + "/" + opts.VersionString() + "/" + ghURI.PluginType() + "_" + opts.VersionString() + "_SHA256SUMS")
		transform = gh.TransformChecksumStream()
		req, err = http.NewRequest("GET", url, nil)
	case "meta":
		// https://releases.hashicorp.com/packer-plugin-docker/8.0.0/packer-plugin-docker_1.1.1_manifest.json
		url := filepath.ToSlash(officialReleaseURL + ghURI.PluginType() + "/" + opts.VersionString() + "/" + ghURI.PluginType() + "_" + opts.VersionString() + "_manifest.json")
		req, err = http.NewRequest("GET", url, nil)
	case "zip":
		// https://releases.hashicorp.com/packer-plugin-docker/1.1.1/packer-plugin-docker_1.1.1_darwin_arm64.zip
		url := filepath.ToSlash(officialReleaseURL + ghURI.PluginType() + "/" + opts.VersionString() + "/" + opts.ExpectedZipFilename())
		req, err = http.NewRequest("GET", url, nil)
	default:
		return nil, fmt.Errorf("%q not implemented", what)
	}

	if err != nil {
		log.Printf("[ERROR] http-getter: error creating request for %q: %s", what, err)
		return nil, err
	}

	resp, err := g.HttpClient.Do(req)
	if err != nil || resp.StatusCode >= 400 {
		log.Printf("[ERROR] Got error while trying getting data from releases.hashicorp.com, %v", err)
		return nil, plugingetter.HTTPFailure
	}

	defer func(Body io.ReadCloser) {
		err = Body.Close()
		if err != nil {
			log.Printf("[ERROR] http-getter: error closing response body: %s", err)
		}

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Use one of the supported kinds: "checksum", "meta", or "zip".
  2. Check the spelling/casing of the `what` argument against the switch in Get.
  3. If you need a new asset type, add a case to the switch in release/getter.go Get rather than passing an arbitrary string.

Example fix

// before
f, err := g.Get("sha256sum", opts)
// after
f, err := g.Get("checksum", opts)
Defensive patterns

Strategy: validation

Validate before calling

var supported = map[string]bool{"checksum": true, "meta": true, "zip": true}
if !supported[what] {
    return fmt.Errorf("unsupported download kind %q; want checksum|meta|zip", what)
}

Try / catch

if _, err := g.Get("checksum", opts); err != nil {
    if strings.Contains(err.Error(), "not implemented") {
        // fix the kind argument in code, not retryable
    }
}

Prevention

When it happens

Trigger: Calling Getter.Get (directly or via plugingetter plumbing) with a `what` value other than "checksum", "meta", or "zip", e.g. Get("sha256", opts) or a typo like Get("ziip", opts).

Common situations: Custom tooling reusing the release Getter to fetch other release assets; a newly added download kind in upstream Packer not yet handled by this switch; mistyping the kind string.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05). Data as JSON: /api/errors/19daf246cf4b9ac4. Report an issue: GitHub.