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

Error: spawn EINVAL running autorest legacy on windows #4676

Open
jwaltz-bah opened this issue May 3, 2024 · 1 comment
Open

Error: spawn EINVAL running autorest legacy on windows #4676

jwaltz-bah opened this issue May 3, 2024 · 1 comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that v3 Version 3 of AutoRest C# generator.

Comments

@jwaltz-bah
Copy link

jwaltz-bah commented May 3, 2024

A recent Node JS update includes a breaking change to patch a security vulnerability: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2

When running autorest csharp v2 on Windows, the "spanw EINVAL" error occurs and stops execution.

Tested with both Node v21.7.3 and v18.20.2 (the patch was applied across all major Node versions)

Command:

autorest --input-file=swagger.json --csharp --legacy --add-credentials --namespace=MyApp.Model.Data --output-folder=MyApp.Model\Data

Console output:

AutoRest code generation utility [cli version: 3.7.1; node: v21.7.3]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
info    | AutoRest core version selected from configuration: ~2.0.4413.
   Loading AutoRest core      'C:\Users\me\.autorest\@[email protected]\nodemodules\@microsoft.azure\autorest-core\dist' (2.0.4429)
No configuration found at 'file:///C:/Users/me/repos/PPIThePricingAppIntegration/PricingApp/'.
   Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.3.79->2.3.102)
   Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.55->2.3.55)
Process() cancelled due to exception : spawn EINVAL
  Error: spawn EINVAL

Suggested solution from the Security Release announcement:

If the input to spawn/spawnSync is sanitized, users can now pass { shell: true } as an option to prevent the occurrence of EINVALs errors.

@jwaltz-bah jwaltz-bah added the v3 Version 3 of AutoRest C# generator. label May 3, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 3, 2024
@jwaltz-bah
Copy link
Author

Should be labeled v2--haven't tested on v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

No branches or pull requests

1 participant