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

output in triggers throws error if PULUMI_ERROR_OUTPUT_STRING is set #548

Open
otahirs opened this issue Oct 18, 2024 · 3 comments
Open
Assignees
Labels
awaiting/core Blocked on a missing bug or feature in pulumi/pulumi (except codegen) awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec

Comments

@otahirs
Copy link

otahirs commented Oct 18, 2024

What happened?

when PULUMI_ERROR_OUTPUT_STRING="true" option is used, and there is an output in the triggers array, the pulumi throws an error that toString was called on an Output

Example

set env variable PULUMI_ERROR_OUTPUT_STRING="true"

have output in the triggers array

const iMightChange = pulumi.output("foo");

const cmd = new command.local.Command(
    `cmd`,
    {
      triggers: [iMightChange],
      interpreter: ['PowerShell', '-Command'],
      create: '', 
    },
    {},
  );

you get error:
Image
minimal_working_example.zip

Output of pulumi about

CLI
Version 3.133.0
Go Version go1.23.1
Go Compiler gc

Plugins
KIND NAME VERSION
resource command 1.0.1
language nodejs unknown

Host
OS Microsoft Windows 11 Enterprise
Version 10.0.22631 Build 22631
Arch x86_64

This project is written in nodejs: executable='C:\Program Files\nodejs\node.exe' version='v20.15.0'

Current Stack: organization/temp/dev

TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::temp::pulumi:pulumi:Stack::temp-dev
pulumi:providers:command urn:pulumi:dev::temp::pulumi:providers:command::default_1_0_1
command:local:Command urn:pulumi:dev::temp::command:local:Command::cmd

Additional context

workaround is to wrap the whole array in an output

const cmd = new command.local.Command(
    `cmd`,
    {
      triggers: pulumi.output([iMightChange]),
      interpreter: ['PowerShell', '-Command'],
      create: '', 
    },
    {},
  );

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).

@otahirs otahirs added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 18, 2024
@mjeffryes mjeffryes added resolution/fixed This issue was fixed and removed needs-triage Needs attention from the triage team labels Oct 29, 2024
@mjeffryes mjeffryes self-assigned this Oct 29, 2024
@mjeffryes
Copy link
Member

I was able to repro this on my local machine when using @pulumi/pulumi version 1.133.0, but it appears to be fixed when using version 1.137.0

We did have a regression in @pulumi/pulumi version 1.133.0 that, while not identical with this issue, probably shared the same root cause, so I suspect it was resolved by the same PR.

Please reopen if upgrading the version does not help.

@otahirs
Copy link
Author

otahirs commented Dec 10, 2024

still present in 3.140.0

CLI
Version      3.140.0
Go Version   go1.23.3
Go Compiler  gc

Plugins
KIND      NAME    VERSION
language  nodejs  unknown

Host
OS       Microsoft Windows 11 Enterprise
Version  10.0.22631 Build 22631
Arch     x86_64

This project is written in nodejs: executable='C:\Program Files\nodejs\node.exe' version='v20.15.0'

@mjeffryes please re-open

@mjeffryes mjeffryes reopened this Dec 16, 2024
@mjeffryes mjeffryes added the needs-triage Needs attention from the triage team label Dec 16, 2024
@mjeffryes
Copy link
Member

Thanks I was able to reproduce; Looks like you've already linked pulumi/pulumi#17736 which appears to be the upstream fix we need for this.

@mjeffryes mjeffryes added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). awaiting/core Blocked on a missing bug or feature in pulumi/pulumi (except codegen) and removed needs-triage Needs attention from the triage team resolution/fixed This issue was fixed labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting/core Blocked on a missing bug or feature in pulumi/pulumi (except codegen) awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants