Ajenti not working in Debian Jessie · Issue #702 · ajenti/ajenti · GitHub



Ajenti not working in Debian Jessie #702

          Open        
hydrosIII opened this Issue

on 8 Apr

        · 17 comments    

    Labels  

    None yet

    Milestone  

      No milestone

    Assignee  

      No one assigned

      9 participants    

hydrosIII     commented    

on 8 Apr

Problem with gevent support…

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766867

I installed gevent with easy install, following the instructions to solve the similar  ubuntu issue: https://github.com/Eugeny/ajenti/issues/618

Did not work. Now ajenti is not starting:

08.04.2015 08:51 ajenti-panel:105              INFO  Using config file /etc/ajenti/config.json
08.04.2015 08:51 ajenti-panel:130              INFO  Ajenti starting in foreground
Traceback (most recent call last):
  File "/usr/bin/ajenti-panel", line 137, in <module>
    from ajenti import core
  File "/usr/lib/pymodules/python2.7/ajenti/core.py", line 18, in <module>
    import ajenti.licensing
  File "/usr/lib/pymodules/python2.7/ajenti/licensing.py", line 8, in <module>
    from ajenti.ipc import IPCHandler
  File "/usr/lib/pymodules/python2.7/ajenti/ipc.py", line 2, in <module>
    from gevent.pywsgi import WSGIServer, WSGIHandler
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 12, in <module>
    from gevent import socket
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg/gevent/socket.py", line 659, in <module>
    from gevent.ssl import sslwrap_simple as ssl, SSLError as sslerror, SSLSocket as SSLType
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg/gevent/ssl.py", line 386, in <module>
    def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
NameError: name 'PROTOCOL_SSLv3' is not defined

K-Ko     commented    

on 2 May

+1

pfz     commented    

on 4 May

+1.

@hydrosIII The patch actually works. Here what I did, replacing gevent from debian/jessie by gevent from easy_install (like you did), and doing this;

aptitude install python-setuptools python-dev
easy_install -U gevent
sed -i -e s/ssl_version=PROTOCOL_SSLv3/ssl_version=PROTOCOL_SSLv23/ /usr/local/lib/python2.7/dist-packages/gevent-1.
0.1-py2.7-linux-x86_64.egg/gevent/ssl.py
service ajenti restart

It works fine.

Here the original ajenti.log before that :

2015-05-03 22:47:19,186 INFO     core.run(): Ajenti 1.2.22.19 running on platform: debian
2015-05-03 22:47:19,186 INFO    : Ajenti 1.2.22.19 running on platform: debian
 manager: org.freedesktop.DBus.Error.ServiceUnknown: The name com.ubuntu.Upstart was not provided by any .service files
2015-05-03 22:47:19,194 INFO    : Disabling Upstart service manager: org.freedesktop.DBus.Error.ServiceUnknown: The name com.ubuntu.Upstart was not provided by any .service files
2015-05-03 22:47:19,236 INFO    : Disabling systemd service manager: global name 'SystemdService' is not defined
2015-05-03 22:47:19,241 WARNING :  *** [elements] Plugin error: format error
2015-05-03 22:47:19,633 INFO    : Starting server on (u'0.0.0.0', 8000)
2015-05-03 22:47:19,635 INFO    : SSL enabled: /etc/ajenti/ajenti.pem
2015-05-03 22:47:19,640 INFO    : Starting new HTTP connection (1): meta.ajenti.org
", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/gevent/server.py", line 102, in wrap_socket_and_handle
    ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
  File "/usr/lib/python2.7/dist-packages/gevent/ssl.py", line 382, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/dist-packages/gevent/ssl.py", line 84, in __init__
    ctx = SSLContext(ssl_version)
NameError: global name 'SSLContext' is not defined
<Greenlet at 0x7f197ffd92d0: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x7f1980002c50 fileno=8 address=0.0.0.0:8000>>(<socket at 0x7f19807b2d10 fileno=13 sock=127.0.0.1, ('127.0.0.1', 39861))> failed with NameError

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/gevent/server.py", line 102, in wrap_socket_and_handle
    ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
  File "/usr/lib/python2.7/dist-packages/gevent/ssl.py", line 382, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/dist-packages/gevent/ssl.py", line 84, in __init__
    ctx = SSLContext(ssl_version)
NameError: global name 'SSLContext' is not defined
<Greenlet at 0x7f197ffd92d0: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x7f1980002c50 fileno=8 address=0.0.0.0:8000>>(<socket at 0x7f19807b2d10 fileno=13 sock=127.0.0.1, ('127.0.0.1', 39862))> failed with NameError

K-Ko     commented    

on 4 May

pfz     commented    

on 9 May

@tylerhoot at which step are you stuck ?

stopspazzing     commented    

on 10 May

I had same issue, I fixed it myself with a simple edit. The problem is due to the fact that gevent hasn’t updated to 1.03 and applied the fixes that are ready to go. Not sure what their hold up is but whatever.

@tylerhoot

How to fix:

vi /usr/lib/python2.7/dist-packages/gevent/ssl.py

—>Find "ssl_version=PROTOCOL_SSLv3" — Change to "ssl_version=PROTOCOL_SSLv23"

service ajenti restart

Takes a simple 20 seconds. On next gevent update will be this way anyways.

Mel0ne     commented    

on 22 May

@stopspazzing i have the same problem, but in ssl.py a have already PROTOCOL_SSLv23

stopspazzing     commented    

on 22 May

@Mel0ne Did you restart the process? Should work after a restart. You sure you are getting same error? because if it’s same issue then would be same error.

Mel0ne     commented    

on 22 May

@stopspazzing method by @pfz  helped me 🙂

brad999     commented    

on 25 May

After following the instructions from @pfz I am able to get to the login page, log in, and get nothing but a blank page with the ajenti header.

This is what is in my ajenti.log. Any advice?

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/server.py", line 103, in wrap_socket_and_handle
    return self.handle(ssl_socket, address)
  File "/usr/lib/python2.7/dist-packages/socketio/server.py", line 124, in handle
    handler.handle()
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 184, in handle
    result = self.handle_one_request()
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 294, in handle_one_request
    self.requestline = self.read_requestline()
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 287, in read_requestline
    return self.rfile.readline(MAX_REQUEST_LINE)
  File "/usr/lib/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/_sslgte279.py", line 415, in recv
    return socket.recv(self, buflen, flags)
TypeError: 'member_descriptor' object is not callable
<Greenlet at 0x7fc634487870: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x7fc635b7e990 fileno=8 address=0.0.0.0:8000>>(<socket at 0x7fc634079910 fileno=-1>, ('192.168.1.155', 12549))> failed with TypeError

pfz     commented    

on 25 May

@brad999 I’m no py expert, but it looks like a socket binding error. May be you still have an ajenti process. Try netstat -apnt |grep LISTEN|grep ":8000" to find anything attached to *:8000

brad999     commented    

on 25 May

@pfz Below are the results of the netstat. It shows that ajenti is running on 8000.

root@host:~# netstat -apnt | grep LISTEN | grep ":8000"
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      5194/python

root      5194     1  0 May24 ?        00:00:02 /usr/bin/python /usr/bin/ajenti-panel -d

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


https://github.com/ajenti/ajenti/issues/702

Губарь Маргарита Александровна