pulumiverse / pulumi-hcp

A Pulumi provider for interacting with the Hashicorp Cloud Platform
Apache License 2.0
1 stars 2 forks source link

Loading plugin fails intermittently #22

Open johannesdrescher opened 2 years ago

johannesdrescher commented 2 years ago

Hi 👋

first off, thanks for creating and maintaining this provider! It's really useful!

I've been getting an intermittent error. It occurred last week, seemed to have resolved itself the next day, but now it's happening again. It only occurs in projects that use this plugin.

error: could not load plugin for hcp provider 'urn:pulumi:production::template-base::pulumi:providers:hcp::default_https_/github.com/grapl-security/pulumi-hcp/releases/download/v__VERSION_': no resource plugin 'pulumi-resource-hcp' found in the workspace or on your $PATH, install the plugin using `pulumi plugin install resource hcp`

The v__VERSION_ part of that error message looks like maybe the actual latest version could not be found or could for some other reason not be inserted.

Running pulumi plugin install resource hcp as the error above suggests, results in another error.

error: 404 HTTP error fetching plugin from https://api.github.com/repos/pulumi/pulumi-hcp/releases/latest. If this is a private GitHub repository, try providing a token via the GITHUB_TOKEN environment variable. See: https://github.com/settings/tokens

This one does not support the theory that Pulumi does not know which version to use. Instead it seems to be looking for the plugin under the wrong organization name.

The only workaround I've found so far is manually specifying the plugin server and version.

pulumi plugin install resource hcp \
  --server 'https://github.com/grapl-security/pulumi-hcp/releases/download/v0.1.9/' \
  --exact 'v0.1.9'
christophermaier commented 2 years ago

@johannesdrescher Thanks for raising this. I haven't seen this locally, but will see if I can reproduce and get to the bottom of what's going on. I have some ideas to investigate.

Glad you're getting use of the provider, and that you have a workaround.

christophermaier commented 2 years ago

@johannesdrescher Unfortunately, I don't seem to be able to reproduce this ☹️

What language (Go, Python, JavaScript) are you using? What version of Pulumi are you using? Do you have a Pulumi program that you can share that reproduces this for you?

Thanks!

johannesdrescher commented 2 years ago

Hi @christophermaier, thank you for your swift response. I just checked, it's still happening. It might be tricky to reproduce because you'd have to make sure it's not installing a cached copy. You could spin up fresh a Gitpod environment, install pulumi and then run pulumi plugin install resource hcp. That should give you the second error. To answer your questions, I'm using Go and Pulumi 3.35.2.

christophermaier commented 2 years ago

@johannesdrescher OK, that helps a lot. I'll see what I can cook up.

Thanks!

christophermaier commented 2 years ago

OK, using Go, I can reproduce this pretty consistently (never happened when I tried with Python, though 🤔). The weird thing is that basically the first time I run a Pulumi project with no plugins downloaded, it will fail to download the HCP plugin. If I immediately run a pulumi up again, however, it downloads the plugin without a problem.

Even weirder is that this happens for every single version of the plugin... except for v0.1.3, which never downloads. And this is despite the fact that our release pipeline explicitly tests this plugin download process before finalizing things.

I'll keep investigating, but the fact that I can reproduce it easily is a good first step.

johannesdrescher commented 2 years ago

I'm glad to hear you were able to reproduce it. Looking forward to learning the solution of this mystery.

johannesdrescher commented 1 year ago

The error continues to occur. But I'm starting to think it might be a general pulumi issue because it seems to be happening with other plugins too. Not sure though because it's not the same error message. Could also be an unrelated pulumi-vault problem.

   stderr: [resource plugin hcp-0.1.11] installing
  [resource plugin vault-5.5.0] installing

   err?: