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

fs.readSync intermittent error #191

Closed
andrewbeckman opened this issue Aug 17, 2022 · 7 comments · Fixed by #193
Closed

fs.readSync intermittent error #191

andrewbeckman opened this issue Aug 17, 2022 · 7 comments · Fixed by #193

Comments

@andrewbeckman
Copy link

andrewbeckman commented Aug 17, 2022

When we run yarn twirpscript, we are intermittently getting the following error:

[TwirpScript] Using configuration file at '/home/brian/rundoo/web/.twirp.json'.
[TwirpScript] Protobuf Compiler Error: 

node:fs:747
  handleErrorFromBinding(ctx);
  ^

Error: EAGAIN: resource temporarily unavailable, read
    at Object.readSync (node:fs:747:3)
    at tryReadSync (node:fs:447:20)
    at readFileSync (node:fs:493:19)
    at file:///home/brian/rundoo/web/node_modules/twirpscript/compiler.js:4:15
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:541:24)
    at async loadESM (node:internal/process/esm_loader:83:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  errno: -11,
  syscall: 'read',
  code: 'EAGAIN'
}

I unfortunately don't have repeatable steps to reproduce, but here's our .twirp.json:

{
  "root": "../rd/rpc",
  "dest": "src/rpc_clients",
  "language": "typescript"
}
@tatethurston
Copy link
Owner

Thanks @andrewbeckman. Did you notice this after updating to a particular version or has this happened intermittently for awhile?

@andrewbeckman
Copy link
Author

Thanks @andrewbeckman. Did you notice this after updating to a particular version or has this happened intermittently for awhile?

We have noticed it across versions for a while. We just updated to the latest version and are still seeing it.

@tatethurston
Copy link
Owner

Thanks. Could you let me know the node version and OS you’re seeing this on?

@andrewbeckman
Copy link
Author

Thanks. Could you let me know the node version and OS you’re seeing this on?

So on the team we have mostly Macs running macOS Monterey and node LTS (version 16.x). We have one Linux user running node 18.6.0. We all experience it intermittently, but the Linux user experiences it with greater frequency.

@tatethurston
Copy link
Owner

Awesome, thanks. I'll look into this.

@tatethurston
Copy link
Owner

I haven't been able to reproduce this yet, but doing some research I found this stackoverflow thread that references the same EAGIN issue: https://stackoverflow.com/questions/30441025/read-all-text-from-stdin-to-a-string

I'm going to publish an update replacing process.stdin.fd with 0. The two should be equivalent, but at least on Node v11 some users reported this same problem.

@tatethurston
Copy link
Owner

This is published in v0.0.62. LMK if this resolves the issue @andrewbeckman, and if not, I'll do some deeper digging into node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants