liftoff / GateOne

Gate One is an HTML5-powered terminal emulator and SSH client
http://liftoffsoftware.com/Products/GateOne
Other
6.28k stars 924 forks source link

Gateone opens/closes up to 84? New terminals - no CLI #54

Closed iamzam closed 12 years ago

iamzam commented 12 years ago

Installed gateone on centos 5.7 server (rackspace). I installed python 2.7 parallel into /opt/python2.7 and left the Centos default python 2.4 in /usr/bin...

gateone starts fine:

cd /opt/gateone; python2.7 gateone.py [I 111028 23:28:16 gateone:1572] Listening on https://0.0.0.0:443/ [I 111028 23:28:16 gateone:1253] Using google authentication [I 111028 23:28:16 gateone:1288] Loaded plugins: bookmarks, help, logging, playback, ssh [I 111028 23:28:21 gateone:685] WebSocket opened (user@gmail.com).

when i connect to the web interface (firefox 7.0.1) i immediately see scrolling up from the bottom right:

Closed term 1:Gate One Closed term 2:Gate One etc.

up to Closed term 30:Gate One

Sometimes it will go up to 41 this latest time it went up to 86.

on stdout I see: [I 111028 23:31:40 web:1359] 304 GET / (2.2.2.2) 11.32ms [I 111028 23:31:40 web:1359] 304 GET /static/gateone.css (2.2.2.2) 1.10ms [I 111028 23:31:40 web:1359] 304 GET /static/gateone.js (2.2.2.2) 0.70ms [I 111028 23:31:41 web:1359] 304 GET /static/help/help.js (2.2.2.2) 0.72ms [I 111028 23:31:41 web:1359] 304 GET /static/bookmarks/bookmarks.js (2.2.2.2) 0.73ms [I 111028 23:31:41 web:1359] 304 GET /static/logging/logging.js (2.2.2.2) 0.87ms [I 111028 23:31:41 web:1359] 304 GET /static/playback/playback.js (2.2.2.2) 0.87ms [I 111028 23:31:41 web:1359] 304 GET /static/ssh/ssh.js (2.2.2.2) 0.70ms [I 111028 23:31:42 web:1359] 304 GET /style?theme=black&container=gateone&prefix=go (2.2.2.2) 28.79ms [I 111028 23:31:42 web:1359] 304 GET /style?colors=default&container=gateone&prefix=go (2.2.2.2) 15.37ms [I 111028 23:31:42 gateone:685] WebSocket opened (user@gmail.com). [I 111028 23:32:06 gateone:1208] ZjkzOWZmNWJlNmE1UGN1NTg2NjIxYjUwNmY1YmE3N2RjO received quit()... Killing termio session.

At one point i did see an exception on stdout:

[E 111028 23:29:47 ioloop:319] Exception in I/O handler for fd 84 Traceback (most recent call last): File "/opt/python2.7.2/lib/python2.7/site-packages/tornado/ioloop.py", line 309, in start self._handlers[fd](fd, events) File "/opt/gateone/termio.py", line 456, in proc_read self.callbacks[self.CALLBACK_EXIT]() File "gateone.py", line 940, in new_terminal self.refresh_screen(term) # Send a fresh screen to the client File "gateone.py", line 1026, in refresh_screen multiplexer = SESSIONS[self.session][term]['multiplex'] KeyError: u'ZjkzOWZmNWJlNmE1UGN1NTg2NjIxYjUwNmY1YmE3N2RjO'

Here is the server.conf:

sso_service = "HTTP" locale = "en_US" pam_service = "login" syslog_facility = "daemon" disable_ssl = False session_logging = True session_dir = "/tmp/gateone" cookie_secret = "YjllM2VlYjYwZWQ1NDExMzgzIWN0NDZmODNjNjEzN2Q0M" syslog_session_logging = True address = "0.0.0.0" port = 443 user_dir = "/opt/gateone/users" log_file_num_backups = 10 logging = "info" dtach = True certificate = "certificate.pem" keyfile = "keyfile.pem" sso_realm = None log_to_stderr = False log_file_max_size = 104857600 session_timeout = "5d" command = "/opt/gateone/plugins/ssh/scripts/ssh_connect.py -S '/tmp/gateone/%SESSION%/%SHORT_SOCKET%' --sshfp -a '-oUserKnownHostsFile=%USERDIR%/%USER%/known_hosts'" embedded = False debug = True js_init = "" auth = "google" log_file_prefix = "/var/log/gateone/webserver.log" pam_realm = "user"

iamzam commented 12 years ago

I just noticed the closed issue 16 which is like mine, but chmod 775 on ssh_connect.py doesn't fix the issue for me.

I do have noscript/adblock/requestPolicy plugins installed but if I try in chrome i get:

A communications disruption can mean only one thing...

clicking the + key to open a new terminal gets:

NaN: New Terminal

liftoff commented 12 years ago

You have "dtach = True" but do you have dtach installed?

iamzam commented 12 years ago

I didn't, but i installed it and now i get these errors:

