question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JsiiErrors / EAGAIN when using node>=13.2 with Python, Java & .NET

See original GitHub issue

When deploying, some file is temporarily unavailable.

Reproduction Steps

from aws_cdk import (
    core
)

class Stack(core.Stack):
    def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
        super().__init__(scope, id, **kwargs)

app = core.App()
stack = Stack(app, "Test")

app.synth()

Then deploy

$ cdk deploy --app "python stack.py"

Error Log

$ cdk deploy --app "python stack.py"
internal/fs/utils.js:220
    throw err;
    ^

Error: EAGAIN: resource temporarily unavailable, read
    at Object.readSync (fs.js:516:3)
    at SyncStdio.readLine (/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13322:25)
    at InputOutput.read (/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13272:34)
    at KernelHost.run (/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7228:32)
    at Immediate.<anonymous> (/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7236:37)
    at processImmediate (internal/timers.js:439:21) {
  errno: -11,
  syscall: 'read',
  code: 'EAGAIN'
}
Traceback (most recent call last):
  File "stack_bugreport.py", line 1, in <module>
    from aws_cdk import (
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/aws_cdk/aws_apigateway/__init__.py", line 548, in <module>
    import aws_cdk.aws_certificatemanager
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/aws_cdk/aws_certificatemanager/__init__.py", line 104, in <module>
    import aws_cdk.aws_cloudformation
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/aws_cdk/aws_cloudformation/__init__.py", line 125, in <module>
    import aws_cdk.aws_iam
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/aws_cdk/aws_iam/__init__.py", line 169, in <module>
    import aws_cdk.region_info
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/aws_cdk/region_info/__init__.py", line 113, in <module>
    __jsii_assembly__ = jsii.JSIIAssembly.load("@aws-cdk/region-info", "1.18.0", __name__, "region-info@1.18.0.jsii.tgz")
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_runtime.py", line 40, in load
    _kernel.load(assembly.name, assembly.version, os.fspath(assembly_path))
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 209, in load
    self.provider.load(LoadRequest(name=name, version=version, tarball=tarball))
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 330, in load
    return self._process.send(request, LoadResponse)
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 310, in send
    self._next_message(), _ProcessResponse_R
  File "/home/drluke/work/di-client-api-message-dispatcher/venv/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 261, in _next_message
    return json.loads(self._process.stdout.readline(), object_hook=ohook)
  File "/usr/lib/python3.7/json/__init__.py", line 361, in loads
    return cls(**kw).decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Subprocess exited with error 1

Workaround for the time being

Downgrade node to version 12.13.1

Environment

  • CLI Version : 1.18.0 (build bc924bc)
  • Framework Version: 1.18.0
  • OS : Linux
  • Language : Python

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:16
  • Comments:45 (22 by maintainers)

github_iconTop GitHub Comments

13reactions
pd5rmcommented, Nov 26, 2019

FYI, nodejs v13.1.0 works as well, but 13.2.0 fails.

5reactions
RomainMullercommented, Nov 27, 2019

Okay - so we have a smoking gun - it appears that there is a behavior change in node 13.2 that causes the symptoms. We have to investigate deeper to understand whether node 13.2 reveals a latent bug in our code, or whether we should report a bug to them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Python, Node.js, Java, .NET with Oracle Autonomous ...
Our new LiveLabs workshop provides examples of connecting to the Autonomous Database and executing SQL queries using multiple programming ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found