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

ECONNRESET on restarts #1195

Closed
Labels
can't replicate needs more info not enough information in issue to debug

Comments

@roy7
Copy link

roy7 commented Dec 26, 2017

  • nodemon -v:
  • node -v:
  • Operating system/terminal environment:
  • Command you ran:
jroy:/code/leela-zero-server$ node node_modules/nodemon/bin/nodemon.js -v
1.14.3
jroy:/code/leela-zero-server$ node -v
v8.9.3
jroy@sjeng:/code/leela-zero-server$ uname -a
Linux 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

node node_modules/nodemon/bin/nodemon.js --watch test.js test.js >> log.test 2>&1

Expected behaviour

Restart app cleanly.

Actual behaviour

[nodemon] restarting due to changes...
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1024:11)
    at Pipe.onread (net.js:615:25)

Steps to reproduce

I'm not sure how to further debug this to help provide some info back. It's also possible it's my own app and not nodemon. I used version 1.12.1 for a while and it would never restart any more when I changed my .js file. Now with the upgrade to 1.14.3 it does auto restart again, but I rarely get this crash when I "touch test.js". Previously I would reattach my screen session and enter 'rs' to the console. In either situation, only maybe 1 out of 20 restarts would cause a crash.

In attempts to catch this error if it's happening inside my own app, I added this:

process.on('uncaughtException', (err) => {
    console.error('Caught exception: ' + err);
});

But it isn't catching this restart related ECONNRESET error. I'm unsure if I'm catching it wrong to try and debug my own app, or if the error is being thrown my nodemon itself?


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

