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 generates output on stderr / OnStandardError callback with update warning #133

Open
klyse opened this issue Apr 7, 2023 · 2 comments
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team

Comments

@klyse
Copy link

klyse commented Apr 7, 2023

What happened?

I'm using the pulumi dotnet automation API to deploy infrastructure on demand. I'm using the callbacks OnStandardOutput and OnStandardError on the UpAsync method:

await stack.UpAsync(new UpOptions
{
	OnStandardError = error => Logger.Warning("Pulumi up error on VirtualMachineId {VirtualMachineId} Error: {Error}", vm.Id, error),
	OnStandardOutput = msg => Logger.Debug("Pulumi up output on VirtualMachineId {VirtualMachineId} Message: {Message}", vm.Id, msg)
}, token);

I'm getting output on the OnStandardError when pulumi is outdated:

[10:11:39 WRN] Pulumi up error on VirtualMachineId 6f5cecf3-40e5-464e-92f0-5befd240f584 Error: warning: A new version of Pulumi is available. To upgrade from version '3.60.0' to '3.61.0', run  => Application.CloudRendering.CloudProvider
[10:11:39 WRN] Pulumi up error on VirtualMachineId 6f5cecf3-40e5-464e-92f0-5befd240f584 Error:    $ brew update && brew upgrade pulumi => Application.CloudRendering.CloudProvider
[10:11:39 WRN] Pulumi up error on VirtualMachineId 6f5cecf3-40e5-464e-92f0-5befd240f584 Error: or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes. => Application.CloudRendering.CloudProvider

Expected Behavior

Add option to suppress update warnings or send them on stdout instead of stderr as it is not an error.

Steps to reproduce

Use the snipped above, add a stack and adjust logging.

Output of pulumi about

CLI
Version 3.60.0
Go Version go1.20.2
Go Compiler gc

Host
OS darwin
Version 13.3
Arch arm64

Backend
Name pulumi.com
URL xxx
User xxx
Organizations xxx

Pulumi locates its logs in xxx by default
warning: Failed to read project: no Pulumi.yaml project file found (searching upwards from xxx). If you have not created a project yet, use pulumi new to do so: no project file found
warning: Failed to get information about the current stack: no Pulumi.yaml project file found (searching upwards from xxx). If you have not created a project yet, use pulumi new to do so: no project file found
warning: A new version of Pulumi is available. To upgrade from version '3.60.0' to '3.61.0', run
$ brew update && brew upgrade pulumi
or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes.

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

@klyse klyse added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Apr 7, 2023
@klyse klyse changed the title Pulumi generates output on stderr / OnStandardError callback Pulumi generates output on stderr / OnStandardError callback with update warning Apr 7, 2023
@dixler
Copy link
Contributor

dixler commented Apr 7, 2023

Hey again. Thanks for filing. There's an environment variable you can set via export PULUMI_SKIP_UPDATE_CHECK=1 which should disable the warning.

@dixler dixler added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Apr 7, 2023
@klyse
Copy link
Author

klyse commented Apr 11, 2023

Thanks for the very fast answer. This indeed seems to work.

Can I access this somehow through the C# SDK? By access I mean setting this as configuration in the UpAsync etc. methods. Setting the env variable works, but it has to be done for the whole dotnet process if I'm not misunderstanding something.

@mikhailshilkov mikhailshilkov added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Jun 5, 2024
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 needs-triage Needs attention from the triage team
Projects
None yet
Development

No branches or pull requests

3 participants