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

JSII crashes if a " " is present in the JsiiRuntimePath path #1296

Closed
1 of 4 tasks
gregswdl opened this issue Feb 26, 2020 · 3 comments
Closed
1 of 4 tasks

JSII crashes if a " " is present in the JsiiRuntimePath path #1296

gregswdl opened this issue Feb 26, 2020 · 3 comments
Labels
bug This issue is a bug. closed-for-staleness effort/small Small work item – less than a day of effort language/dotnet Related to .NET bindings (C#, F#, ...) p1

Comments

@gregswdl
Copy link

🐛 Bug Report

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)

General Information

  • JSII Version: 0.22.0
  • Platform: Windows 10 Pro

What is the problem?

This issue was discovered trying to use the CDK, however I believe it is ultimately in JSII. As stated above, I'm running the .NET Core 3 version on Windows 10. My Windows login is my full name, Greg Smith. The issue is that my temp dir path is C:\Users\Greg Smith\AppData\Local\Temp and when the node process is run with the JSII package, node will crash with

Unhandled exception. Amazon.JSII.Runtime.JsiiException: Child process exited unexpectedly: internal/modules/cjs/loader.js:638

I was able to trace the issue down to the ProcessStartInfo object. The arguments simply attach the JsiiRuntimePth from the provider and spaces are interpreted as a new argument by node, equivelant to the following:

C:\Users\Greg Smith>node --max-old-space-size=4096 C:\Users\Greg Smith\AppData\Local\Temp\zmqnhp2i.n2w\jsii-runtime.js
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'C:\Users\Greg'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

However, wrapping with quotes yeilds:

C:\Users\Greg Smith>node --max-old-space-size=4096 "C:\Users\Greg Smith\AppData\Local\Temp\zmqnhp2i.n2w\jsii-runtime.js"
{"hello":"@jsii/[email protected]"}

Verbose Log

gist of log

@gregswdl gregswdl added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 26, 2020
@gregswdl
Copy link
Author

Note, as a temporary workaround you can set your TMP path to something without spaces, eg

PS C:\> $env:TMP = "C:\tmp"

@github-actions
Copy link
Contributor

This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 29, 2023
@github-actions github-actions bot closed this as completed Jul 5, 2023
@ashovlin
Copy link
Member

Could we reopen this if it hasn't been resolved?

I work on https://github.com/aws/aws-dotnet-deploy, which generates CDK projects based on user's .NET applications. My hunch is we have a higher likelihood of users on Windows than the other language bindings.

We provide an environment variable to let users override the path where our tool is generating the CDK projects, but it's still a sharp edge. Here's an example from last week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness effort/small Small work item – less than a day of effort language/dotnet Related to .NET bindings (C#, F#, ...) p1
Projects
None yet
Development

No branches or pull requests

4 participants