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 /bin/sh EAGAIN #1578

Closed
firedev opened this issue Jul 10, 2017 · 7 comments
Closed

Error: spawn /bin/sh EAGAIN #1578

firedev opened this issue Jul 10, 2017 · 7 comments

Comments

@firedev
Copy link

firedev commented Jul 10, 2017

  • Etcher version:
    1.0.0
  • Operating system and architecture:
    macOS
  • Image flashed:
    I just left it open over a weekend, and noticed it now shows an error box
  • Do you see any meaningful error information in the DevTools?
/Applications/Etcher.app/Contents/Resources/app.asar/node_modules/raven-js/dist/raven.js:51
{"code":"EAGAIN","errno":"EAGAIN","syscall":"spawn /bin/sh","path":"sh","spawnargs":["-c","\"/var/folders/jz/2t5hs51j0rs17q6c3psdnlk00000gn/T/tmp-76428Eg5R0bc62QgQ.sh\""],"cmd":"\"/var/folders/jz/2t5hs51j0rs17q6c3psdnlk00000gn/T/tmp-76428Eg5R0bc62QgQ.sh\""}

screen shot 2017-07-10 at 08 36 03

@lurch
Copy link
Contributor

lurch commented Jul 10, 2017

@jhermsmeier Do you think this might have the same cause as #1571 ?

@jhermsmeier
Copy link
Contributor

Could be the underlying cause, but EAGAIN in this case would hint at the spawn / child process timing out I believe – this is something we should handle gracefully, and as the error says, try again.

@jviotti
Copy link
Contributor

jviotti commented Jul 10, 2017

The child_process.spawn() function uses uv_spawn(), which is based on fork(), which says:

     [EAGAIN]           The system-imposed limit on the total number of processes under execution would be exceeded.  This limit is configura-
                        tion-dependent.

     [EAGAIN]           The system-imposed limit MAXUPRC (<sys/param.h>) on the total number of processes under execution by a single user
                        would be exceeded.

This hints me that there might be something keeping the temporary script processes up and running even when they are not longer needed (maybe the perl bug we fixed recently?), and therefore exhausting the system process limit during the weekend.

@firedev Did you notice high CPU usage after the weekend?

@jviotti jviotti added this to the 1.1 milestone Jul 10, 2017
@firedev
Copy link
Author

firedev commented Jul 10, 2017

@jviotti I can't say for sure, the notebook was mostly closed. I don't think I have noticed anything unusual today. Anything specific I should pay attention to the next time I see this?

@jviotti
Copy link
Contributor

jviotti commented Jul 10, 2017

@firedev I'd advice to open the Activity Monitor, and take a look at how many processes are active. Also take a look at the process list, to see if you can identify a single application with way too many processes (could be Etcher, or it could be something else.)

@Sawaba
Copy link

Sawaba commented Jul 11, 2017

@firedev - I'd also suggest looking at how many of these tmp-*.sh files are getting created in /var - that's how I noticed my issue (#1571). I left Etcher running overnight and had over 60,000 identical 6kb files the next day.

@jviotti
Copy link
Contributor

jviotti commented Jul 12, 2017

@Sawaba This PR (#1574) should solve that particular issue. What OS are you in? We can send you the link to the snapshot build created by the CI services for that PR once it gets merged, so we can test if it made things better.

jviotti added a commit to balena-io-modules/drivelist that referenced this issue Jul 18, 2017
EAGAIN errors come from `uv_spawn()`, and may happen because of the
following reasons (from the man pages):

- The system-imposed limit on the total number of processes under
  execution would be exceeded. This limit is configuration-dependent

- The system-imposed limit MAXUPRC (<sys/param.h>) on the total number
  of processes under execution by a single user would be exceeded

This commit retries the spawning operation various times before giving
up with a human friendly error message.

See: balena-io/etcher#1578
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit to balena-io-modules/drivelist that referenced this issue Jul 18, 2017
EAGAIN errors come from `uv_spawn()`, and may happen because of the
following reasons (from the man pages):

- The system-imposed limit on the total number of processes under
  execution would be exceeded. This limit is configuration-dependent

- The system-imposed limit MAXUPRC (<sys/param.h>) on the total number
  of processes under execution by a single user would be exceeded

This commit retries the spawning operation various times before giving
up with a human friendly error message.

Change-Type: patch
See: balena-io/etcher#1578
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit to balena-io-modules/drivelist that referenced this issue Jul 18, 2017
EAGAIN errors come from `uv_spawn()`, and may happen because of the
following reasons (from the man pages):

- The system-imposed limit on the total number of processes under
  execution would be exceeded. This limit is configuration-dependent

- The system-imposed limit MAXUPRC (<sys/param.h>) on the total number
  of processes under execution by a single user would be exceeded

This commit retries the spawning operation various times before giving
up with a human friendly error message.

Change-Type: patch
See: balena-io/etcher#1578
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit to balena-io-modules/drivelist that referenced this issue Jul 18, 2017
EAGAIN errors come from `uv_spawn()`, and may happen because of the
following reasons (from the man pages):

- The system-imposed limit on the total number of processes under
  execution would be exceeded. This limit is configuration-dependent

- The system-imposed limit MAXUPRC (<sys/param.h>) on the total number
  of processes under execution by a single user would be exceeded

This commit retries the spawning operation various times before giving
up with a human friendly error message.

Change-Type: patch
See: balena-io/etcher#1578
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit that referenced this issue Jul 18, 2017
This new version contains the following PRs that we're interested about:

- balena-io-modules/drivelist#196

To reduce the amount of debug logging we produce (see
#1600).

- balena-io-modules/drivelist#195

To properly handle spawning EAGAIN errors.

Fixes: #1578
Change-Type: patch
Changelog-Entry: Retry various times on EAGAIN when spawning drive scanning scripts.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit that referenced this issue Jul 19, 2017
This new version contains the following PRs that we're interested about:

- balena-io-modules/drivelist#196

To reduce the amount of debug logging we produce (see
#1600).

- balena-io-modules/drivelist#195

To properly handle spawning EAGAIN errors.

Fixes: #1578
Change-Type: patch
Changelog-Entry: Retry various times on EAGAIN when spawning drive scanning scripts.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit that referenced this issue Jul 19, 2017
This new version contains the following PRs that we're interested about:

- balena-io-modules/drivelist#196

To reduce the amount of debug logging we produce (see
#1600).

- balena-io-modules/drivelist#195

To properly handle spawning EAGAIN errors.

Fixes: #1578
Change-Type: patch
Changelog-Entry: Retry various times on EAGAIN when spawning drive scanning scripts.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit that referenced this issue Jul 19, 2017
This new version contains the following PRs that we're interested about:

- balena-io-modules/drivelist#196

To reduce the amount of debug logging we produce (see
#1600).

- balena-io-modules/drivelist#195

To properly handle spawning EAGAIN errors.

Fixes: #1578
Change-Type: patch
Changelog-Entry: Retry various times on EAGAIN when spawning drive scanning scripts.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants