pulumi/pulumi · error

invalid plugin version %s: %w

Error message

invalid plugin version %s: %w

What it means

After successfully decoding the GitLab release JSON, the tag_name must be parseable as a semver (tolerantly, e.g. with a leading v). This error is thrown when the release tag is not a valid semantic version, so the SDK cannot order/compare plugin versions.

Source

Thrown at sdk/go/common/workspace/plugins.go:328

	if err != nil {
		return nil, err
	}
	resp, length, err := getHTTPResponse(req)
	if err != nil {
		return nil, err
	}
	defer contract.IgnoreClose(resp)

	var release struct {
		TagName string `json:"tag_name"`
	}
	if err = json.NewDecoder(resp).Decode(&release); err != nil {
		return nil, fmt.Errorf("cannot decode gitlab response len(%d): %w", length, err)
	}

	parsedVersion, err := semver.ParseTolerant(release.TagName)
	if err != nil {
		return nil, fmt.Errorf("invalid plugin version %s: %w", release.TagName, err)
	}
	return &parsedVersion, nil
}

func (source *gitlabSource) Download(
	ctx context.Context,
	version semver.Version, opSy string, arch string,
	getHTTPResponse func(*http.Request) (io.ReadCloser, int64, error),
) (io.ReadCloser, int64, error) {
	assetName := standardAssetName(source.name, source.kind, version, opSy, arch)

	assetURL := fmt.Sprintf(
		"https://%s/api/v4/projects/%s/releases/v%s/downloads/%s",
		source.host, source.project, version, assetName)
	logging.V(1).Infof("%s downloading from %s", source.name, assetURL)

	req, err := source.newHTTPRequest(ctx, assetURL, "application/octet-stream")
	if err != nil {

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Re-tag the latest GitLab release with a valid semver (e.g. v1.2.3 or 1.2.3)
  2. If an older valid release exists, pin/install that version instead
  3. Check which release is "latest" on the GitLab project and fix its tag

Example fix

// before (git tag)
release-2024-01
// after
dv1.2.3
Defensive patterns

Strategy: validation

Validate before calling

if _, err := semver.ParseTolerant(strings.TrimPrefix(tag, "v")); err != nil {
    return fmt.Errorf("release tag %q is not valid semver: %w", tag, err)
}

Type guard

func isSemverTag(tag string) bool {
    _, err := semver.ParseTolerant(tag)
    return err == nil
}

Prevention

When it happens

Trigger: The latest GitLab release's tag_name is something like "release-2024", "1.0", a branch name, or a commit-ish string that semver.ParseTolerant rejects.

Common situations: Publishing plugin releases with non-semver tag names on a self-hosted GitLab; custom tagging conventions (e.g. dates or build numbers without dots); a release was re-tagged or created manually with an ad-hoc name.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/c879ece56a632436. Report an issue: GitHub.