--------------
node: v8.9.3
nodemon: 1.14.3
command: /usr/bin/node /home/jroy/code/leela-zero-server/node_modules/nodemon/bin/nodemon.js --dump --watch test.js test.js
cwd: /home/jroy/code/leela-zero-server
OS: linux x64
--------------
{ run: false,
  system: { cwd: '/home/jroy/code/leela-zero-server' },
  required: false,
  dirs: [ '/home/jroy/code/leela-zero-server/test.js' ],
  timeout: 1000,
  options:
   { dump: true,
     watch: [ 'test.js', re: /test\.js/ ],
     ignore:
      [ '**/.git',
        '**/.nyc_output',
        '**/.sass-cache',
        '**/bower_components',
        '**/coverage',
        '**/node_modules',
        re: /.*.*\/\.git|.*.*\/\.nyc_output|.*.*\/\.sass\-cache|.*.*\/bower_components|.*.*\/coverage|.*.*\/node_modules/ ],
     ignoreRoot:
      [ '**/.git',
        '**/.nyc_output',
        '**/.sass-cache',
        '**/bower_components',
        '**/coverage',
        '**/node_modules' ],
     restartable: 'rs',
     colours: true,
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     runOnChangeOnly: false,
     verbose: false,
        '**/coverage',
        '**/node_modules',
        re: /.*.*\/\.git|.*.*\/\.nyc_output|.*.*\/\.sass\-cache|.*.*\/bower_components|.*.*\/coverage|.*.*\/node_modules/ ],
     ignoreRoot:
      [ '**/.git',
        '**/.nyc_output',
        '**/.sass-cache',
        '**/bower_components',
        '**/coverage',
        '**/node_modules' ],
     restartable: 'rs',
     colours: true,
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     runOnChangeOnly: false,
     verbose: false,
     signal: 'SIGUSR2',
     stdout: true,
     watchOptions: {},
     execOptions:
      { script: 'test.js',
        exec: 'node',
        args: [],
        scriptPosition: 0,
        nodeArgs: undefined,
        execArgs: [],
        ext: 'js,json',
        env: {} },
     monitor:
      [ 'test.js',
        '!**/.git',
        '!**/.nyc_output',
        '!**/.sass-cache',
        '!**/bower_components',
        '!**/coverage',
        '!**/node_modules' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [ '/home/jroy/code/leela-zero-server/package.json' ],
  watchInterval: null,
  signal: 'SIGUSR2',
  command:
   { raw: { executable: 'node', args: [ 'test.js' ] },
     string: 'node test.js' } }
--------------

@remy
Copy link
Owner

remy commented Dec 27, 2017

Can you provide the test.js file too? Or a pared down version at least?

@roy7
Copy link
Author

roy7 commented Dec 27, 2017

Could I send it to you privately somehow and not copy/paste the whole thing into here? Thanks.

@remy
Copy link
Owner

remy commented Dec 27, 2017 via email

@remy
Copy link
Owner

remy commented Dec 27, 2017

I've got your email and managed to get a version of the code running, but I had to guess at the versions of dependencies and obviously I don't have your external dependencies (like the network.gz file). I couldn't replicate the problem though.

I suspect the cause is that your server isn't fully shutting down (cleanly) before it's started again. One thing that might help narrow down the issue is whether nodemon is able to restart the server after the uncaught ECONNRESET, or whether (though I doubt) this error is thrown from inside of nodemon.

Also, as a test: if you start nodemon and then change a file (without doing anything on your server), do you still get the same error?

In your code (the version you sent to me), if you stripped out all the routes, do you get the same error?

I can't think of where it might be coming from inside of nodemon, as the error is (IIRC) about network connections being reset and an error occuring when you try to reach that network. So that's why I suspect something inside your own code. I guess another test you could try is to use node to run your process, then ctrl+c, then start it immediately to see what you get (though it's possible the tear down is cleaner when just using node).

Let me know how you get on.

@remy remy added can't replicate needs more info not enough information in issue to debug labels Dec 27, 2017
@roy7
Copy link
Author

roy7 commented Dec 27, 2017

I'll do some tests to see what I can come up with.

Actually since I've not been using nodemon the last day or two, I just started it up and then did a 'rs' after a second or two, then a second 'rs', and the 2nd crashed. When this happens, nodemon exits to the command line.

[nodemon] 1.14.3
[nodemon] to restart at any time, enter rs
[nodemon] watching: test.js
[nodemon] starting node test.js
197 networks.
1464917 games.
listening on 8081
Current best hash 509e52021b827fcda2771ee3a81b5397d816a0218b3355a15de69b783477d495
[nodemon] starting node test.js
197 networks.
1464922 games.
listening on 8081
Current best hash 509e52021b827fcda2771ee3a81b5397d816a0218b3355a15de69b783477d495
events.js:183
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at Pipe.onread (net.js:615:25)

This was with

node node_modules/nodemon/bin/nodemon.js --watch test.js test.js >> log.test 2>&1

@roy7
Copy link
Author

roy7 commented Dec 27, 2017

If my program "normally" crashes, nodemon will wait for a file to change and then try to restart the program. But in this situation where the crash happens because nodemon is trying to restart the process, nodemon itself always exits to the command line and is no longer running.

@roy7
Copy link
Author

roy7 commented Dec 27, 2017

I copied the program over and ran it off a different port # to not interfere with the normal operation of things. If I just 'rs' over and over every few seconds, I can pretty much guarantee an eventual error as above. Is there any extra debugging options/flags I can set perhaps to help isolate with?

Ok "pretty much guarantee" is over stating it. It doesn't crash as easily as I'd like to reproduce it lol. The earlier test I got lucky it did it in the first few tries.

@roy7
Copy link
Author

roy7 commented Dec 27, 2017

When it wants to cooperate:

jroy@sjeng:~/code/leela-zero-server$ node node_modules/nodemon/bin/nodemon.js --watch a a
[nodemon] 1.14.3
[nodemon] to restart at any time, enter rs
[nodemon] watching: a
[nodemon] starting node a
197 networks.
1465241 games.
listening on 8082
rs
Current best hash 509e52021b827fcda2771ee3a81b5397d816a0218b3355a15de69b783477d495
[nodemon] starting node a
197 networks.
1465241 games.
listening on 8082
Current best hash 509e52021b827fcda2771ee3a81b5397d816a0218b3355a15de69b783477d495
rs
[nodemon] starting node a
197 networks.
1465241 games.
listening on 8082
Current best hash 509e52021b827fcda2771ee3a81b5397d816a0218b3355a15de69b783477d495
rs
events.js:183
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at Pipe.onread (net.js:615:25)
jroy@sjeng:~/code/leela-zero-server$

@roy7
Copy link
Author

roy7 commented Dec 27, 2017

I tried adding longjohn to my script, but it made no difference. So instead I added longjohn to node_modules/nodemon/bin/nodemon.js and that changes the error message to:

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at Pipe.onread (net.js:615:25)

at _destroy (internal/streams/destroy.js:34:15)
at Socket._destroy (net.js:561:3)
at Socket.destroy (internal/streams/destroy.js:32:8)
at Pipe.onread (net.js:615:17)

@remy
Copy link
Owner

remy commented Dec 28, 2017

Bit of a shot in the dark, but can you try with nodemon --no-update-notifier and run the same process, and report back?

@roy7
Copy link
Author

roy7 commented Dec 28, 2017

node: bad option: --no-update-notifier

@roy7
Copy link
Author

roy7 commented Dec 28, 2017

I'm trying to find a better solution than longjohn to find the problem spot. Re: mattinsler/longjohn#31.

@roy7
Copy link
Author

roy7 commented Dec 28, 2017

Adding the process.on() catch to nodemon.js itself does catch the error and lets things continue.

rs
Caught exception: Error: read ECONNRESET
[nodemon] starting node a
212 networks.
1492972 games.
listening on 8082

@roy7
Copy link
Author

roy7 commented Dec 28, 2017

I installed the debug package and run the script with DEBUG=*, not much more info but:

rs
nodemon bus emit: restart +2s
Caught exception: Error: read ECONNRESET
/home/jroy/code/leela-zero-server/node_modules/longjohn/dist/longjohn.js:192
throw e;
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at Pipe.onread (net.js:615:25)

at _destroy (internal/streams/destroy.js:34:15)
at Socket._destroy (net.js:561:3)
at Socket.destroy (internal/streams/destroy.js:32:8)
at Pipe.onread (net.js:615:17)

@roy7
Copy link
Author

roy7 commented Dec 28, 2017

Comparing to restarts when it doesn't crash, the crash is between these two lines.

nodemon bus emit: restart +21s
nodemon bus.emit(exit) via SIGUSR2 +28ms

@remy
Copy link
Owner

remy commented Dec 29, 2017

If you're comfortable editing the nodemon source to test, can you find lib/monitor/run.js and comment out the line that reads bus.emit('error', error); - and re-run your tests?

@roy7
Copy link
Author

roy7 commented Dec 30, 2017

Taking that line out seems to make the error reproducible every time I enter 'rs'.

@roy7
Copy link
Author

roy7 commented Dec 30, 2017

Ok, not every time, but it seems very frequent now.

@remy
Copy link
Owner

remy commented Dec 30, 2017

Can you test with [email protected] and when you capture the error, can you include the full output from the point when the command was started to when you were thrown back to the prompt (using 1.14.6). Thanks.

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

jroy@sjeng:~/code/leela-zero-server$ DEBUG=* node --trace-warnings node_modules/nodemon/bin/nodemon.js  --watch a a
  nodemon bus new listener: reset (0) +0ms
  nodemon bus new listener: reset (0) +4ms
  nodemon bus new listener: quit (0) +31ms
  nodemon bus new listener: quit (0) +1ms
  nodemon bus new listener: restart (0) +0ms
  nodemon bus new listener: restart (0) +0ms
  nodemon bus new listener: reset (2) +2ms
  nodemon bus emit: reset +2ms
  nodemon resetting watchers +0ms
  nodemon reset +1ms
  nodemon config: dirs [ '/home/jroy/code/leela-zero-server/a' ] +90ms
[nodemon] 1.14.6
[nodemon] to restart at any time, enter `rs`
  nodemon bus new listener: error (0) +11ms
  nodemon bus new listener: error (0) +1ms
[nodemon] watching: a
[nodemon] starting `node a`
  nodemon spawning node a +11ms
  nodemon bus new listener: exit (0) +6ms
  nodemon bus new listener: exit (0) +0ms
  nodemon start watch on: a +1ms
  nodemon start watch on: /home/jroy/code/leela-zero-server/a +0ms
  nodemon ignored [ '**/.git',
  '**/.nyc_output',
  '**/.sass-cache',
  '**/bower_components',
  '**/coverage',
  '**/node_modules',
  re: /.*.*\/\.git|.*.*\/\.nyc_output|.*.*\/\.sass\-cache|.*.*\/bower_components|.*.*\/coverage|.*.*\/node_modules/ ] +0ms
  nodemon:watch watching dir: /home/jroy/code/leela-zero-server/a +34ms
  nodemon watch is complete +1ms
  express:application set "x-powered-by" to true +0ms
  express:application set "etag" to 'weak' +8ms
  express:application set "etag fn" to [Function: generateETag] +7ms
  express:application set "env" to 'development' +1ms
  express:application set "query parser" to 'extended' +0ms
  express:application set "query parser fn" to [Function: parseExtendedQueryString] +1ms
  express:application set "subdomain offset" to 2 +0ms
  express:application set "trust proxy" to false +0ms
  express:application set "trust proxy fn" to [Function: trustNone] +1ms
  express:application booting in development mode +1ms
  express:application set "view" to [Function: View] +0ms
  express:application set "views" to '/home/jroy/code/leela-zero-server/views' +0ms
  express:application set "jsonp callback name" to 'callback' +0ms
  express:application set "view engine" to 'pug' +1ms
  express:application set "trust proxy" to true +0ms
  express:application set "trust proxy fn" to [Function] +0ms
  express:router use '/' query +6ms
  express:router:layer new '/' +0ms
  express:router use '/' expressInit +2ms
  express:router:layer new '/' +0ms
  express:router use '/' urlencodedParser +0ms
  express:router:layer new '/' +1ms
  express:router use '/' <anonymous> +3ms
  express:router:layer new '/' +0ms
  express:router use '/view/player' serveStatic +1ms
  express:router:layer new '/view/player' +1ms
  express:router use '/viewmatch/player' serveStatic +0ms
  express:router:layer new '/viewmatch/player' +0ms
  express:router use '/view/wgo' serveStatic +1ms
  express:router:layer new '/view/wgo' +0ms
  express:router use '/viewmatch/wgo' serveStatic +0ms
  express:router:layer new '/viewmatch/wgo' +1ms
  express:router use '/best-network-hash' <anonymous> +27ms
  express:router:layer new '/best-network-hash' +1ms
  express:router use '/best-network' <anonymous> +0ms
  express:router:layer new '/best-network' +0ms
  express:router use '/best-network-old' <anonymous> +0ms
  express:router:layer new '/best-network-old' +0ms
  express:router:route new '/request-match' +1ms
  express:router:layer new '/request-match' +0ms
  express:router:route post '/request-match' +0ms
  express:router:layer new '/' +1ms
  express:router:route new '/submit-network' +0ms
  express:router:layer new '/submit-network' +0ms
  express:router:route post '/submit-network' +0ms
  express:router:layer new '/' +0ms
  express:router:route new '/submit-match' +1ms
  express:router:layer new '/submit-match' +0ms
  express:router:route post '/submit-match' +0ms
  express:router:layer new '/' +1ms
  express:router:route new '/submit' +0ms
  express:router:layer new '/submit' +0ms
  express:router:route post '/submit' +0ms
  express:router:layer new '/' +0ms
  express:router:route new '/' +0ms
  express:router:layer new '/' +1ms
  express:router:route get '/' +0ms
  express:router:layer new '/' +0ms
  express:router:route new '/get-task/:version(\\d+)' +0ms
  express:router:layer new '/get-task/:version(\\d+)' +0ms
  express:router:route get '/get-task/:version(\\d+)' +1ms
  express:router:layer new '/' +0ms
  express:router:route new '/view/:hash(\\w+)' +0ms
  express:router:layer new '/view/:hash(\\w+)' +0ms
  express:router:route get '/view/:hash(\\w+)' +0ms
  express:router:layer new '/' +0ms
  express:router:route new '/match-games/:matchid(\\w+)' +0ms
  express:router:layer new '/match-games/:matchid(\\w+)' +1ms
  express:router:route get '/match-games/:matchid(\\w+)' +0ms
  express:router:layer new '/' +0ms
  express:router:route new '/viewmatch/:hash(\\w+)' +0ms
  express:router:layer new '/viewmatch/:hash(\\w+)' +0ms
  express:router:route get '/viewmatch/:hash(\\w+)' +1ms
  express:router:layer new '/' +0ms
  express:router:route new '/data/elograph.json' +0ms
  express:router:layer new '/data/elograph.json' +0ms
  express:router:route get '/data/elograph.json' +0ms
  express:router:layer new '/' +0ms
246 networks.
1564069 games.
listening on 8082
Current best hash e5e72b39f3c201af91fcd0a6230da7756abab30b59eed33fb79205b3fe03a870
rs
  nodemon bus emit: restart +11s
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1024:11)
    at Pipe.onread (net.js:615:25)
jroy@sjeng:~/code/leela-zero-server$

@remy
Copy link
Owner

remy commented Dec 31, 2017

Okay, no clues…

Can you replicate using this as your script?

require('http').createServer((req, res) => res.end('ok')).listen(8000);

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

Wow. Actually, yes!

jroy@sjeng:/code/leela-zero-server$ cat > b
require('http').createServer((req, res) => res.end('ok')).listen(8000);
jroy@sjeng:/code/leela-zero-server$ DEBUG=* node --trace-warnings node_modules/nodemon/bin/nodemon.js --watch b b
nodemon bus new listener: reset (0) +0ms
nodemon bus new listener: reset (0) +6ms
nodemon bus new listener: quit (0) +82ms
nodemon bus new listener: quit (0) +0ms
nodemon bus new listener: restart (0) +0ms
nodemon bus new listener: restart (0) +0ms
nodemon bus new listener: reset (2) +15ms
nodemon bus emit: reset +4ms
nodemon resetting watchers +1ms
nodemon reset +0ms
nodemon config: dirs [ '/home/jroy/code/leela-zero-server/b' ] +186ms
[nodemon] 1.14.6
[nodemon] to restart at any time, enter rs
nodemon bus new listener: error (0) +7ms
nodemon bus new listener: error (0) +0ms
[nodemon] watching: b
[nodemon] starting node b
nodemon spawning node b +2ms
nodemon bus new listener: exit (0) +10ms
nodemon bus new listener: exit (0) +0ms
nodemon start watch on: b +0ms
nodemon start watch on: /home/jroy/code/leela-zero-server/b +1ms
nodemon ignored [ '/.git',
'
/.nyc_output',
'/.sass-cache',
'
/bower_components',
'/coverage',
'
/node_modules',
re: /../.git|../.nyc_output|../.sass-cache|../bower_components|../coverage|../node_modules/ ] +1ms
nodemon:watch watching dir: /home/jroy/code/leela-zero-server/b +36ms
nodemon watch is complete +1ms
rs
nodemon bus emit: restart +2s
nodemon bus.emit(exit) via SIGUSR2 +42ms
nodemon bus emit: exit +0ms
[nodemon] starting node b
nodemon spawning node b +0ms
nodemon bus new listener: exit (1) +4ms
nodemon start watch on: b +0ms
nodemon:watch early exit on watch, still watching (1) +1ms
rs
nodemon bus emit: restart +2s
events.js:183
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at Pipe.onread (net.js:615:25)
jroy@sjeng:/code/leela-zero-server$

@remy
Copy link
Owner

remy commented Dec 31, 2017

Okay, in this case, something very strange is afoot!

So that we can rule out a socket from the child process (the simple http server), can you try with the following script instead:

console.log(__filename)

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

Can't seem to get that one to crash. I also notice it now says:

[nodemon] clean exit - waiting for changes before restart

which the http server version never does. So maybe there's an issue/bug with the node http server not exiting cleanly/properly?

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

I'm using Node 8.9.3 btw.

@remy
Copy link
Owner

remy commented Dec 31, 2017

Okay, I wonder if there's something special about the OS and the way nodemon is forking.

Can you try this command (with the http simple server code - where the filename is b):

DEBUG=* node --trace-warnings node_modules/bin/nodemon.js --watch b -x 'node b'

@remy
Copy link
Owner

remy commented Dec 31, 2017

Note that running the command with -x 'node b' internally nodemon is using a spawn command rather than a fork. I doubt if this is the cause, but it'll help rule it out (again, I can't replicate this at all on my machine, hence why the needle/haystack hunt!)

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

