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

1.10.1 update initially causes TypeError in Docker #894

Closed
zacanger opened this issue Aug 18, 2016 · 11 comments
Closed

1.10.1 update initially causes TypeError in Docker #894

zacanger opened this issue Aug 18, 2016 · 11 comments

Comments

@zacanger
Copy link

zacanger commented Aug 18, 2016

Hey,

The update works fine outside of a container, but running in Docker causes the following:

container-name | [nodemon] 1.10.1
container-name | [nodemon] to restart at any time, enter `rs`
container-name | [nodemon] watching: /web/project/server/**/* src/router.js
container-name | [nodemon] starting `node .`
container-name | _stream_readable.js:512
container-name |     dest.end();
container-name |         ^
container-name |
container-name | TypeError: Cannot read property 'end' of null
container-name |     at Socket.onend (_stream_readable.js:512:9)
container-name |     at Socket.g (events.js:286:16)
container-name |     at emitNone (events.js:91:20)
container-name |     at Socket.emit (events.js:185:7)
container-name |     at endReadableNT (_stream_readable.js:975:12)
container-name |     at _combinedTickCallback (internal/process/next_tick.js:74:11)
container-name |     at process._tickCallback (internal/process/next_tick.js:98:9)
container-name | ERROR: "start:serve" exited with 1.
container-name exited with code 1

Though sometimes it'll then continue just fine:

container-name | _stream_readable.js:512
container-name |     dest.end();
container-name |         ^
container-name |
container-name | TypeError: Cannot read property 'end' of null
container-name |     at Socket.onend (_stream_readable.js:512:9)
container-name |     at Socket.g (events.js:286:16)
container-name |     at emitNone (events.js:91:20)
container-name |     at Socket.emit (events.js:185:7)
container-name |     at endReadableNT (_stream_readable.js:975:12)
container-name |     at _combinedTickCallback (internal/process/next_tick.js:74:11)
container-name |     at process._tickCallback (internal/process/next_tick.js:98:9)
container-name | Listening at http://0.0.0.0:3989
container-name | Non-clustered HTTPS server listening on port 4010
container-name | ✓ Clean (8:29:38 AM)
container-name | webpack built 92842492bec538a74118 in 23352ms

The output of nodemon --dump (run from inside the container):

