Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

spawn pgrep EAGAIN . expo-cli@3.17.21 process not killed #1852

Closed
diegolaciar opened this issue Apr 10, 2020 · 14 comments
Closed

spawn pgrep EAGAIN . expo-cli@3.17.21 process not killed #1852

diegolaciar opened this issue Apr 10, 2020 · 14 comments

Comments

@diegolaciar
Copy link

diegolaciar commented Apr 10, 2020

Created from the repo expo,
@see: expo/expo#7772

Description

expo don't close the process properly.
after the error, "expo start " command cant start expo and show the same error.

expo starts, only if I clear the .expo folder like:

rm -rf .expo/

doing that , expo start on new port.
ex: instead of 19001, starts on 19002, or 19003, 19004.... until I restart the machine.

Expected Behavior

I spect normal, success process killing. like.

Stopping packager...
› Closing Expo server
› Stopping Metro bundler
Packager stopped.

Observed Behavior

Stopping packager...
› Closing Expo server
› Stopping Metro bundler
Error: spawn pgrep EAGAIN
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Environment

Expo CLI 3.17.21 environment info:
System:
OS: macOS 10.15.3
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
npm: 6.14.2 - ~/.nvm/versions/node/v12.16.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
expo: ^37.0.0 => 37.0.6
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4
react-navigation: ^3.13.0 => 3.13.0

  • device Phone/android, motoG3:
    also happens on ios simulator.
@brentvatne
Copy link
Member

hello! if anyone else is having this issue please let me know! i am very confused and do not know what is causing it. would love to get more information

@diegolaciar
Copy link
Author

diegolaciar commented Apr 17, 2020

hi @brentvatne,

I have this issue every day.

To start expo, I do this.

  1. rm -rf .expo/ directory
  2. expo start
  3. when I kill de process (CTRL+C), the process don't close and I got the error
  4. If I start the expo, I got the error, again. So, I have to do a rm -rf .expo/
    4.1. I run this command to look for the process ID. lsof -i tcp:19001
    4.2 I do a kill -9 <the process Id here>
  5. expo start and metro can run again on port 19001.

Let me know what can I do to try help you to fix this.

Regards,
Diego

@brentvatne
Copy link
Member

i believe @byCedric resolved this recently. let me know if it's still happening for you @diegolaciar

@felipellrocha
Copy link

@brentvatne What was the solution? I'm running into this as well

@brentvatne
Copy link
Member

#1876 - this should have fixed it. we haven't had any reports since then. what version of expo-cli were you using when this happened?

@felipellrocha
Copy link

I'm on 3.27.8. It's keeping me from building as well:

$ expo build:ios

....

Building optimized bundles and generating sourcemaps...
Error: spawn pgrep EAGAIN
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

@brentvatne
Copy link
Member

@felipellrocha - try EXPO_USE_DEV_SERVER=true expo build:ios

@felipellrocha
Copy link

Any idea what the issue was (or what the solution was)? It would provide a starting ground in which I could start helping debug. (also, this just happened)

@brentvatne
Copy link
Member

my mistake, this was not related to #1876 after all. #2322 is more related. @fson has more context on the issue, but i would appreciate knowing if the above command i suggested works for you

@felipellrocha
Copy link

Ah, this worked! :)

@brentvatne
Copy link
Member

@felipellrocha that's great to hear! you can enable this by default in your shell by setting that env variable in your profile. we'll likely roll this out by default soon

@felipellrocha
Copy link

One question that I have is would it be safe for me to publish a build with EXPO_USE_DEV_SERVER=true expo build:ios? Currently it's the only way that works, but _DEV_SERVER makes it sound like this wouldn't be a safe option

@aloukissas
Copy link

This fixed the issues I had as well, but would love to know (a) why this breaks w/o this flag and (b) what does this flag do? @brentvatne care to elaborate? PS:

$ expo-cli --version
3.27.10

@FrederickEngelhardt
Copy link

FrederickEngelhardt commented Oct 29, 2020

Is this error going to be resolved? Had it for about 1.5 years. (and have upgraded to latest expo-cli about every 3 months)

Happens whenever expo start is run and then exited.

Another issue is expo publish breaks because it is creating a .expo folder and calls a child expo process which hits this same error. Had to open another window while it was running to remove the folder again IE rm -rf .expo/

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

No branches or pull requests

5 participants