Install issues: indico-celery cannot import name bytes_type


#1

I’m trying to migrate an existing install from one server to another without upgrade. We’re using Indico 2.0.3 on Debian 9 (stretch). I’m following the install procedure described here with three variations:

  1. We’re using the Debian postgres, not the upstream repository
  2. I’m installing into /var/local/indico/ instead of /opt/indico/ (I’ve made appropriate changes everywhere)
  3. I’m installing 2.0.3, so my pip install command is pip install indico==2.0.3

I actually have two issues. uWSGI silently fails to start when using these instructions, but I’m still troubleshooting that bit.

My second issue which I want to address here is that indico-celery fails to start while trying to import its dependencies. journalctl -xe -t indico-celery gives me the following traceback:

Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]: Traceback (most recent call last):
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/bin/indico", line 10, in <module>
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     sys.exit(cli())
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     return self.main(*args, **kwargs)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/flask/cli.py", line 380, in main
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     return AppGroup.main(self, *args, **kwargs)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/click/core.py", line 697, in main
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     rv = self.invoke(ctx)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     return _process_result(sub_ctx.command.invoke(sub_ctx))
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     return ctx.invoke(self.callback, **ctx.params)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     return callback(*args, **kwargs)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     return f(get_current_context(), *args, **kwargs)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/flask/cli.py", line 256, in decorator
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     with __ctx.ensure_object(ScriptInfo).load_app().app_context():
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/flask/cli.py", line 229, in load_app
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     rv = self.create_app(self)
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/indico/cli/util.py", line 36, in _create_app
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     from indico.web.flask.app import make_app
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/indico/web/flask/app.py", line 36, in <module>
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     from indico.core.auth import multipass
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/indico/core/auth.py", line 23, in <module>
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     from flask_multipass.providers.oauth import OAuthInvalidSessionState
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/flask_multipass/providers/oauth.py", line 11, in <module>
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     import flask_oauthlib.client
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/flask_oauthlib/client.py", line 20, in <module>
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     from .utils import to_bytes
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:   File "/var/local/indico/.venv/local/lib/python2.7/site-packages/flask_oauthlib/utils.py", line 5, in <module>
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]:     from oauthlib.common import to_unicode, bytes_type
Jan 23 22:14:17 amnesiac.example.com indico-celery[9600]: ImportError: cannot import name bytes_type

It looks like the problem may be that the Indico setup.py isn’t specific enough about its dependencies, and I’m getting a newer version of a dependency that 2.0.3 can’t use.


#2

This error happens due to an update of a dependency’s dependency:

Please see the comments there. If you pip install 'requests-oauthlib<1.2.0' after uninstalling oauthlib and then run pip install 'indico==2.0.3' again everything should work.


That aside, you need to update as soon as possible. 2.0.x is not supported anymore, and the various 2.1 versions include bugfixes and (minor) security fixes as well.


#3

Aha! Thanks. My previous searches didn’t turn that one up.

And yes, I intend to upgrade soon. This is a temporary step to work around some general issues on the machine running our current install.