pulumi/pulumi · warning

: does not match a registry package

Error message

%w: %s%s does not match a registry package

What it means

Terminal not-found result for bare (one-segment) package names: no private package, no pulumi/pulumi-published package, and (if any exist) a list of 'suggested' third-party packages with the same name. The error wraps errorSuggestedPackages which itself wraps ErrNotFound, so errors.Is(err, registry.ErrNotFound) holds and GetSuggestedPackages returns the similar packages. The message appends '@version' when a specific version was requested.

Solutions

  1. Use the fully-qualified source/publisher/name form for third-party packages
  2. Call GetSuggestedPackages on the error and pick from the suggested list
  3. Check the package exists on the Pulumi Registry website
  4. Confirm the exact spelling/casing of the package name

Example fix

// before
pkg, err := registry.ResolvePackageFromName(ctx, reg, "mongodbatlas", nil)
// after
pkg, err := registry.ResolvePackageFromName(ctx, reg, "pulumi/mongodbatlas/mongodbatlas", nil)
Defensive patterns

Strategy: fallback

Validate before calling

// verify the name resolves to a known package before resolving metadata
results := searchRegistry(name)
if len(results.privateMatches) == 0 && len(results.pulumiMatches) == 0 {
  return fmt.Errorf("%q only exists under third-party publishers or not at all; use source/publisher/name", name)
}

Type guard

func isNotFoundWithSuggestions(err error) bool {
  return errors.Is(err, registry.ErrNotFound) && len(registry.GetSuggestedPackages(err)) > 0
}

Try / catch

pkg, err := registry.ResolvePackageFromName(ctx, reg, name, ver)
if err != nil && errors.Is(err, registry.ErrNotFound) {
  for _, s := range registry.GetSuggestedPackages(err) {
    // offer s.Source/s.Publisher/s.Name as an alternative
  }
}

Prevention

When it happens

Trigger: ResolvePackageFromName called with a name like 'aws' or 'mytool' where the registry search returns no private or pulumi-official match — the name only exists under third-party publishers, or doesn't exist at all; also when the requested semver doesn't match after a candidate was found... (for the no-candidate case specifically: zero private and zero pulumi matches).

Common situations: Typo in a package name; referencing a community package (e.g. a third-party publisher's package) by bare name when only the fully-qualified form resolves; requesting a name that was never published; offline or restricted registry search returning empty results.

Related errors


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

Appendix: source

Thrown at pkg/registry/resolve.go:144

						packages: []apitype.PackageMetadata{meta},
						err:      ErrNotFound,
					},
				}
			}
			return apitype.PackageMetadata{}, err
		}

		if len(privatePackageMetadata) == 1 {
			return applyVersion(privatePackageMetadata[0])
		}
		if pulumiPackageMetadata != nil {
			return applyVersion(*pulumiPackageMetadata)
		}
		var versionStr string
		if version != nil {
			versionStr = "@" + version.String()
		}
		return apitype.PackageMetadata{}, fmt.Errorf(
			"%w: %s%s does not match a registry package", errorSuggestedPackages{
				packages: suggested,
				err:      ErrNotFound,
			}, name, versionStr)
	default:
		return apitype.PackageMetadata{}, InvalidIdentifierError{name}
	}
}

func GetSuggestedPackages(err error) []apitype.PackageMetadata {
	suggestions, _ := errors.AsType[errorSuggestedPackages](err)
	return suggestions.packages
}

type errorSuggestedPackages struct {
	err      error
	packages []apitype.PackageMetadata
}

View on GitHub (pinned to 793f7b2e16)