aws-cdk: Getting "Error: EOF: end of file, read" on Windows
description of the bug:
returns JSII error on empty stack. May be related to https://github.com/aws/aws-cdk/issues/5187.
stack trace references SyncStdio.readLine (myfolder\jsii_embedded\jsii\jsii-runtime.js:13278:33) Comment in code at ‘throw e’:
// HACK: node may set O_NONBLOCK on it's STDIN depending on what kind of input it is made
// of (see https://github.com/nodejs/help/issues/2663).
. . .
// "tracked" at https://github.com/aws/aws-cdk/issues/5187
Reproduction Steps
(using powershell) This follows example from https://docs.aws.amazon.com/cdk/latest/guide/ecs_example.htmlmkdir myfolder
cd myfolder
cdk init --language python
.env\Scripts\activate.ps1
python -m pip install -r requirements.txt
cdk synth
What did you expect to happen?
return an empty stack with no error
What actually happened?
(.env) p$[myfolder]> cdk synth D:\d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii\jsii-runtime.js:13295
throw e;
^
Error: EOF: end of file, read
at Object.readSync (fs.js:592:3)
at SyncStdio.readLine (D:\d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii\jsii-runtime.js:13278:33)
at InputOutput.read (D:\d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii\jsii-runtime.js:13203:34)
at KernelHost.run (D:\d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii\jsii-runtime.js:13021:32)
at Immediate.<anonymous> (D:\d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii\jsii-runtime.js:13029:37)
at processImmediate (internal/timers.js:461:21) {
errno: -4095,
syscall: 'read',
code: 'EOF'
}
Resources:
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Modules: aws-cdk=1.69.0,@aws-cdk/cloud-assembly-schema=1.69.0,@aws-cdk/core=1.69.0,@aws-cdk/cx-api=1.69.0,@aws-cdk/region-info=1.69.0,jsii-runtime=Python/3.7.4
Metadata:
aws:cdk:path: myfolder/CDKMetadata/Default
Condition: CDKMetadataAvailable
Environment
- CLI Version : aws-cli/2.0.61 Python/3.7.7 Windows/10 exe/AMD64
- Framework Version: 1.69.0 (build 2b474b9)
- Node.js Version: v14.15.0
- OS : Windows 10
- Language (Version): python 3.7.4
Other
Error is persistent and easily reproduced on my machine. I re-installed/upgraded aws cli to 2.0.61 I re-installed node.js I re-installed cdk Note: As noted in the section above, this ‘hello world’ level error still creates a stack. However, when more code is added, more jsii errors occur and the stack fails. Also, code that errors on my machine runs normally on other machines.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 17 (8 by maintainers)
@RomainMuller Workaround: replace jsii 1.14.x distro in site-packages with 1.12 or 1.13 distro. After swap, errors stop.
TL;DR I was able to swap out the 1.14.1 distro in the site-packages for the jsii 1.12 distro. Same code that consistently threw the error reported above, now runs with no errors. This behavior corresponds to the the reports from other devs (where I got the jsii 1.12 distro) that they had no issues with the code.
Rolling back node.js or cdk to earlier versions had no effect because pip install - r requirements.txt always installed the 1.14.x distro.
Longer term fix: move dev platform from Windows to linux.