jroy@sjeng:/code/leela-zero-server$ DEBUG=* node --trace-warnings node_modules/nodemon/bin/nodemon.js --watch b -x 'node b'
nodemon bus new listener: reset (0) +0ms
nodemon bus new listener: reset (0) +3ms
nodemon bus new listener: quit (0) +20ms
nodemon bus new listener: quit (0) +0ms
nodemon bus new listener: restart (0) +0ms
nodemon bus new listener: restart (0) +0ms
nodemon bus new listener: reset (2) +3ms
nodemon bus emit: reset +3ms
nodemon resetting watchers +0ms
nodemon reset +1ms
nodemon config: dirs [ '/home/jroy/code/leela-zero-server/b' ] +67ms
[nodemon] 1.14.6
[nodemon] to restart at any time, enter rs
nodemon bus new listener: error (0) +7ms
nodemon bus new listener: error (0) +1ms
[nodemon] watching: b
[nodemon] starting node b
nodemon spawning node b +1ms
nodemon bus new listener: exit (0) +13ms
nodemon bus new listener: exit (0) +0ms
nodemon start watch on: b +0ms
nodemon start watch on: /home/jroy/code/leela-zero-server/b +1ms
nodemon ignored [ '/.git',
'
/.nyc_output',
'/.sass-cache',
'
/bower_components',
'/coverage',
'
/node_modules',
re: /../.git|../.nyc_output|../.sass-cache|../bower_components|../coverage|../node_modules/ ] +0ms
nodemon:watch watching dir: /home/jroy/code/leela-zero-server/b +30ms
nodemon watch is complete +1ms
rs
nodemon bus emit: restart +1s
events.js:183
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at Pipe.onread (net.js:615:25)

