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

Pulumi action tries to login to pulumi cloud even though we're using S3 backend #1081

Closed
annStein opened this issue Jan 24, 2024 · 8 comments · Fixed by #1082
Closed

Pulumi action tries to login to pulumi cloud even though we're using S3 backend #1081

annStein opened this issue Jan 24, 2024 · 8 comments · Fixed by #1082
Assignees
Labels
impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@annStein
Copy link

annStein commented Jan 24, 2024

What happened?

The pulumi action version 5.1.0 tries to login to pulumi cloud backend instead of the configured S3 backend. It is working fine with version 5.0.0.

Example

Run pulumi/actions@v5
  with:
    command: preview
    stack-name: <XXX>
    work-dir: <XXX>
    pulumi-version: <XXX>
    comment-on-pr: false
    comment-on-summary: false
    github-token: ***
    expect-no-changes: false
    diff: false
    target-dependents: false
    refresh: false
    upsert: false
    remove: false
    edit-pr-comment: true
    color: auto
    exclude-protected: false
  env:
    IMAGE_NAME: <XXX>    
    NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
    NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX
    AWS_DEFAULT_REGION: eu-central-1
    AWS_REGION: eu-central-1
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    AWS_SESSION_TOKEN: ***
Configured range: ^3
/usr/local/bin/pulumi version
v3.101.1
Pulumi version 3.101.1 is already installed on this machine. Skipping download
Logging into the Pulumi Cloud backend.

/home/runner/work/_actions/pulumi/actions/v5/webpack:/pulumi-github-action/node_modules/tslib/tslib.js:115
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
^
Error: error: problem logging in: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions
    at /home/runner/work/_actions/pulumi/actions/v5/webpack:/pulumi-github-action/src/main.ts:[4](<XXX>)7:1
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/pulumi/actions/v[5](<XXX>)/webpack:/pulumi-github-action/node_modules/tslib/tslib.js:115:1)
    at processTicksAndRejections (node:internal/process/task_queues:[9](<XXX>)5:5)

Output of pulumi about

Does not apply since pulumi-action is used and pulumi about is not available in action.

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@annStein annStein added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 24, 2024
@Frassle
Copy link
Member

Frassle commented Jan 24, 2024

the configured S3 backend.

What configured S3 backend? The config shown doesn't list backend.

@Frassle
Copy link
Member

Frassle commented Jan 24, 2024

I think you need to set the 'cloud-url' config option. Not sure how this was ever working before.

@annStein
Copy link
Author

We don't pass the cloud-url since it's defined in the Pulumi.yaml

backend:
  url: s3://<XXX>

@lfantone
Copy link

lfantone commented Jan 24, 2024

We are facing the same issue even with the cloud-url property correctly set. We end up downgrading to v5 which works just fine.

image

@Frassle
Copy link
Member

Frassle commented Jan 24, 2024

We don't pass the cloud-url since it's defined in the Pulumi.yaml

Ah... yes that's a regression.

We are facing the same issue

I think that might be a different issue. The old code ignored any error from login so this would have been silently failing. Although again not clear how this was working before if login was failing.

@Frassle Frassle added impact/regression Something that used to work, but is now broken and removed needs-triage Needs attention from the triage team labels Jan 24, 2024
@lfantone
Copy link

What do you mean with login failing? The preview or update commands where executing fine and the state in the cloud was updated properly. Maybe I'm missing something else?

I know this new implementation show the error, but is there any way to check this login issues within the v5.0.0 action?

tgummerer added a commit that referenced this issue Jan 24, 2024
Aparently `pulumi login` can fail, and yet other pulumi commands that
follow can succeed (see #1081).

Instead of failing outright when login fails, just print a warning, so
people are not confused when further errors happen later.
@Frassle
Copy link
Member

Frassle commented Jan 24, 2024

What do you mean with login failing?

As in pulumi login failing. Oddly the login flow for that and preview are the same as far as I can see so I'm not sure how this is in a state where login fails but preview was working.

I don't think the old action recorded these failures in any way. Doesn't even look like debug mode logs anything for exec calls. We'll get a fix out so this doesn't hard error.

tgummerer added a commit that referenced this issue Jan 24, 2024
Aparently `pulumi login` can fail, and yet other pulumi commands that
follow can succeed (see #1081).

Instead of failing outright when login fails, just print a warning, so
people are not confused when further errors happen later.
tgummerer added a commit that referenced this issue Jan 24, 2024
Aparently `pulumi login` can fail, and yet other pulumi commands that
follow can succeed (see #1081).

Instead of failing outright when login fails, just print a warning, so
people are not confused when further errors happen later.
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jan 24, 2024
@tgummerer
Copy link
Contributor

I just released v5.1.1 of the GitHub action, which should solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants