{"record":{"id":"417b10ed26d1d8ae","repo":"pulumi/pulumi","slug":"could-not-find-latest-version-for-provider-s-w-417b10","errorCode":null,"errorMessage":"could not find latest version for provider %s: %w","messagePattern":"could not find latest version for provider (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/workspace/plugin.go","lineNumber":103,"sourceCode":"\t\t\tSpec: pluginSpec,\n\t\t\tErr:  fmt.Errorf(\"error installing provider %s: %w\", pluginSpec.Name, err),\n\t\t}\n\t}\n\n\treturn pluginSpec.Version, nil\n}\n\n// downloadPlugin resolves the plugin's version, if unset, and downloads its archive to a file,\n// retrying and logging progress along the way.\nfunc downloadPlugin(\n\tctx context.Context, pluginSpec *workspace.PluginDescriptor, log func(sev diag.Severity, msg string),\n) (*os.File, error) {\n\tutil.SetKnownPluginDownloadURL(pluginSpec)\n\tif pluginSpec.Version == nil {\n\t\tvar err error\n\t\tpluginSpec.Version, err = pluginstorage.Instance.GetLatestVersion(ctx, *pluginSpec)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not find latest version for provider %s: %w\", pluginSpec.Name, err)\n\t\t}\n\t}\n\n\twrapper := func(stream io.ReadCloser, size int64) io.ReadCloser {\n\t\t// Log at info but to stderr so we don't pollute stdout for commands like `package get-schema`\n\t\tlog(diag.Infoerr, \"Downloading provider: \"+pluginSpec.Name)\n\t\treturn stream\n\t}\n\n\tretry := func(err error, attempt int, limit int, delay time.Duration) {\n\t\tlog(diag.Warning, fmt.Sprintf(\"error downloading provider: %s\\n\"+\n\t\t\t\"Will retry in %v [%d/%d]\", err, delay, attempt, limit))\n\t}\n\n\tlogging.V(1).Infof(\"Automatically downloading provider %s\", pluginSpec.Name)\n\tdownloadedFile, err := workspace.DownloadToFile(ctx, *pluginSpec, wrapper, retry)\n\tif err != nil {\n\t\treturn nil, &InstallPluginError{","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/workspace/plugin.go#L85-L121","documentation":"Thrown by downloadPlugin when a plugin spec has no pinned version and pluginstorage.Instance.GetLatestVersion cannot resolve the latest version from the plugin registry/metadata service. It means Pulumi could not determine which version of the provider to download. The wrapped error from GetLatestVersion carries the actual cause (network failure, unknown plugin name, registry outage).","triggerScenarios":"Calling downloadPlugin/InstallPlugin with pluginSpec.Version == nil while the version-resolution API call fails — e.g. no network access, the plugin name does not exist in the registry, the registry returns 404/5xx, or a custom PluginDownloadURL lacks version metadata.","commonSituations":"Offline/air-gapped environments or corporate proxies blocking api.pulumi.com; typo in a third-party provider name; private providers whose download URL metadata isn't published; registry outages.","solutions":["Pin an explicit plugin version in the project's Pulumi.yaml `plugins:` block (or use the provider SDK's pinned version) so latest-version lookup is skipped.","Check network access to the plugin registry (api.pulumi.com) and any proxy settings (HTTPS_PROXY).","Verify the plugin name spelling and that it exists with `pulumi plugin ls` or on the Pulumi registry.","Set `plugins: providers: - name: x version: vX.Y.Z` plus a custom `pluginDownloadURL` for private providers."],"exampleFix":"// before: name: pulumi-awssdk with no version -> latest lookup\nplugins:\n  providers:\n    - name: awssdk\n// after: pin the version so no latest lookup is needed\nplugins:\n  providers:\n    - name: awssdk\n      version: 1.2.0","handlingStrategy":"validation","validationCode":"// Pin the version so the latest-version lookup is skipped\nif spec.Version == nil {\n    return errors.New(\"pin an explicit plugin version in Pulumi.yaml plugins: block to avoid registry lookup\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    var ipe *workspace.InstallPluginError\n    if errors.As(err, &ipe) && strings.Contains(err.Error(), \"could not find latest version\") {\n        // retry with explicit version or check registry/network\n    }\n    return err\n}","preventionTips":["Always pin plugin versions in the `plugins:` section of Pulumi.yaml.","Verify third-party plugin names exist on the registry before automating installs.","Confirm network/proxy access to api.pulumi.com in CI."],"tags":["plugin-install","version-resolution","network"],"backgroundTag":"plugin-version-not-found","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}