@remy
Copy link
Owner

remy commented Dec 31, 2017

Okay…so, possibly the OS? Somehow? Are you running a Docker instance perchance? Otherwise I might be able to write a Dockerfile to get the exact version of unix flavour you're using (though I'm not very good at writing those!)

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

The server is running on a digital cloud provider, traceroute tells me it is www.hetzner.com. Any more info I can provide beyond uname -a?

4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Perhaps it's the older linux kernel or something.

@gcp
Copy link

gcp commented Dec 31, 2017

It's Ubuntu 16.04 LTS on KVM.

@remy
Copy link
Owner

remy commented Dec 31, 2017

Okay, I'm now able to replicate using a Docker image using Ubuntu 16.04. I might be able to use this to iterate through a debugging process (finally!).

I'll post a gist with the files I'm using shortly.

@remy
Copy link
Owner

remy commented Dec 31, 2017

Okay, getting closer. If I comment out this line it doesn't blow up. But I can't work out why and what needs cleaning up to ensure this can re-connect properly.

remy added a commit that referenced this issue Dec 31, 2017
This is a weird case where stdin isn't fully connected and throws in
ubuntu 16.04 (replicated in a Docker image).

Fixes #1195
@remy
Copy link
Owner

remy commented Dec 31, 2017

Got it. Took a while, but managed to find the right stream to hook the error handle on. Once (hopefully) the tests pass, I'll merge into master and it'll be live on 1.14.7

