DB upgrade failure during 2.2 upgrade


I tried to upgrade 2.1.7 instance to 2…2(.2). pip ran successfully but when I tried to execute the DB upgrade (indico db upgrade) I got a syntax error… Not sure what I made wrong, I think I followed the ReadTheDocs documentation for the upgrade. The command traceback is below.


(.venv)-bash-4.2$ indico db upgrade
Traceback (most recent call last):
  File "/opt/indico/.venv/bin/indico", line 10, in <module>
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 1135, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 641, in make_context
    self.parse_args(ctx, args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 1089, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 935, in parse_args
    parser = self.make_parser(ctx)
  File "/opt/indico/.venv/lib/python2.7/site-packages/click/core.py", line 870, in make_parser
    for param in self.get_params(ctx):
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/cli/util.py", line 116, in get_params
    return self._impl.get_params(ctx)
  File "/opt/indico/.venv/lib/python2.7/site-packages/werkzeug/utils.py", line 91, in __get__
    value = self.func(obj)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/cli/util.py", line 101, in _impl
    return getattr(import_module(module), name)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/cli/database.py", line 23, in <module>
    from indico.core.db.sqlalchemy.migration import PluginScriptDirectory, migrate, prepare_db
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/db/sqlalchemy/migration.py", line 19, in <module>
    from indico.core.db.sqlalchemy.util.management import create_all_tables, get_all_tables
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/db/sqlalchemy/util/management.py", line 14, in <module>
    from indico.core.db.sqlalchemy.protection import ProtectionMode
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/db/sqlalchemy/protection.py", line 28, in <module>
    from indico.util.user import iter_acl
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/util/user.py", line 12, in <module>
    from indico.legacy.common.cache import GenericCache
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/legacy/common/cache.py", line 18, in <module>
    from indico.core.config import config
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/config.py", line 19, in <module>
    from celery.schedules import crontab
  File "/opt/indico/.venv/lib/python2.7/site-packages/celery/__init__.py", line 153, in <module>
    from . import local  # noqa
  File "/opt/indico/.venv/lib/python2.7/site-packages/celery/local.py", line 17, in <module>
    from .five import PY3, bytes_if_py2, items, string, string_t
  File "/opt/indico/.venv/lib/python2.7/site-packages/celery/five.py", line 7, in <module>
    import vine.five
  File "/opt/indico/.venv/lib/python2.7/site-packages/vine/__init__.py", line 6, in <module>
    from .abstract import Thenable
  File "/opt/indico/.venv/lib/python2.7/site-packages/vine/abstract.py", line 8
    class Thenable(Callable, metaclass=abc.ABCMeta):  # pragma: no cover
SyntaxError: invalid syntax

sounds like some python 3-only code is running. maybe one of our dependencies screwed up there releases; I’ll have a look tomorrow/later…

actually, what does pip freeze | grep vine show?


I am still running Python 2.7. Is the recommandation to run Python 3 instead? I may have missed it…

Nothing urgent! It is on a test system!


Sounds like you used --pre in the pip install -U ... command. You shouldn’t have gotten a prerelease of that packages!

pip uninstall -y vine and pip install vine should hopefully fix it.

PS: the first version to support (require) python 3 will be indico v3.0; until then 2.7 is what you need

You are right. I don’t know why but I add this option in my upgrade instructions that I copy/paste each time… I fixed them. As you said, uninstalling/reinstalling vine was enough to fix the problem.

Thanks for your help!