deploy error when called from node #374

Closed
jescalan opened this Issue Jan 11, 2013 · 9 comments

Comments

Projects
None yet
5 participants

Definitely an edge case, but I thought it was worth bringing up. When I try to run jitsu deploy from a child process in node, it throws this error:

{ [Error: Command failed: 
string_decoder.js:117
  var i = (buffer.length >= 3) ? 3 : buffer.length;
                 ^
TypeError: Cannot read property 'length' of null
    at StringDecoder.detectIncompleteChar (string_decoder.js:117:18)
    at StringDecoder.write (string_decoder.js:87:28)
    at Interface._normalWrite (readline.js:296:30)
    at Interface.write (readline.js:289:49)
    at ProgressBar.tick (/usr/local/lib/node_modules/jitsu/node_modules/progress/lib/node-progress.js:114:11)
    at EventEmitter.package.updateTarball.old (/usr/local/lib/node_modules/jitsu/lib/jitsu/package.js:443:25)
    at EventEmitter.emit (events.js:88:17)
    at Timer.<anonymous> (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/client.js:185:19)
    at Timer.exports.setInterval.timer.ontimeout (timers.js:234:14)

Works fine when called directly from the command line though : )

This is happening when running jitsu deploy as a post build task in jenkins too.

Owner

indexzero commented Jan 22, 2013

@blakmatrix This is an easy fix, it's just a check for process.stdout.isTTY

Contributor

blakmatrix commented Jan 22, 2013

$ grep -RnHi "process.stdout.isTTY" .                                                                                                        [12:20:15]
./node_modules/.bin/vows:71:    nocolor: !process.stdout.isTTY
./node_modules/npm/lib/npm.js:297:          if (process.stdout.isTTY) npm.color = true
./node_modules/npm/node_modules/.bin/imgcat:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/npm/node_modules/ansi/examples/imgcat/index.js:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/require-analyzer/node_modules/read-installed/node_modules/npmlog/node_modules/.bin/imgcat:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/require-analyzer/node_modules/read-installed/node_modules/npmlog/node_modules/ansi/examples/imgcat/index.js:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/vows/bin/vows:71:    nocolor: !process.stdout.isTTY
Contributor

blakmatrix commented Jan 22, 2013

do you guys get this when you use --raw ... also do you use --confirm ?

Contributor

blakmatrix commented Jan 22, 2013

This happens when the depoy process shows a progress bar, I can make a check for tty and avoid this error when used as a child process

Happening when using jitsu deploy as an external tool in WebStorm too.

Contributor

blakmatrix commented Jan 22, 2013

I made a fix for this: c00e8fe

Awesome! Thanks so much @blakmatrix - could you update/close this issue when it's shipped? ❤️

Contributor

blakmatrix commented Feb 2, 2013

This I believe was shipped in jitsu v0.11.6 :)

blakmatrix closed this Feb 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment