"Invalid header" Token on user agent
rafaelzlisboa opened this issue · comments
User is forever stuck in the interstitial page.
After user logs in, during user agent startup, the following exception happens:
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 196, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/usr/lib/python2.7/dist-packages/pixelated/config/__init__.py", line 68, in init_soledad
return init_soledad_and_user_key(app, args.home)
File "/usr/lib/python2.7/dist-packages/pixelated/config/soledad.py", line 24, in init_soledad_and_user_key
leap_home)
File "/usr/lib/python2.7/dist-packages/pixelated/bitmask_libraries/session.py", line 43, in open
session = LeapSessionFactory(provider).create(username, password)
File "/usr/lib/python2.7/dist-packages/pixelated/bitmask_libraries/session.py", line 119, in create
session = self._create_new_session(username, password)
File "/usr/lib/python2.7/dist-packages/pixelated/bitmask_libraries/session.py", line 131, in _create_new_session
soledad = SoledadSessionFactory.create(self._provider, auth.token, auth.uuid, password)
File "/usr/lib/python2.7/dist-packages/pixelated/bitmask_libraries/soledad.py", line 50, in create
return SoledadSession(provider, encryption_passphrase, user_token, user_uuid)
File "/usr/lib/python2.7/dist-packages/pixelated/bitmask_libraries/soledad.py", line 60, in __init__
self.soledad = self._init_soledad(encryption_passphrase)
File "/usr/lib/python2.7/dist-packages/pixelated/bitmask_libraries/soledad.py", line 71, in _init_soledad
local_db, server_url, which_api_CA_bundle(self.provider), self.user_token, defer_encryption=False)
File "/usr/lib/python2.7/dist-packages/leap/soledad/client/__init__.py", line 286, in __init__
self._bootstrap() # might raise BootstrapSequenceError()
File "/usr/lib/python2.7/dist-packages/leap/soledad/client/__init__.py", line 396, in _bootstrap
token, timeout = self._shared_db.lock()
File "/usr/lib/python2.7/dist-packages/leap/soledad/client/__init__.py", line 697, in _shared_db
creds=self._creds)
File "/usr/lib/python2.7/dist-packages/leap/soledad/client/shared_db.py", line 113, in open_database
db.open(create)
File "/usr/lib/python2.7/dist-packages/u1db/remote/http_database.py", line 67, in open
self._check()
File "/usr/lib/python2.7/dist-packages/u1db/remote/http_database.py", line 70, in _check
return self._request_json('GET', [])[0]
File "/usr/lib/python2.7/dist-packages/u1db/remote/http_client.py", line 217, in _request_json
content_type)
File "/usr/lib/python2.7/dist-packages/u1db/remote/http_client.py", line 208, in _request
self._conn.request(method, url_query, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1053, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1092, in _send_request
self.putheader(hdr, value)
File "/usr/lib/python2.7/httplib.py", line 1031, in putheader
raise ValueError('Invalid header value %r' % (one_value,))
exceptions.ValueError: Invalid header value 'Token YmVjNTc3Mzc4NWRkNTRkNWUzM2Y2ZTgwOWM3ZjYyMzc6UDNCWGFBQjBpMmNFMVVJcXhjYWJFcWlM\nVjNXTHNnMmFoV3d2RV9oaXJ5cw=='
Although the exception happens in the user agent, if we run the user agent in activist mode, this problem doesn't happen. We're opening it in the dispatcher instead since it might be related.
moved this to ready and marked as bug. hope thats okay
switching from debian testing to jessie seems to have fixed this (just tested on try).
not sure if it's some sort of incompatibility with the newer version of some python module we're using or if the packages are unstable in the new debian testing (stretch), so i think it's better to leave this be - as jessie - for now.
tested on staging. docker image is correct now and this bug is fixed