0
Fixed

Ajenti fails to start (but with [ OK ] ), logs: "ImportError: No module named socketio.handler"

Jakub Darmach 10 years ago updated by Thibaut 10 years ago 30
Fresh install of Ajenti on CentOS 6.5
Fails to start, logs:
Traceback (most recent call last):
File "/usr/bin/ajenti-panel", line 124, in <module>
from ajenti import core
File "/usr/lib/python2.6/site-packages/ajenti/core.py", line 20, in <module>
from ajenti.http import HttpRoot, RootHttpHandler
File "/usr/lib/python2.6/site-packages/ajenti/http.py", line 9, in <module>
from socketio.handler import SocketIOHandler
ImportError: No module named socketio.handler

GOOD, I'M SATISFIED
Wow, many fast, such pro, much speed ,)
Satisfaction mark by Jakub Darmach 10 years ago
Under review
Fixed. yum clean all && yum reinstall python-gevent-socketio
Hello I tried yum clean all && yum reinstall python-gevent-socketio

but still with same error

ajenti-panel -v
19.08.2014 02:55 ajenti-panel:105 INFO Using config file /etc/ajenti/config.json
19.08.2014 02:55 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/python2.6/site-packages/ajenti/core.py", line 20, in <module>
from ajenti.http import HttpRoot, RootHttpHandler
File "/usr/lib/python2.6/site-packages/ajenti/http.py", line 9, in <module>
from socketio.handler import SocketIOHandler
ImportError: No module named socketio.handler



I have the same error as well, on Ubuntu.
Which python-gevent-socketio version is installed?
Does this help?

user@server:~# which python
/usr/bin/python
user@server:~# python
Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/pymodules/python2.7']
What's the output of following Python code?

>>> import socketio
>>> print socketio.__version__

I got this : (0, 3, 5)
Can you double check that your error is the same as original poster's? It doesn't look so, your socketio installation seems fine.
This is the error I have:
Traceback (most recent call last):
  File "/usr/bin/ajenti-panel", line 124, in <module>
    from ajenti import core
  File "/usr/lib/pymodules/python2.7/ajenti/core.py", line 21, in <module>
    from ajenti.middleware import SessionMiddleware, AuthenticationMiddleware
  File "/usr/lib/pymodules/python2.7/ajenti/middleware.py", line 11, in <module>
    from ajenti.users import UserManager
  File "/usr/lib/pymodules/python2.7/ajenti/users.py", line 3, in <module>
    from passlib.hash import sha512_crypt
ImportError: No module named passlib.hash

The weird thing when I try to restart Ajenti is that it says that it's not running and start. But when I redo the restart, it's actually not running:

# service ajenti restart
Stopping Ajenti:
 * not running
Starting Ajenti:
22.08.2014 16:22 INFO  Using config file /etc/ajenti/config.json
 * started
# service ajenti restart
Stopping Ajenti:
 * not running
Starting Ajenti:
22.08.2014 16:23 INFO  Using config file /etc/ajenti/config.json
 * started
See, your error is about a completely different module :/
Is python-passlib installed? What is passlib.__version__? (import passlib).
Package: python-passlib
Version: 1.5.3-1~bpo60+1

Apt shows that the package is installed but the python import gives this:

  File "", line 1, in 
ImportError: No module named pass lib

I don't know why this is happening now because it's a fresh install. And when I installed my dev server a few days ago it didn't happen and the Ajenti install was smooth...
Are passlib files installed in /usr/lib/python2.7/dist-packages/passlib ?
Are you using Ubuntu repository? 1.5.3-1~bpo60 is a package from our Debian repository, Ubuntu one is 1.5.3-2
I started from scratch again and installed python-passlib from the Ubuntu repo prior to installing Ajenti. It seems it's okay now.
passlib.__version__ returns 1.5.3
python-passlib:
  Installed: 1.5.3-2
  Candidate: 1.5.3-2
  Version table:
 *** 1.5.3-2 0
        500 http://repo.ajenti.org/ng/debian/ main/ubuntu i386 Packages
        100 /var/lib/dpkg/status
     1.5.3-0ubuntu3 0
        500 http://mirrors.digitalocean.com/ubuntu/ trusty/main i386 Packages
Great. Most probably, you used our Debian-specific repo for the previous installation.
Today I upgraded my system and python-passlib was upgraded from your repo. I reverted it back. Is it mandatory that you provide this package? I don't know, maybe I'm (not) the only one facing this specific issue?
Your apt-cache output indicates that you have already been using python-passlib from our repo. Or is that a different machine now? In that case, please post apt-cache policy python-passlib output for it.
Okay, understood. Just found the solution by re-reading your comment above. I didn't pay attention to the fact that you have different Ubuntu/Debian repos. I must have copied the repo address from another page, inadvertently.
Is there a quick fix I can apply?
Sorry but there is a website I absolutely need to add to Ajenti V and configure the email address asap...
You can still use v0.3.5 from the repo (select it with e.g. aptitude)
0.3.6-1

user@server:~# apt-cache show python-gevent-socketio
Package: python-gevent-socketio
Source: gevent-socketio
Version: 0.3.6-1
Architecture: all
Maintainer: Alexandre Bourget 
Installed-Size: 145
Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8), python-gevent, python-gevent-websocket
Priority: optional
Section: python
Filename: pool/main/g/gevent-socketio/python-gevent-socketio_0.3.6-1_all.deb
Size: 27422
SHA256: 2b6967a412b9ffe50be62fb6fd4e22f7feb597b2e6da1028f2b36d8654f57d98
SHA1: 9de586aa0c6b8f8f944ce9bbbeb391d686b1cf0d
MD5sum: d5639440d4006a3552b055c1257da8c7
Description: SocketIO server based on the Gevent pywsgi server, a Python
Description-md5: e52a7b012fc3d3fd19ce82fbde870dcb