c9 / core

Cloud9 Core - Part of the Cloud9 SDK for Plugin Development https://c9.github.io/core/ https://c9.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error creating TMUX session: Cannot read property 'on' of undefined

drmrbrewer opened this issue · comments

With a self-hosted cloud9 on Ubuntu 18.04 and Node 10.x, the IDE loads fine in general but when I try to open a terminal I get the following errors in the Chrome console in which the IDE is running:

Error connecting to the terminal:  {stack: "8: 36: TypeError: Cannot read property 'on' of und…06:13)↵    at ChildProcess.emit (events.js:191:7)", message: "Cannot read property 'on' of undefined"}message: "Cannot read property 'on' of undefined"stack: "8: 36: TypeError: Cannot read property 'on' of undefined↵    at check (/cloud9/plugins/node_modules/vfs-local/localfs.js:1688:25)↵    at /cloud9/plugins/node_modules/vfs-local/localfs.js:1676:17↵    at resolvePath (/cloud9/plugins/node_modules/vfs-local/localfs.js:363:13)↵    at ptyspawn (/cloud9/plugins/node_modules/vfs-local/localfs.js:1667:9)↵    at run (/cloud9/plugins/node_modules/vfs-local/localfs.js:2086:17)↵    at start (/cloud9/plugins/node_modules/vfs-local/localfs.js:2058:13)↵    at /cloud9/plugins/node_modules/vfs-local/localfs.js:1972:25↵    at ChildProcess.exithandler (child_process.js:209:5)↵    at emitTwo (events.js:106:13)↵    at ChildProcess.emit (events.js:191:7)"__proto__: Object
(anonymous) @ default.js:81524
(anonymous) @ default.js:109183
processCallback @ default.js:160773
(anonymous) @ default.js:160800
callbacks.(anonymous function) @ default.js:160121
Agent._onMessage @ default.js:160093
EventEmitter.emit @ default.js:756
onMessage @ default.js:160328
EventEmitter.emit @ default.js:756
ReliableSocket.onMessage @ default.js:160934
EventEmitter.emit @ default.js:756
ReconnectSocket.onMessage @ default.js:161271
Emitter.emit @ default.js:157980
Socket.onPacket @ default.js:156605
(anonymous) @ default.js:156455
Emitter.emit @ default.js:157980
Transport.onPacket @ default.js:156860
Transport.onData @ default.js:156856
ws.onmessage @ default.js:157601


Error creating TMUX session:  Cannot read property 'on' of undefined
(anonymous) @ default.js:81386
(anonymous) @ default.js:81529
(anonymous) @ default.js:109183
processCallback @ default.js:160773
(anonymous) @ default.js:160800
callbacks.(anonymous function) @ default.js:160121
Agent._onMessage @ default.js:160093
EventEmitter.emit @ default.js:756
onMessage @ default.js:160328
EventEmitter.emit @ default.js:756
ReliableSocket.onMessage @ default.js:160934
EventEmitter.emit @ default.js:756
ReconnectSocket.onMessage @ default.js:161271
Emitter.emit @ default.js:157980
Socket.onPacket @ default.js:156605
(anonymous) @ default.js:156455
Emitter.emit @ default.js:157980
Transport.onPacket @ default.js:156860
Transport.onData @ default.js:156856
ws.onmessage @ default.js:157601

Any ideas how to resolve this?

@nightwing any ideas?

If I bash into the cloud9 container, running ~/.c9/bin/tmux does work OK... seems to open a terminal within the terminal.

The cloud9 container has node v10.15.1 installed (under Ubuntu 18.04 as mentioned).

And in the docker service logs for the cloud9 container, when a terminal is attempting (but failing) to load, the following log message is emitted every couple of seconds: PTY is not supported.

And I've seen one instance of the following in the docker service logs, but certainly this doesn't show each and every time I try to open a new terminal:

{ Error: Cannot find module '/root/.c9/node_modules/pty.js'
  at Function.Module._resolveFilename (module.js:440:15)
  at Function.Module._load (module.js:388:25)
  at Module.require (module.js:468:17)
  at require (internal/module.js:20:19)
  at /cloud9/plugins/node_modules/vfs-local/localfs.js:92:23
  ative)
  at setup (/cloud9/plugins/node_modules/vfs-local/localfs.js:90:23)
  at Object.<anonymous> (/cloud9/plugins/node_modules/vfs-child/child.js:5:31)
  at Module._compile (module.js:541:32)
  at Object.Module._extensions..js (module.js:550:10) code: 'MODULE_NOT_FOUND' } '/root/.c9/node_modules/pty.js'
{ Error: Cannot find module 'pty.js'
  at Function.Module._resolveFilename (module.js:440:15)
  at Function.Module._load (module.js:388:25)
  at Module.require (module.js:468:17)
  at require (internal/module.js:20:19)
  at /cloud9/plugins/node_modules/vfs-local/localfs.js:92:23
  ative)
  at setup (/cloud9/plugins/node_modules/vfs-local/localfs.js:90:23)
  at Object.<anonymous> (/cloud9/plugins/node_modules/vfs-child/child.js:5:31)
  at Module._compile (module.js:541:32)
  at Object.Module._extensions..js (module.js:550:10) code: 'MODULE_NOT_FOUND' } 'pty.js'

This is the content of the ~/.c9/ folder:

drwxr-xr-x  1 root root   4096 Feb 26 20:59  .
drwx------  1 root root   4096 Feb 26 20:45  ..
-rw-r--r--  1 root root   9583 Feb 26 20:31 'Third-Party Licensing Notices.md'
drwxr-xr-x  1 root root   4096 Feb 26 20:45  bin
srwxr-xr-x  1 root root      0 Feb 26 20:59  bridge.socket
-rw-r--r--  1 root root      2 Feb 26 20:31  installed
drwxr-xr-x  3 root root   4096 Feb 26 20:31  lib
drwxr-xr-x 10 1000  1000  4096 Feb 26 20:27  libevent-2.1.8-stable
drwxr-xr-x  6 root root   4096 Feb 26 20:29  local
drwxr-xr-x 18 1001 users  4096 Feb 26 20:29  ncurses-6.0
drwxrwxr-x  7  500   500  4096 Feb 26 20:26  node
drwxr-xr-x 82 root root   4096 Feb 26 20:31  node_modules
drwxr-xr-x  5 1000  1000 12288 Feb 26 20:30  tmux-2.2
-rw-r--r--  1 root root    253 Feb 26 20:59  user.settings

In the ~/.c9/ folder, running find . -name pty.js produces nothing.

And I have tried the suggestion here but it complains that there is no package.json file in ~/.c9/.

Now seems to be working OK... for no apparent reason.