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

ImportAsync requires dotnet build to run #323

Open
JasonWhall opened this issue Aug 20, 2024 · 1 comment
Open

ImportAsync requires dotnet build to run #323

JasonWhall opened this issue Aug 20, 2024 · 1 comment
Labels
area/automation-api kind/bug Some behavior is incorrect or out of spec

Comments

@JasonWhall
Copy link
Contributor

What happened?

When using the WorkspaceStack.ImportAsync Method, it currently requires building a .NET project which may not be available if the running program is an executable. The following error message is returned:

Error Message
Importing (SecondStack):
    pulumi:pulumi:Stack MyProject-SecondStack  running 'dotnet build -nologo .'
    pulumi:pulumi:Stack MyProject-SecondStack  MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
    pulumi:pulumi:Stack MyProject-SecondStack  MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
    pulumi:pulumi:Stack MyProject-SecondStack  1 message
Diagnostics:
  pulumi:pulumi:Stack (MyProject-SecondStack):
    MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

error: failed to discover plugin requirements: 'dotnet build -nologo .' exited with non-zero exit code: 1
Unhandled exception. Pulumi.Automation.Commands.Exceptions.CommandException: code: -1
stdout: Importing (SecondStack):
    pulumi:pulumi:Stack MyProject-SecondStack  running 'dotnet build -nologo .'
    pulumi:pulumi:Stack MyProject-SecondStack  MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
    pulumi:pulumi:Stack MyProject-SecondStack  MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
    pulumi:pulumi:Stack MyProject-SecondStack  1 message
Diagnostics:
  pulumi:pulumi:Stack (MyProject-SecondStack):
    MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.


stderr: error: failed to discover plugin requirements: 'dotnet build -nologo .' exited with non-zero exit code: 1


   at Pulumi.Automation.Commands.LocalPulumiCommand.RunAsyncInner(IList`1 args, String workingDir, IDictionary`2 additionalEnv, Action`1 onStandardOutput, Action`1 onStandardError, EventLogFile eventLogFile, CancellationToken cancellationToken)
   at Pulumi.Automation.Commands.LocalPulumiCommand.RunAsync(IList`1 args, String workingDir, IDictionary`2 additionalEnv, Action`1 onStandardOutput, Action`1 onStandardError, Action`1 onEngineEvent, CancellationToken cancellationToken)
   at Pulumi.Automation.Workspace.RunStackCommandAsync(String stackName, IList`1 args, Action`1 onStandardOutput, Action`1 onStandardError, Action`1 onEngineEvent, CancellationToken cancellationToken)
   at Pulumi.Automation.WorkspaceStack.RunCommandAsync(IList`1 args, Action`1 onStandardOutput, Action`1 onStandardError, Action`1 onEngineEvent, CancellationToken cancellationToken)

The expectation is that it should not need to build the .NET project if it is being executed through the automation API. Speculation from the error message suggests that to import it needs to discover the plugins to use which is obtained by building the project.

Example

Example to re-produce published here - https://github.com/JasonWhall/pulumi-import-bug-sample

Output of pulumi about

CLI
Version 3.129.0
Go Version go1.22.6
Go Compiler gc

Host
OS Microsoft Windows 10 Enterprise
Version 10.0.19045 Build 19045
Arch x86_64

Backend
Name
URL file://~
User
Organizations
Token type personal

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

@JasonWhall JasonWhall added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 20, 2024
@justinvp justinvp added area/automation-api and removed needs-triage Needs attention from the triage team labels Aug 23, 2024
@justinvp
Copy link
Member

Thanks for the repro.

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

No branches or pull requests

2 participants