{"action":"opened","issue":{"url":"https://api.github.com/repos/convox/rack/issues/108","labels_url":"https://api.github.com/repos/convox/rack/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/convox/rack/issues/108/comments","events_url":"https://api.github.com/repos/convox/rack/issues/108/events","html_url":"https://github.com/convox/rack/issues/108","id":111702932,"number":108,"title":"panic after convox run","user":{"login":"bobzoller","id":16850,"avatar_url":"https://avatars.githubusercontent.com/u/16850?v=3","gravatar_id":"","url":"https://api.github.com/users/bobzoller","html_url":"https://github.com/bobzoller","followers_url":"https://api.github.com/users/bobzoller/followers","following_url":"https://api.github.com/users/bobzoller/following{/other_user}","gists_url":"https://api.github.com/users/bobzoller/gists{/gist_id}","starred_url":"https://api.github.com/users/bobzoller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobzoller/subscriptions","organizations_url":"https://api.github.com/users/bobzoller/orgs","repos_url":"https://api.github.com/users/bobzoller/repos","events_url":"https://api.github.com/users/bobzoller/events{/privacy}","received_events_url":"https://api.github.com/users/bobzoller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-15T20:40:16Z","updated_at":"2015-10-15T20:40:16Z","closed_at":null,"body":"In my CD pipeline, I'm running the `convox` CLI from within nodejs.  It works (the run completes, I get valid output from the docker run), but it dies with the stack below.\r\n\r\ntest script:\r\n```\r\nvar exec = require('child_process').exec;\r\nexec(\"convox run web 'ls -al'\", function (err, stdout, stderr) {\r\n  console.log('STDOUT', stdout);\r\n  console.log('STDERR', stderr);\r\n  if (err) {\r\n    console.error(err);\r\n    process.exit(1);\r\n  }\r\n});\r\n```\r\n\r\nsample output:\r\n```\r\n13:33 $ node test.js \r\nSTDOUT total 152\r\ndrwxr-xr-x 18 root root 4096 Oct 15 19:57 .\r\ndrwxr-xr-x 25 root root 4096 Oct 15 20:35 ..\r\n-rw-------  1 root root  110 Oct 15 19:26 .buildpacks\r\n[... snip ...]\r\n\r\nSTDERR panic: runtime error: invalid memory address or nil pointer dereference\r\n\tpanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal 0xb code=0x1 addr=0x0 pc=0x10d06f]\r\n\r\ngoroutine 1 [running]:\r\ngolang.org/x/crypto/ssh/terminal.Restore(0x0, 0x0, 0x0, 0x0)\r\n\t/go/src/golang.org/x/crypto/ssh/terminal/util.go:70 +0xcf\r\ngolang.org/x/crypto/ssh/terminal.Restore(0x0, 0x0, 0x0, 0x0)\r\n\t/go/src/golang.org/x/crypto/ssh/terminal/util.go:70 +0xcf\r\nmain.cmdRun(0x8208b7e60)\r\n\t/go/src/github.com/convox/rack/cmd/convox/run.go:60 +0x50c\r\ngithub.com/codegangsta/cli.Command.Run(0x55ae20, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a9b20, 0x13, 0x5efd00, ...)\r\n\t/go/src/github.com/codegangsta/cli/command.go:131 +0x1055\r\ngithub.com/codegangsta/cli.(*App).Run(0x8208b7c20, 0x8208b2380, 0x4, 0x4, 0x0, 0x0)\r\n\t/go/src/github.com/codegangsta/cli/app.go:173 +0xfb4\r\nmain.main()\r\n\t/go/src/github.com/convox/rack/cmd/convox/main.go:40 +0x84\r\n\r\ngoroutine 5 [syscall]:\r\nos/signal.loop()\r\n\t/usr/local/go/src/os/signal/signal_unix.go:22 +0x18\r\ncreated by os/signal.init.1\r\n\t/usr/local/go/src/os/signal/signal_unix.go:28 +0x37\r\n\r\ngoroutine 17 [syscall]:\r\nsyscall.Syscall(0x3, 0x0, 0x820a42000, 0x8000, 0x1c800000002, 0x13, 0x1)\r\n\t/usr/local/go/src/syscall/asm_darwin_amd64.s:16 +0x5\r\nsyscall.read(0x0, 0x820a42000, 0x8000, 0x8000, 0x8820a990d0, 0x0, 0x0)\r\n\t/usr/local/go/src/syscall/zsyscall_darwin_amd64.go:972 +0x5f\r\nsyscall.Read(0x0, 0x820a42000, 0x8000, 0x8000, 0x820a42000, 0x0, 0x0)\r\n\t/usr/local/go/src/syscall/syscall_unix.go:160 +0x4d\r\nos.(*File).read(0x8208d8008, 0x820a42000, 0x8000, 0x8000, 0x499d20, 0x0, 0x0)\r\n\t/usr/local/go/src/os/file_unix.go:211 +0x75\r\nos.(*File).Read(0x8208d8008, 0x820a42000, 0x8000, 0x8000, 0x8000, 0x0, 0x0)\r\n\t/usr/local/go/src/os/file.go:95 +0x8a\r\nio.copyBuffer(0x8820ad9768, 0x820a1c2d0, 0x8820a5d9e0, 0x8208d8008, 0x820a42000, 0x8000, 0x8000, 0x0, 0x0, 0x0)\r\n\t/usr/local/go/src/io/io.go:381 +0x247\r\nio.Copy(0x8820ad9768, 0x820a1c2d0, 0x8820a5d9e0, 0x8208d8008, 0x3a, 0x0, 0x0)\r\n\t/usr/local/go/src/io/io.go:351 +0x64\r\ncreated by github.com/convox/rack/client.(*Client).Stream\r\n\t/go/src/github.com/convox/rack/client/client.go:344 +0x901\r\n\r\n{ [Error: Command failed: panic: runtime error: invalid memory address or nil pointer dereference\r\n\tpanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal 0xb code=0x1 addr=0x0 pc=0x10d06f]\r\n\r\ngoroutine 1 [running]:\r\ngolang.org/x/crypto/ssh/terminal.Restore(0x0, 0x0, 0x0, 0x0)\r\n\t/go/src/golang.org/x/crypto/ssh/terminal/util.go:70 +0xcf\r\ngolang.org/x/crypto/ssh/terminal.Restore(0x0, 0x0, 0x0, 0x0)\r\n\t/go/src/golang.org/x/crypto/ssh/terminal/util.go:70 +0xcf\r\nmain.cmdRun(0x8208b7e60)\r\n\t/go/src/github.com/convox/rack/cmd/convox/run.go:60 +0x50c\r\ngithub.com/codegangsta/cli.Command.Run(0x55ae20, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a9b20, 0x13, 0x5efd00, ...)\r\n\t/go/src/github.com/codegangsta/cli/command.go:131 +0x1055\r\ngithub.com/codegangsta/cli.(*App).Run(0x8208b7c20, 0x8208b2380, 0x4, 0x4, 0x0, 0x0)\r\n\t/go/src/github.com/codegangsta/cli/app.go:173 +0xfb4\r\nmain.main()\r\n\t/go/src/github.com/convox/rack/cmd/convox/main.go:40 +0x84\r\n\r\ngoroutine 5 [syscall]:\r\nos/signal.loop()\r\n\t/usr/local/go/src/os/signal/signal_unix.go:22 +0x18\r\ncreated by os/signal.init.1\r\n\t/usr/local/go/src/os/signal/signal_unix.go:28 +0x37\r\n\r\ngoroutine 17 [syscall]:\r\nsyscall.Syscall(0x3, 0x0, 0x820a42000, 0x8000, 0x1c800000002, 0x13, 0x1)\r\n\t/usr/local/go/src/syscall/asm_darwin_amd64.s:16 +0x5\r\nsyscall.read(0x0, 0x820a42000, 0x8000, 0x8000, 0x8820a990d0, 0x0, 0x0)\r\n\t/usr/local/go/src/syscall/zsyscall_darwin_amd64.go:972 +0x5f\r\nsyscall.Read(0x0, 0x820a42000, 0x8000, 0x8000, 0x820a42000, 0x0, 0x0)\r\n\t/usr/local/go/src/syscall/syscall_unix.go:160 +0x4d\r\nos.(*File).read(0x8208d8008, 0x820a42000, 0x8000, 0x8000, 0x499d20, 0x0, 0x0)\r\n\t/usr/local/go/src/os/file_unix.go:211 +0x75\r\nos.(*File).Read(0x8208d8008, 0x820a42000, 0x8000, 0x8000, 0x8000, 0x0, 0x0)\r\n\t/usr/local/go/src/os/file.go:95 +0x8a\r\nio.copyBuffer(0x8820ad9768, 0x820a1c2d0, 0x8820a5d9e0, 0x8208d8008, 0x820a42000, 0x8000, 0x8000, 0x0, 0x0, 0x0)\r\n\t/usr/local/go/src/io/io.go:381 +0x247\r\nio.Copy(0x8820ad9768, 0x820a1c2d0, 0x8820a5d9e0, 0x8208d8008, 0x3a, 0x0, 0x0)\r\n\t/usr/local/go/src/io/io.go:351 +0x64\r\ncreated by github.com/convox/rack/client.(*Client).Stream\r\n\t/go/src/github.com/convox/rack/client/client.go:344 +0x901\r\n] killed: false, code: 2, signal: null }\r\n```"}}