--------------
node: v6.4.0
nodemon: 1.10.1
command: /usr/bin/node /web/project/node_modules/.bin/nodemon --dump
cwd: /web/project
OS: linux x64
--------------
{ run: false,
  system: { cwd: '/web/project' },
  required: false,
  dirs: [ '/web/project' ],
  timeout: 1000,
  options:
   { dump: true,
     ignore:
      [ '.git',
        '.nyc_output',
        '.sass-cache',
        'bower_components',
        'coverage',
        'node_modules',
        re: /\.git|\.nyc_output|\.sass\-cache|bower_components|coverage|node_modules/ ],
     watch: [ '*.*', re: /.*\..*/ ],
     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,
     stdout: true,
     execOptions:
      { script: 'server/server.boot.js',
        exec: 'node',
        args: [],
        scriptPosition: 0,
        nodeArgs: undefined,
        ext: 'js,json',
        env: {},
        execArgs: [] },
     monitor:
      [ '*.*',
        '!/web/project/.git/**/*',
        '!/web/project/.nyc_output/**/*',
        '!.sass-cache',
        '!bower_components',
        '!/web/project/coverage/**/*',
        '!/web/project/node_modules/**/*' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  command:
   { raw: { executable: 'node', args: [ 'server/server.boot.js' ] },
     string: 'node server/server.boot.js' } }
--------------

Relevant npm scripts:

"start": "./scripts/docker-dev-local.sh",
"start-no-docker": "run-p start:*",
"start:serve": "nodemon -L --delay 2 --ext js,json,pug --watch server --watch src/router.js .",
// other start scripts related to linting and postcss

Where docker-dev-local just runs docker-compose up, and docker-compose.yml has
command: npm run start-no-docker.

Seems to continue to work more often than not, though. We don't shrinkwrap so I can't tell
if this would be caused by some transitive dependency or by the actual changes.
Also not sure if it might just be related to Webpack's startup time.

@jamesdixon
Copy link

Also seeing this same issue. Switching back to 1.10 resolves the issue.

@nrempel
Copy link

nrempel commented Aug 18, 2016

I'm also seeing this.

My npm-debug.log:

 info it worked if it ends with ok
1 verbose cli [ '/app/heroku/node/bin/node',
1 verbose cli   '/app/heroku/node/bin/npm',
1 verbose cli   'run',
1 verbose cli   'dev' ]
2 info using npm@3.9.5
3 info using node@v6.2.2
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle adonis-app@3.0.0~predev: adonis-app@3.0.0
6 silly lifecycle adonis-app@3.0.0~predev: no script for predev, continuing
7 info lifecycle adonis-app@3.0.0~dev: adonis-app@3.0.0
8 verbose lifecycle adonis-app@3.0.0~dev: unsafe-perm in lifecycle true
9 verbose lifecycle adonis-app@3.0.0~dev: PATH: /app/heroku/node/lib/node_modules/npm/bin/node-gyp-bin:/app/user/node_modules/.bin:/app/heroku/node/bin:/app/heroku/node/bin/:/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle adonis-app@3.0.0~dev: CWD: /app/user
11 silly lifecycle adonis-app@3.0.0~dev: Args: [ '-c',
11 silly lifecycle   'nodemon --watch app --watch bootstrap --watch config --watch .env -x \'node --harmony_proxies\' server.js' ]
12 silly lifecycle adonis-app@3.0.0~dev: Returned: code: 1  signal: null
13 info lifecycle adonis-app@3.0.0~dev: Failed to exec dev script
14 verbose stack Error: adonis-app@3.0.0 dev: `nodemon --watch app --watch bootstrap --watch config --watch .env -x 'node --harmony_proxies' server.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/app/heroku/node/lib/node_modules/npm/lib/utils/lifecycle.js:245:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/app/heroku/node/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:852:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid adonis-app@3.0.0
16 verbose cwd /app/user
17 error Linux 4.4.15-moby
18 error argv "/app/heroku/node/bin/node" "/app/heroku/node/bin/npm" "run" "dev"
19 error node v6.2.2
20 error npm  v3.9.5
21 error code ELIFECYCLE
22 error adonis-app@3.0.0 dev: `nodemon --watch app --watch bootstrap --watch config --watch .env -x 'node --harmony_proxies' server.js`
22 error Exit status 1
23 error Failed at the adonis-app@3.0.0 dev script 'nodemon --watch app --watch bootstrap --watch config --watch .env -x 'node --harmony_proxies' server.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the adonis-app package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     nodemon --watch app --watch bootstrap --watch config --watch .env -x 'node --harmony_proxies' server.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs adonis-app
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls adonis-app
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
npm-debug.log (END)

@tbonz
Copy link

tbonz commented Aug 18, 2016

Also seeing this same issue..

@remy
Copy link
Owner

remy commented Aug 18, 2016

@tbonz you seeing the same issue inside of docker?

@spudfkc
Copy link

spudfkc commented Aug 18, 2016

I'm running into this issue as well when trying to start my app in a Docker container. It is consistently failing with:

app_1  | [nodemon] 1.10.1
app_1  | [nodemon] to restart at any time, enter `rs`
app_1  | [nodemon] watching: *.*
app_1  | [nodemon] starting `npm run development-build-css`
app_1  | _stream_readable.js:512
app_1  |     dest.end();
app_1  |         ^
app_1  |
app_1  | TypeError: Cannot read property 'end' of null
app_1  |     at ReadStream.onend (_stream_readable.js:512:9)
app_1  |     at ReadStream.g (events.js:286:16)
app_1  |     at emitNone (events.js:91:20)
app_1  |     at ReadStream.emit (events.js:185:7)
app_1  |     at endReadableNT (_stream_readable.js:975:12)
app_1  |     at _combinedTickCallback (internal/process/next_tick.js:74:11)
app_1  |     at process._tickCallback (internal/process/next_tick.js:98:9)

I just reverted back to 1.10.0 and that works fine.

@zacanger
Copy link
Author

So this
is the breaking bit, having stdio = [process.send || 'pipe', process.stdout, process.stderr] works just fine. Would a possible solution be to use a config file with that required true?

@tbonz
Copy link

tbonz commented Aug 18, 2016

@remy yes, I'm seeing this inside docker.

@nickarora
Copy link

I confirm we are seeing the same thing within Docker

@nrempel
Copy link

nrempel commented Aug 18, 2016

If it helps, we are using the Docker native for mac. I haven't tested it in Linux or in a VM.

@remy remy closed this as completed in be5d4e8 Aug 18, 2016
@remy
Copy link
Owner

remy commented Aug 18, 2016

Fixed now in nodemon@1.10.2 - sorry for the issues.

@ghost
Copy link

ghost commented Dec 20, 2017

I am seeing this in 1.13.3. Rolled back to 1.12.5... fixed the issue.

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

No branches or pull requests

7 participants