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

AWS plugin is not installed and tutorial documentation makes no mention of it #2097

Closed
eshamay opened this issue Oct 24, 2018 · 5 comments
Closed
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@eshamay
Copy link

eshamay commented Oct 24, 2018

I tried to follow the tutorial to setup and run pulumi for aws-python. Got stuck with this error:

$ pulumi new aws-python --dir vnext-cluster-poc
This command will walk you through creating a new Pulumi project.

Enter a value or leave blank to accept the default, and press <ENTER>.
Press ^C at any time to quit.
project name: (vnext-cluster-poc)
project description: (A minimal AWS Python Pulumi program)
Created project 'vnext-cluster-poc'.
stack name: (vnext-cluster-poc-dev)
Created stack 'vnext-cluster-poc-dev'
aws:region: The AWS region to deploy into: (us-east-1) us-west-2
Installing dependencies...
Your new project is configured and ready to go!
Previewing update (vnext-cluster-poc-dev):

     Type                     Name                                     Plan       Info
 +   pulumi:pulumi:Stack      vnext-cluster-poc-vnext-cluster-poc-dev  create
     └─ pulumi:providers:aws  default                                             1 error

Diagnostics:
  pulumi:providers:aws (default):
    error: no resource plugin 'aws' found in the workspace or on your $PATH

error: an error occurred while advancing the preview

The resolution is to run this command:
pulumi plugin install resource aws v0.15.0

@joeduffy joeduffy added this to the 0.19 milestone Oct 24, 2018
@joeduffy joeduffy added kind/bug Some behavior is incorrect or out of spec area/core labels Oct 24, 2018
@lukehoban
Copy link
Contributor

I assumed we would address this by fixing whatever leads to the error here - not by documenting in all our tutorials that you might hit an error :-).

Two questions/thoughts:

  1. What is causing this in the first place in the case above? Is it something missing/broken in pulumi new?
  2. If we really can't trust our instructions to get this right up front, can we make the error message presented to the user more actionable - including the pulumi plugin install command to run there where it's in context of the problem instead of in our docs?

@lukehoban
Copy link
Contributor

We improved the error message that is reported in these cases to include details and more actionable guidance:

error: could not load plugin for aws provider 'urn:pulumi:<stack_name>::pulumi-service::pulumi:providers:aws::default': no resource plugin 'aws-v0.16.2' found in the workspace or on your $PATH, install the plugin using pulumi plugin install resource aws v0.16.2

We also added a troubleshooting section on this with more details: https://pulumi.io/reference/troubleshooting.html#error-during-pulumi-previewup---error-could-not-load-plugin-for-awsazure-etc-provider

If there remain any issues that are causing this to fail beyond just the internet being unreliable, we should open new issues to track those.

@matheuss
Copy link

I think the getting started should definitely mention this. It currently says you can just pulumi new and then pulumi preview, which isn't true: you need to somehow figure how to install the AWS plugin (took me 10 minutes to find this issue):

▲ (matheus-vm) pulumi [add/pulumi] pulumi preview
Previewing update (redacted):

     Type                     Name               Plan       Info
 +   pulumi:pulumi:Stack      redacted           create
     └─ pulumi:providers:aws  default                       1 error

Diagnostics:
  pulumi:providers:aws (default):
    error: no resource plugin 'aws' found in the workspace or on your $PATH

Permalink: redacted

@lukehoban
Copy link
Contributor

@matheuss Curious which "getting started" steps you followed, and for what language, that led you to getting this error? It should be the case that it is not possible to end up in this situation, which is the only reason we haven't mentioned this in getting started docs. I'd love to understand and fix the paths that can be taken that lead to this problem.

@jonashackt
Copy link

I had the same problem/error message, while using TravisCI with Pulumi to have real CI/CD in place (see build log).

I found a solution for this. The problem is, that Pulumi needs it's Plugin resource aws configured. As I use pipenv instead of template generated virtualenv for my example project pulumi-python-aws-ansible, which installs the needed dependency pulumi-aws (which I assume from the getting started guide provides Pulumi with the needed aws plugin), you could approach the problem by executing the command pulumi plugin ls on your system (or on a CI/CD server like Travis):

$ pulumi plugin ls
NAME  KIND      VERSION  SIZE    INSTALLED    LAST USED
aws   resource  1.7.0    220 MB  2 hours ago  2 hours ago

If that list is empty, you're maybe experiencing the same issue like me: Pulumi doesn't know about pulumi-aws, since it was installed later on. What fixed it for me, was to install Pulumi with the installation script FIRST (as described in the docs) and then install Python package pulumi-aws SECOND. The following TravisCI configuration worked then for me:

sudo: false
language: python

env:
  - BOTO_CONFIG="/dev/null"

install:
  # First: install Pulumi SDK with the installation script from https://www.pulumi.com/docs/get-started/install/#installation-script
  - curl -fsSL https://get.pulumi.com | sh
  # Add Pulumi to Travis' PATH so the executable could be found
  - export PATH=$PATH:/home/travis/.pulumi/bin
  - pulumi version

  # Second: Install pulumi-aws dependency
  - pip install pipenv
  - pipenv install

  # Third: Check, if Pulumi aws plugin was installed correctly
  - pulumi plugin ls

See the fully working configuration live inside the example project's Travis configuration: https://github.com/jonashackt/pulumi-python-aws-ansible/blob/master/.travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

6 participants