[I 111029 20:10:59 gateone:685] WebSocket opened (user@gmail.com). [E 111029 20:11:01 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:01 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:01 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:02 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:02 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:03 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:03 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:03 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:04 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:04 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:04 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:04 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:05 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:05 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:05 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:05 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:06 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:06 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:06 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:07 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:07 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:07 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:07 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:08 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:08 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:08 termio:481] proc_write() exception: must be unicode, not str [E 111029 20:11:09 termio:481] proc_write() exception: must be unicode, not str [I 111029 20:11:09 gateone:1208] MDY5OWZmNDhjNWU5NDA4NGJmNWZlYTNjYjBmOWU4ZjNiM received quit()... Killing termio session. [E 111029 20:11:09 ioloop:410] Exception in callback <tornado.stack_context._StackContextWrapper object at 0x1a07cd60> Traceback (most recent call last): File "/opt/python2.7.2/lib/python2.7/site-packages/tornado/ioloop.py", line 396, in _run_callback callback() File "gateone.py", line 1026, in refresh_screen multiplexer = SESSIONS[self.session][term]['multiplex'] KeyError: u'MDY5OWZmNDhjNWU5NDAGN4JmNWZlYTNjYjBmOWU4ZjNiM'

iamzam commented 12 years ago

oops, if i scroll up a little after it's done refreshing i see:

^L File "/opt/gateone/plugins/ssh/scripts/ssh_connect.py", line 34 except OSError as exc: # Python >2.5 ^ SyntaxError: invalid syntax

and at the bottom of the screen:

[EOF - dtach terminating]

If I set dtach = False i get the same behavior, but no error in the browser and on stdout:

[root@iamzam gateone]# cd /opt/gateone; python2.7 gateone.py [I 111029 20:44:20 gateone:1572] Listening on https://0.0.0.0:443/ [I 111029 20:44:20 gateone:1253] Using google authentication [I 111029 20:44:20 gateone:1288] Loaded plugins: bookmarks, help, logging, playback, ssh [I 111029 20:44:25 gateone:685] WebSocket opened (user@gmail.com). [I 111029 20:44:32 gateone:1208] MDY5OWZmNDhjNWU5NDAGN4JmNWZlYTNjYjBmOWU4ZjNiM received quit()... Killing termio session.

same in /var/log/gateone/webserver.log

liftoff commented 12 years ago

This is the result of running Gate One using Python 2.5. You need to run it using 2.7. I.e. python2.7 gateone.pt

iamzam commented 12 years ago

Ok, great!
I was able to get this working on centos 5.7:

in /opt/gateone/plugins/ssh/scripts/ssh_connect.py i replaced this:

#!/usr/bin/env python

with this:

#!/opt/python2.7.2/bin/python2.7

I guess this would work as well:

#!/usr/bin/env python2.7

as long as:

ln -sf /opt/python2.7.2/bin/python2.7 /usr/bin/python2.7

For future reference for people with centos 5 who can't upgrade python because it's used by things like yum:

I installed python2.7.2 into /opt/python2.7 like this(as root):

wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar zxvf Python-2.7.2.tgz
cd Python-2.7.2
./configure --prefix=/opt/python2.7.2 --with-threads --enable-shared
make
make install
echo "/opt/python2.7.2/lib/" >> /etc/ld.so.conf.d/opt-python2.7.2.conf
ldconfig
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg --prefix=/opt/python2.7.2
/opt/python2.7.2/bin/easy_install pip
ln -sf /opt/python2.7.2/bin/pip /usr/bin/pip
pip install virtualenv
ln -sf /opt/python2.7.2/bin/virtualenv /usr/bin/virtualenv

pyOpenSSL-0.13 wouldn't install so i installed 0.12:

/opt/python2.7.2/bin/easy_install http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.12.tar.gz

then:

pip install tornado

i'm not using kerberos so didn't install that.

then:

unzip gateone.zip
cd gateone.zip
/opt/python2.7.2/bin/python2.7 setup.py install

then configure /opt/gateone/server.conf:

sso_service = "HTTP"
locale = "en_US"
pam_service = "login"
syslog_facility = "daemon"
disable_ssl = False
session_logging = True
session_dir = "/tmp/gateone"
cookie_secret = "ODk5YWJmzOW0NDkYTk5NDxMOWQ1cMmI4NDU3MzFlOTMxO"
syslog_session_logging = True
address = "0.0.0.0"
port = 443
user_dir = "/opt/gateone/users"
log_file_num_backups = 10
logging = "info"
dtach = False
certificate = "certificate.pem"
keyfile = "keyfile.pem"
sso_realm = None
log_to_stderr = False
log_file_max_size = 104857600
session_timeout = "5d"
command = "/opt/gateone/plugins/ssh/scripts/ssh_connect.py -S '/tmp/gateone/%SESSION%/%SHORT_SOCKET%' --sshfp -a '-oUserKnownHostsFile=%USERDIR%/%USER%/known_hosts'"
embedded = False
debug = False
js_init = ""
auth = "google"
log_file_prefix = "/var/log/gateone/webserver.log"
pam_realm = "server"

then:

cd /opt/gateone; python2.7 gateone.py &

Thanks for the excellent software!

Scottie313 commented 12 years ago

Many thanks iamzam! :-)

I had the same problem as you. See my screenshot -> http://i.imgur.com/OHsKw.png

The problem resolved after changing a hashbang from: #!/usr/bin/env python to #!/usr/bin/env /usr/local/bin/python2.7

My environment:

Regards, Scottie

liftoff commented 12 years ago

Thanks for posting this HOWTO and I'm glad it is working for you now!