[socketio + gevent] UnicodeError: ('The value must be a native string', 'Access-Control-Max-Age', 3600) #838

Open
pahaz opened this Issue Dec 20, 2015 · 10 comments

Projects

None yet

7 participants

@pahaz
Contributor
pahaz commented Dec 20, 2015
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1rc2-py2.7-linux-x86_64.egg/gevent/greenlet.py", line 522, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1rc2-py2.7-linux-x86_64.egg/gevent/baseserver.py", line 153, in _close_when_done
    return handle(*args)
  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.1rc2-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 411, in handle
    result = self.handle_one_request()
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1rc2-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 626, in handle_one_request
    self.handle_one_response()
  File "/usr/local/lib/python2.7/dist-packages/ajenti-1.2.22.24-py2.7.egg/ajenti/http.py", line 25, in handle_one_response
    return SocketIOHandler.handle_one_response(self)
  File "/usr/lib/python2.7/dist-packages/socketio/handler.py", line 122, in handle_one_response
    return self._do_handshake(handshake_tokens.groupdict())
  File "/usr/lib/python2.7/dist-packages/socketio/handler.py", line 64, in _do_handshake
    self.write_smart(data)
  File "/usr/lib/python2.7/dist-packages/socketio/handler.py", line 88, in write_smart
    self.write_plain_result(data)
  File "/usr/lib/python2.7/dist-packages/socketio/handler.py", line 78, in write_plain_result
    ("Content-Type", "text/plain"),
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1rc2-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 741, in start_response
    raise UnicodeError("The value must be a native string", header, value)
UnicodeError: ('The value must be a native string', 'Access-Control-Max-Age', 3600)
<Greenlet at 0x7f77501dbeb0: _close_when_done(<socket at 0x7f77501cfe50 fileno=[Errno 9] Bad fil, ('88.85.211.202', 16665))> failed with UnicodeError

pip2 freeze

ajenti==1.2.22.24
apt-xapian-index==0.45
chardet==2.0.1
Cheetah==2.4.4
cloud-init==0.7.5
configobj==4.7.2
gevent==1.1rc2
gevent-socketio==0.3.6
gevent-websocket==0.9.3
greenlet==0.4.9
jsonpatch==1.3
jsonpointer==1.0
Landscape-Client==14.12
lockfile==0.8
lxml==3.3.3
Mako==0.9.1
MarkupSafe==0.18
meld3==0.6.10
oauth==1.0.1
PAM==0.4.2
passlib==1.5.3
Pillow==2.3.0
prettytable==0.7.2
psutil==1.2.1
pygobject==3.12.0
pyOpenSSL==0.13
pyserial==2.6
python-apt===0.9.3.5ubuntu2
python-catcher==0.1.7
python-daemon==1.5.5
python-debian===0.1.21-nmu2ubuntu2
python-exconsole==0.1.5
python-ldap==2.4.10
PyYAML==3.10
reconfigure==0.1.72
requests==2.2.1
six==1.5.2
ssh-import-id==3.21
supervisor==3.0b2
Twisted-Core==13.2.0
urllib3==1.7.1
zope.interface==4.0.5
@pahaz
Contributor
pahaz commented Dec 20, 2015

iancmcc/ouimeaux#103 some investigation

@pahaz
Contributor
pahaz commented Dec 20, 2015

#815 - solution

easy_install -U gevent==1.1b4
@pahaz
Contributor
pahaz commented Dec 20, 2015

Coud you plese change requirements.txt file?

@pahaz pahaz added a commit to pahaz/ajenti that referenced this issue Dec 20, 2015
@pahaz pahaz fix(requirements.txt): gevent==1.1b4 for #838 e988f38
@pahaz
Contributor
pahaz commented Dec 20, 2015
@padhia
padhia commented Jan 1, 2016

I ran into the same issue. It seems gevent is installed in two places: /usr/local/lib/python2.7/dist-packages and /usr/lib/python2.7/dist-packages. The package from former location is found first but has incorrect version and causes the error. However the package from the latter location is of the correct version. I am on Ubuntu 15.10. Not sure what I did to install gevent on /usr/local/lib/python2.7/dist-packages. Any insight would be helpful. Thanks

@gustarus

@pahaz thank you for your answer! It really helped!

easy_install -U gevent==1.1b4
@dsifford
dsifford commented Feb 5, 2016

@pahaz 's solution also worked for me. Ubuntu Wily Werewolf.

@lpdrummerboy87

@pahaz 's solution worked for me on Ubuntu Server 14.04 as well. Thanks!

@jabowery

I ran into the same issue on Debian as @padhia. I've been running into a series of problems with ajenti on Debian. I had installed ajenti with:

# apt-get install ajenti

@izzycole

Thanks,
easy_install -U gevent==1.1b4
solved it for me on Raspbian (jessie)

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