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

Closed
otahirs opened this issue Oct 18, 2024 · 1 comment
Closed
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

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.

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 resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

2 participants