And if you want to support the project, you can here 👉 https://opencollective.com/nodemon/donate 😃

@remy
Copy link
Owner

remy commented Dec 31, 2017

Though…for some reason Travis CI is taking its merry time…

@roy7
Copy link
Author

roy7 commented Dec 31, 2017

Thanks for digging into it enough to find and fix the problem! :) I sent in a small donation.

@roy7 roy7 closed this as completed Dec 31, 2017
remy added a commit that referenced this issue Dec 31, 2017
This is a weird case where stdin isn't fully connected and throws in
ubuntu 16.04 (replicated in a Docker image).

Fixes #1195
@remy
Copy link
Owner

remy commented Dec 31, 2017

Don't know why it took so long, but it was released 5 minutes ago. Thanks again.

@roy7
Copy link
Author

roy7 commented Jan 1, 2018

BTW while you have your docker handy, I'll let you know that often nodemon won't restart my process even after I change the source file. That isn't a big deal compared to the fixed crashing, I re-attach screen and type 'rs' each time. But if you want I can make a new issue and help with debugging on that as well.

@remy
Copy link
Owner

remy commented Jan 1, 2018 via email

jimthedev referenced this issue in commitizen/cz-cli May 24, 2018
This Pull Request updates dependency [nodemon](https://github.com/remy/nodemon) from `v1.11.0` to `v1.17.5`



<details>
<summary>Release Notes</summary>

### [`v1.17.5`](https://github.com/remy/nodemon/releases/v1.17.5)
[Compare Source](remy/nodemon@ff79835...v1.17.5)
##### Bug Fixes

* in watch, use fully filtered ignore rules ([b3fc3a9](remy/nodemon@b3fc3a9)), closes [#&#8203;1348](`https://github.com/remy/nodemon/issues/1348`)

---

### [`v1.17.4`](https://github.com/remy/nodemon/releases/v1.17.4)
[Compare Source](remy/nodemon@6925494...v1.17.4)
##### Bug Fixes

* {{filename}} is only replaced once ([f616258](remy/nodemon@f616258))
* increase perf of watching large file count ([58b82f2](remy/nodemon@58b82f2)), closes [#&#8203;1317](`https://github.com/remy/nodemon/issues/1317`)
* only hook SIGINT on boot - not at require ([9bbc219](remy/nodemon@9bbc219)), closes [#&#8203;1326](`https://github.com/remy/nodemon/issues/1326`)
* support env.SUPPRESS_SUPPORT ([#&#8203;1334](`https://github.com/remy/nodemon/issues/1334`)) ([ee2aac1](remy/nodemon@ee2aac1))

---

### [`v1.17.3`](https://github.com/remy/nodemon/releases/v1.17.3)
[Compare Source](remy/nodemon@v1.17.2...v1.17.3)
##### Bug Fixes

* don't throw when required in the repl ([aa18c80](remy/nodemon@aa18c80)), closes [#&#8203;1292](`https://github.com/remy/nodemon/issues/1292`)

---

### [`v1.17.2`](https://github.com/remy/nodemon/releases/v1.17.2)
[Compare Source](remy/nodemon@v1.17.1...v1.17.2)
##### Bug Fixes

* prevent throw when args missing ([#&#8203;1288](`https://github.com/remy/nodemon/issues/1288`)) ([89d6062](remy/nodemon@89d6062)), closes [#&#8203;1286](`https://github.com/remy/nodemon/issues/1286`)
* watch count regression ([#&#8203;1287](`https://github.com/remy/nodemon/issues/1287`)) ([372e6b2](remy/nodemon@372e6b2)), closes [#&#8203;1283](`https://github.com/remy/nodemon/issues/1283`)

---

### [`v1.17.1`](https://github.com/remy/nodemon/releases/v1.17.1)
[Compare Source](remy/nodemon@v1.17.0...v1.17.1)
##### Bug Fixes

* throwing exeception on run ([85ed19d](remy/nodemon@85ed19d)), closes [#&#8203;1276](`https://github.com/remy/nodemon/issues/1276`)

---

### [`v1.17.0`](https://github.com/remy/nodemon/releases/v1.17.0)
[Compare Source](remy/nodemon@v1.16.1...v1.17.0)
##### Bug Fixes

* make it possible for windows to checkout ([#&#8203;1270](`https://github.com/remy/nodemon/issues/1270`)) ([0f39b2e](remy/nodemon@0f39b2e)), closes [#&#8203;1255](`https://github.com/remy/nodemon/issues/1255`)
* windows exec resolution ([#&#8203;1274](`https://github.com/remy/nodemon/issues/1274`)) ([7ffd545](remy/nodemon@7ffd545)), closes [#&#8203;1251](`https://github.com/remy/nodemon/issues/1251`)
* make clear where more opts are in help ([#&#8203;1271](`https://github.com/remy/nodemon/issues/1271`)) ([f4391d4](remy/nodemon@f4391d4))
* put windows drive letter tweak in right place ([#&#8203;1272](`https://github.com/remy/nodemon/issues/1272`)) ([94b526f](remy/nodemon@94b526f)), closes [#&#8203;1263](`https://github.com/remy/nodemon/issues/1263`)
##### Features

* try to resolve exec in node_modules/.bin ([#&#8203;1275](`https://github.com/remy/nodemon/issues/1275`)) ([7fb365d](remy/nodemon@7fb365d)), closes [#&#8203;1268](`https://github.com/remy/nodemon/issues/1268`)
* feed args to exec when detecting script ([#&#8203;1273](`https://github.com/remy/nodemon/issues/1273`)) ([e41f3c3](remy/nodemon@e41f3c3)), closes [#&#8203;1263](`https://github.com/remy/nodemon/issues/1263`)

_Note: due to an oddity in the automated build process, nodemon was bumped two minor versions instead of one. Nothing to worry about though._

---

### [`v1.16.1`](remy/nodemon@v1.16.0...v1.16.1)
[Compare Source](remy/nodemon@v1.16.0...v1.16.1)


---

### [`v1.16.0`](remy/nodemon@1cda8fa...v1.16.0)
[Compare Source](remy/nodemon@1cda8fa...v1.16.0)


---

### [`v1.15.1`](https://github.com/remy/nodemon/releases/v1.15.1)
[Compare Source](remy/nodemon@v1.15.0...v1.15.1)
##### Bug Fixes

* ensure directories are watched, not files ([#&#8203;1260](`https://github.com/remy/nodemon/issues/1260`)) ([1cda8fa](remy/nodemon@1cda8fa)), closes [#&#8203;1259](`https://github.com/remy/nodemon/issues/1259`)

---

### [`v1.15.0`](https://github.com/remy/nodemon/releases/v1.15.0)
[Compare Source](remy/nodemon@v1.14.12...v1.15.0)
##### Features

* add support for `--spawn` ([#&#8203;1249](`https://github.com/remy/nodemon/issues/1249`)) ([5e88b04](remy/nodemon@5e88b04)), closes [#&#8203;1245](`https://github.com/remy/nodemon/issues/1245`)

---

### [`v1.14.12`](https://github.com/remy/nodemon/releases/v1.14.12)
[Compare Source](remy/nodemon@v1.14.11...v1.14.12)
##### Bug Fixes

* sniff for child.stdout before using it ([79e61f0](remy/nodemon@79e61f0))
* wrongly normalizing slashes in windows ([33fa6f4](remy/nodemon@33fa6f4)), closes [#&#8203;1236](`https://github.com/remy/nodemon/issues/1236`)

---

### [`v1.14.11`](https://github.com/remy/nodemon/releases/v1.14.11)
[Compare Source](remy/nodemon@v1.14.10...v1.14.11)
##### Bug Fixes

* don't ignore dot-directories ([4be493c](remy/nodemon@4be493c)), closes [#&#8203;1223](`https://github.com/remy/nodemon/issues/1223`)
* update deps - chokidar@&#8203;2.0.0 in particular ([9d49852](remy/nodemon@9d49852))

---

### [`v1.14.10`](https://github.com/remy/nodemon/releases/v1.14.10)
[Compare Source](remy/nodemon@v1.14.9...v1.14.10)
##### Bug Fixes

* node < 6.4.0 causing crash on 'rs' trigger ([e90f15a](remy/nodemon@e90f15a)), closes [#&#8203;1218](`https://github.com/remy/nodemon/issues/1218`)

---

### [`v1.14.9`](https://github.com/remy/nodemon/releases/v1.14.9)
[Compare Source](remy/nodemon@64a82ff...v1.14.9)
##### Bug Fixes

* correctly pass ignored rules to chokidar ([718a9ad](remy/nodemon@718a9ad)), closes [#&#8203;1202](`https://github.com/remy/nodemon/issues/1202`)
* ignorePermissionErrors in chokidar ([e95ea6f](remy/nodemon@e95ea6f))

---

### [`v1.14.8`](https://github.com/remy/nodemon/releases/v1.14.8)
[Compare Source](remy/nodemon@6e7ce4b...v1.14.8)
##### Bug Fixes

* clarify which config files are actually used ([2582d96](remy/nodemon@2582d96)), closes [#&#8203;1204](`https://github.com/remy/nodemon/issues/1204`)
* fail gracefully if postinstall fails ([64a82ff](remy/nodemon@64a82ff))

---

### [`v1.14.7`](https://github.com/remy/nodemon/releases/v1.14.7)
[Compare Source](remy/nodemon@v1.14.6...v1.14.7)
##### Bug Fixes

* swallow child.stdin err ([6e7ce4b](remy/nodemon@6e7ce4b)), closes [#&#8203;1195](`https://github.com/remy/nodemon/issues/1195`)

---

### [`v1.14.6`](https://github.com/remy/nodemon/releases/v1.14.6)
[Compare Source](remy/nodemon@v1.14.5...v1.14.6)
##### Bug Fixes

* watch both js and mjs files if main file is JavaScript ([d78bf3d](remy/nodemon@d78bf3d))

---

### [`v1.14.5`](https://github.com/remy/nodemon/releases/v1.14.5)
[Compare Source](remy/nodemon@v1.14.4...v1.14.5)
##### Bug Fixes

* don't use fork with `node inspect` ([0d9a892](remy/nodemon@0d9a892))

---

### [`v1.14.4`](https://github.com/remy/nodemon/releases/v1.14.4)
[Compare Source](remy/nodemon@v1.14.3...v1.14.4)
##### Bug Fixes

* expose no update flag ([c637717](remy/nodemon@c637717))
* handle exit(2) better ([5a914cb](remy/nodemon@5a914cb))
* incorrect count of watch files being reported ([7a04e2c](remy/nodemon@7a04e2c)), closes [#&#8203;1194](`https://github.com/remy/nodemon/issues/1194`)
* properly handle --no-update-notifier ([48048aa](remy/nodemon@48048aa))
* support implicit filename extension ([6e839d4](remy/nodemon@6e839d4)), closes [#&#8203;1193](`https://github.com/remy/nodemon/issues/1193`)

---

### [`v1.14.3`](https://github.com/remy/nodemon/releases/v1.14.3)
[Compare Source](remy/nodemon@v1.14.2...v1.14.3)
##### Bug Fixes

* ensure non-slurp is passed to script ([ad226af](remy/nodemon@ad226af)), closes [#&#8203;750](`https://github.com/remy/nodemon/issues/750`)

---

### [`v1.14.2`](https://github.com/remy/nodemon/releases/v1.14.2)
[Compare Source](remy/nodemon@v1.14.1...v1.14.2)
##### Bug Fixes

* stop saying there's another update required! ([dcd8911](remy/nodemon@dcd8911))

---

### [`v1.14.1`](https://github.com/remy/nodemon/releases/v1.14.1)
[Compare Source](remy/nodemon@v1.14.0...v1.14.1)
##### Bug Fixes

* defined diretory watching ([1e2516d](remy/nodemon@1e2516d))
* pass stdin to child process on -I ([1d88943](remy/nodemon@1d88943)), closes [#&#8203;1036](`https://github.com/remy/nodemon/issues/1036`)
* properly ignore defaults, don't match partial ([4589bc8](remy/nodemon@4589bc8)), closes [#&#8203;916](`https://github.com/remy/nodemon/issues/916`)

---

### [`v1.14.0`](https://github.com/remy/nodemon/releases/v1.14.0)
[Compare Source](remy/nodemon@v1.13.3...v1.14.0)
##### Bug Fixes

* remove scoped dep ([d15cf68](remy/nodemon@d15cf68)), closes [#&#8203;1180](`https://github.com/remy/nodemon/issues/1180`)
##### Features

* support wildcard extension matching ([009d868](remy/nodemon@009d868))

---

### [`v1.13.3`](https://github.com/remy/nodemon/releases/v1.13.3)
[Compare Source](remy/nodemon@v1.13.2...v1.13.3)
##### Bug Fixes

* nodemon reporting crash ([1171fc1](remy/nodemon@1171fc1)), closes [#&#8203;1173](`https://github.com/remy/nodemon/issues/1173`)

---

### [`v1.13.2`](https://github.com/remy/nodemon/releases/v1.13.2)
[Compare Source](remy/nodemon@v1.13.1...v1.13.2)
##### Bug Fixes

* switch to killing using numericals ([e9129c0](remy/nodemon@e9129c0)), closes [#&#8203;956](`https://github.com/remy/nodemon/issues/956`) [#&#8203;813](`https://github.com/remy/nodemon/issues/813`)

---

### [`v1.13.1`](https://github.com/remy/nodemon/releases/v1.13.1)
[Compare Source](remy/nodemon@v1.13.0...v1.13.1)
##### Bug Fixes

* fixed an issue where we tried to resolve null as path ([10ded94](remy/nodemon@10ded94))
* if no ps, walk /proc to kill child fully ([bf9b7a6](remy/nodemon@bf9b7a6))

---

### [`v1.13.0`](https://github.com/remy/nodemon/releases/v1.13.0)
[Compare Source](remy/nodemon@v1.12.7...v1.13.0)
##### Bug Fixes

* support nodemon index to expand to index.js ([a282afb](remy/nodemon@a282afb)), closes [#&#8203;1165](`https://github.com/remy/nodemon/issues/1165`)
##### Features

* support SIGHUP to restart nodemon ([30f999a](remy/nodemon@30f999a)), closes [#&#8203;393](`https://github.com/remy/nodemon/issues/393`)
* watch script regardless of extension ([f8a5abe](remy/nodemon@f8a5abe)), closes [#&#8203;461](`https://github.com/remy/nodemon/issues/461`)

---

### [`v1.12.7`](https://github.com/remy/nodemon/releases/v1.12.7)
[Compare Source](remy/nodemon@v1.12.6...v1.12.7)
##### Bug Fixes

* defensive check on accessing cmd.args ([fd961d6](remy/nodemon@fd961d6))
* support node arguments again ([d9e93ad](remy/nodemon@d9e93ad)), closes [#&#8203;1161](`https://github.com/remy/nodemon/issues/1161`)

---

### [`v1.12.6`](https://github.com/remy/nodemon/releases/v1.12.6)
[Compare Source](remy/nodemon@v1.12.5...v1.12.6)
##### Bug Fixes

* get tests to pass ([cf923a8](remy/nodemon@cf923a8))
* only use fork if node>4 ([f52615c](remy/nodemon@f52615c))
* restore node 4 min support ([6d760f4](remy/nodemon@6d760f4))
* travis CI build before-install ([3a6b8df](remy/nodemon@3a6b8df))

---

### [`v1.12.5`](https://github.com/remy/nodemon/releases/v1.12.5)
[Compare Source](remy/nodemon@v1.12.4...v1.12.5)
##### Bug Fixes

* pass through execArgs from config ([#&#8203;1142](`https://github.com/remy/nodemon/issues/1142`)) ([6a4fb22](remy/nodemon@6a4fb22))

---

### [`v1.12.4`](https://github.com/remy/nodemon/releases/v1.12.4)
[Compare Source](remy/nodemon@v1.12.3...v1.12.4)
##### Bug Fixes

* reduce help output (a teeny bit) ([2e1b496](remy/nodemon@2e1b496))

---

### [`v1.12.3`](https://github.com/remy/nodemon/releases/v1.12.3)
[Compare Source](remy/nodemon@24a4b84...v1.12.3)
##### Bug Fixes

* add commit lint ([2af6391](remy/nodemon@2af6391))
* Add support for multi-level filenames ([29a9a44](remy/nodemon@29a9a44))
* bump deps and fix tests for local dev ([#&#8203;1139](`https://github.com/remy/nodemon/issues/1139`)) ([6d57dac](remy/nodemon@6d57dac))
* catch module.parent.filename === undefined ([#&#8203;1053](`https://github.com/remy/nodemon/issues/1053`)) ([4c81e9a](remy/nodemon@4c81e9a))
* crash when passing argument to node (windows) ([469fa80](remy/nodemon@469fa80)), closes [#&#8203;1095](`https://github.com/remy/nodemon/issues/1095`)
* executable path handling under windows ([#&#8203;962](`https://github.com/remy/nodemon/issues/962`)) ([481dc8f](remy/nodemon@481dc8f))
* exit when fail to parse the config file ([#&#8203;921](`https://github.com/remy/nodemon/issues/921`)) ([63e8606](remy/nodemon@63e8606)), closes [#&#8203;651](`https://github.com/remy/nodemon/issues/651`)
* exit with code 1 on crash if --exitcrash ([#&#8203;946](`https://github.com/remy/nodemon/issues/946`)) ([facc8cb](remy/nodemon@facc8cb))
* help truncation on node 6.2 ([#&#8203;842](`https://github.com/remy/nodemon/issues/842`)) ([#&#8203;843](`https://github.com/remy/nodemon/issues/843`)) ([abc138f](remy/nodemon@abc138f))
* read config file before defaulting script parameter ([#&#8203;1110](`https://github.com/remy/nodemon/issues/1110`)) ([f3e0c29](remy/nodemon@f3e0c29))
* require node 6 or above in engines ([71eab1a](remy/nodemon@71eab1a))
* Support for .mjs es6 modules ([#&#8203;1138](`https://github.com/remy/nodemon/issues/1138`)) ([5a89df6](remy/nodemon@5a89df6))
* support signal on CLI ([#&#8203;1061](`https://github.com/remy/nodemon/issues/1061`)) ([3c352f2](remy/nodemon@3c352f2))
* sync help.txt to available options ([9b6c786](remy/nodemon@9b6c786))
* update readme ([3426224](remy/nodemon@3426224))
##### Features

* nodemonConfig support in package.json ([fb5da38](remy/nodemon@fb5da38)), closes [#&#8203;873](`https://github.com/remy/nodemon/issues/873`)

---

### [`v1.12.2`](remy/nodemon@469fa80...24a4b84)
[Compare Source](remy/nodemon@469fa80...24a4b84)


---

### [`v1.12.1`](remy/nodemon@6a4803d...469fa80)
[Compare Source](remy/nodemon@6a4803d...469fa80)


---

### [`v1.12.0`](remy/nodemon@8204b69...6a4803d)
[Compare Source](remy/nodemon@8204b69...6a4803d)


---

### [`v1.11.1`](remy/nodemon@v1.11.0...8204b69)
[Compare Source](remy/nodemon@v1.11.0...8204b69)


---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment