{"record":{"id":"12e2a523bb1ebac7","repo":"pulumi/pulumi","slug":"w-s-s-does-not-match-a-registry-package","errorCode":null,"errorMessage":"%w: %s%s does not match a registry package","messagePattern":"%w: (.+?)(.+?) does not match a registry package","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/registry/resolve.go","lineNumber":144,"sourceCode":"\t\t\t\t\t\tpackages: []apitype.PackageMetadata{meta},\n\t\t\t\t\t\terr:      ErrNotFound,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn apitype.PackageMetadata{}, err\n\t\t}\n\n\t\tif len(privatePackageMetadata) == 1 {\n\t\t\treturn applyVersion(privatePackageMetadata[0])\n\t\t}\n\t\tif pulumiPackageMetadata != nil {\n\t\t\treturn applyVersion(*pulumiPackageMetadata)\n\t\t}\n\t\tvar versionStr string\n\t\tif version != nil {\n\t\t\tversionStr = \"@\" + version.String()\n\t\t}\n\t\treturn apitype.PackageMetadata{}, fmt.Errorf(\n\t\t\t\"%w: %s%s does not match a registry package\", errorSuggestedPackages{\n\t\t\t\tpackages: suggested,\n\t\t\t\terr:      ErrNotFound,\n\t\t\t}, name, versionStr)\n\tdefault:\n\t\treturn apitype.PackageMetadata{}, InvalidIdentifierError{name}\n\t}\n}\n\nfunc GetSuggestedPackages(err error) []apitype.PackageMetadata {\n\tsuggestions, _ := errors.AsType[errorSuggestedPackages](err)\n\treturn suggestions.packages\n}\n\ntype errorSuggestedPackages struct {\n\terr      error\n\tpackages []apitype.PackageMetadata\n}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/registry/resolve.go#L126-L162","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Use the fully-qualified source/publisher/name form for third-party packages","Call GetSuggestedPackages on the error and pick from the suggested list","Check the package exists on the Pulumi Registry website","Confirm the exact spelling/casing of the package name"],"exampleFix":"// before\npkg, err := registry.ResolvePackageFromName(ctx, reg, \"mongodbatlas\", nil)\n// after\npkg, err := registry.ResolvePackageFromName(ctx, reg, \"pulumi/mongodbatlas/mongodbatlas\", nil)","handlingStrategy":"fallback","validationCode":"// verify the name resolves to a known package before resolving metadata\nresults := searchRegistry(name)\nif len(results.privateMatches) == 0 && len(results.pulumiMatches) == 0 {\n  return fmt.Errorf(\"%q only exists under third-party publishers or not at all; use source/publisher/name\", name)\n}","typeGuard":"func isNotFoundWithSuggestions(err error) bool {\n  return errors.Is(err, registry.ErrNotFound) && len(registry.GetSuggestedPackages(err)) > 0\n}","tryCatchPattern":"pkg, err := registry.ResolvePackageFromName(ctx, reg, name, ver)\nif err != nil && errors.Is(err, registry.ErrNotFound) {\n  for _, s := range registry.GetSuggestedPackages(err) {\n    // offer s.Source/s.Publisher/s.Name as an alternative\n  }\n}","preventionTips":["Use fully-qualified names for community/third-party packages","Validate names against the Pulumi Registry before automation runs","Check errors with errors.Is(err, registry.ErrNotFound) and use GetSuggestedPackages for UX","Watch the '@version' suffix in the message to notice version-scoped misses"],"tags":["go","not-found","registry","package-resolution"],"backgroundTag":"package-not-found","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}