Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: failed to load language plugin nodejs #1956

Closed
trondhindenes opened this issue Sep 19, 2018 · 13 comments
Closed

error: failed to load language plugin nodejs #1956

trondhindenes opened this issue Sep 19, 2018 · 13 comments
Assignees
Labels
area/cli UX of using the CLI (args, output, logs) kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@trondhindenes
Copy link

trondhindenes commented Sep 19, 2018

Trying the kubernetes "getting started" example. I did "pulumi new", then chose kubernetes-typescript. Didn't modify anything, getting this error whatever I do:
"error: failed to load language plugin nodejs: no language plugin 'nodejs' found in the workspace or on your $PATH"
Nothing else is printed even if setting verbose logging (v=3)

Nodejs: 8.10.0
typescript 3.0.3
pulumi: v0.15.2

@lukehoban
Copy link
Member

@trondhindenes did you install via curl, brew, or some other means?

@ellismg any idea what might be wrong here?

@lukehoban lukehoban added this to the 0.18 milestone Sep 19, 2018
@ellismg
Copy link
Contributor

ellismg commented Sep 19, 2018

@ellismg any idea what might be wrong here?

When pulumi wants to run a TypeScript/JavaScript program, it calls to the javascript language plugin, named pulumi-language-nodejs. Assuming you installed Pulumi via curl or brew, this should be present and located in the same directory as Pulumi:

[matell@matell docs]$ which pulumi
~/.pulumi/bin/pulumi
[matell@matell docs]$ which pulumi-language-nodejs 
~/.pulumi/bin/pulumi-language-nodejs
[matell@matell docs]$ 

My only other suspicion was if you were somehow invoking pulumi without it being on the $PATH (say via providing the full path on the shell) then our check to find the language plugin would probably fail.

In addition to understanding how exactly you installed Pulumi, I'd love to know if which pulumi-language-nodejs succeeds. If it does not, is there a copy of the binary next to where pulumi is installed?

@trondhindenes
Copy link
Author

trondhindenes commented Sep 19, 2018

ah gotcha. I symlinked the pulumi binary, the doc didn't say anything about other refs / pathing requirements.
(quite a common pattern to symlink stuff into a dir included in $PATH instead of actually copying binaries in or adding new dirs to $PATH). Maybe the doc should say something about multiple files in that folder is required everything to work, or some fallback logic detecting that the binary is symlinked, and try to resolve the dependencies in the "real" dir if the symlinked one fails. Or something. Easiest is probably just to make the doc super-clear.

@lukehoban lukehoban assigned lukehoban and unassigned ellismg Sep 20, 2018
@lukehoban lukehoban assigned ellismg and unassigned lukehoban Oct 1, 2018
@lukehoban lukehoban modified the milestones: 0.18, 0.19 Oct 1, 2018
@oversize
Copy link

oversize commented Oct 8, 2018

I'm having the same issue.
Installed pulumi via the shell script. I am using zsh and added ~/.pulumi/bin to my $PATH.
Now, after the first step of the tutorial i fail to do a preview of the stack with exact error message above (failed to load language plugin python). But since the pulumi-language-python is in bin and i added the bin folder to $PATH i dont understand whats wrong.

I am using pyenv with python 3.6.6 and pulumi 0.15.4

@joeduffy
Copy link
Member

@ellismg Any idea what might be going on here?

@joeduffy joeduffy added kind/bug Some behavior is incorrect or out of spec area/cli UX of using the CLI (args, output, logs) labels Oct 30, 2018
ellismg added a commit that referenced this issue Nov 19, 2018
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
ellismg added a commit that referenced this issue Nov 20, 2018
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
ellismg added a commit that referenced this issue Nov 20, 2018
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
ellismg added a commit that referenced this issue Nov 20, 2018
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
ellismg added a commit that referenced this issue Nov 20, 2018
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
@AaronFriel
Copy link
Member

AaronFriel commented Mar 1, 2019

I believe this problem is the absence of a Pulumi.yaml in the correct folder, and a misleading error message.

I was receiving this message on Windows (0.16.16), installed via Powershell script, and Linux (0.16.17), installed by unpacking the tarball and adding it to the path manually (CI script).

@dangersorus
Copy link

Just got this same error, running on mac terminal.

pulumi up
Previewing update (ingress-test)

View Live: https://app.pulumi.com/dangersorus/ingress-test/ingress-test/previews/576f0639-8900-465b-8905-0a148886053e

 Type                 Name                       Plan     Info
 pulumi:pulumi:Stack  ingress-test-ingress-test           1 message

Diagnostics:
pulumi:pulumi:Stack (ingress-test-ingress-test):
error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?

error: failed to load language plugin nodejs: could not read plugin [/usr/local/bin/pulumi-language-nodejs] stdout: EOF

$ which pulumi
/usr/local/bin/pulumi
$ which pulumi-language-nodejs
/usr/local/bin/pulumi-language-nodejs

Not at all clear what to do next.

@rv-silva
Copy link

rv-silva commented Nov 5, 2020

Hey @dangersorus. Have you come to a solution on this issue? I got exactly the same here and it would be very helpful if you could share that.

@dionb
Copy link

dionb commented Nov 23, 2020

It appears that these "failed to load plugin" errors are because dependencies of that plugin can not be found. I was having issues with the node.js version. I ran npm i which installed a bunch of pulumi node.js sdk dependencies (like the aws provider) and then pulumi started working just fine.

@austinrivas
Copy link

Anyone coming across this is in the future who has recently switched from nvm to a native nodejs install.

You need to clear you yarn / npm cache and to a yarn / npm install and then the error should be resolved.

@steinybot
Copy link

I was running into a similar issue:

Diagnostics:
  pulumi:pulumi:Stack (tlayen-prod):
    error: missing executor /Users/jason/go/bin/pulumi-language-python-exec

error: failed to load language plugin python: could not read plugin [/Users/jason/go/bin/pulumi-language-python] stdout: EOF

It was working fine until a recent upgrade of pulumi via brew.

/Users/jason/go/bin/pulumi-language-python existed but /Users/jason/go/bin/pulumi-language-python-exec did not. It was in /usr/local/bin/pulumi-language-python-exec instead. No idea who/what/where/why/when.

pulumi-language-python-exec is on the PATH so if #2229 was truly searching in both places then it should have worked. My guess is that #2229 only works if pulumi-language-python is in a different place not if pulumi-language-python-exec is in a different place.

Uninstall, rm -f /Users/jason/go/bin/pulumi*, reinstall fixed it.

@s-kalinin
Copy link

Hi! I have upgraded Pulumi today from 3.17.1 to 3.18.1 and get exactly the same error. Removing executables/reinstalling Pulumi did not help. I still get:

$yarn install
yarn install v1.22.17
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.09s.
$pulumi up
Previewing update (whatever):
Type Name Plan Info
pulumi:pulumi:Stack whatever 1 message

Diagnostics:
pulumi:pulumi:Stack (whatever):
error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?

error: failed to load language plugin nodejs: could not read plugin [/usr/local/bin/pulumi-language-nodejs] stdout: EOF

$ which pulumi
/usr/local/bin/pulumi
$ which pulumi-language-nodejs
/usr/local/bin/pulumi-language-nodejs

Any other ideas?

@chadaort
Copy link

I ran into this same error when I created a second stack within a project. The older stack continued to work just fine but something went wrong when I created a second stack and I would receive an error about failing to load the plugin. Running pulumi refresh fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli UX of using the CLI (args, output, logs) kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests