upgrading 0.4.x to 0.5 database error.

Ed Wong cc at pw-wspx.org
Mon Dec 23 15:46:54 UTC 2019


Hi,

I'm running Kallithea 0.4.0 and tried to upgrade to 0.5.0; but at the
point of running "alembic -c my_new.ini upgrade", I got the following
error:

2019-12-23 15:42:40.924 INFO  [alembic.runtime.migration] Running
upgrade ad357ccd9521 -> b74907136bc1, Create table for ssh keys
2019-12-23 15:42:41.609 INFO  [alembic.runtime.migration] Running
upgrade b74907136bc1 -> 151b4a4e8c48, db: migration step after
93834966ae01 dropped non-nullable inherit_default_permissions
2019-12-23 15:42:42.575 INFO  [alembic.runtime.migration] Running
upgrade 151b4a4e8c48 -> 4851d15bc437, db: migration step after
95c01895c006 failed to add usk_public_key_idx in alembic step b74907136bc1
Traceback (most recent call last):
  File "/var/www/environments/kalivenv/bin/alembic", line 11, in <module>
    load_entry_point('alembic', 'console_scripts', 'alembic')()
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/config.py",
line 527, in main
    CommandLine(prog=prog).main(argv=argv)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/config.py",
line 521, in main
    self.run_cmd(cfg, options)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/config.py",
line 501, in run_cmd
    **dict((k, getattr(options, k, None)) for k in kwarg)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/command.py",
line 276, in upgrade
    script.run_env()
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/script/base.py",
line 475, in run_env
    util.load_python_file(self.dir, "env.py")
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/util/pyfiles.py",
line 90, in load_python_file
    module = load_module_py(module_id, path)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/util/compat.py",
line 216, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/kallithea/alembic/env.py",
line 105, in <module>
    run_migrations_online()
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/kallithea/alembic/env.py",
line 99, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/runtime/environment.py",
line 839, in run_migrations
    self.get_context().run_migrations(**kw)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/runtime/migration.py",
line 361, in run_migrations
    step.migration_fn(**kw)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/kallithea/alembic/versions/4851d15bc437_db_migration_step_after_95c01895c006_.py",
line 39, in upgrade
    batch_op.create_index('usk_public_key_idx', ['public_key'],
unique=False)
  File "/opt/python27/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/operations/base.py",
line 325, in batch_alter_table
    impl.flush()
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/operations/batch.py",
line 73, in flush
    fn(*arg, **kw)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/ddl/impl.py",
line 275, in create_index
    self._exec(schema.CreateIndex(index))
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/alembic-1.0.8-py2.7.egg/alembic/ddl/impl.py",
line 134, in _exec
    return conn.execute(construct, *multiparams, **params)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/engine/base.py",
line 980, in execute
    return meth(self, multiparams, params)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py",
line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/engine/base.py",
line 1042, in _execute_ddl
    compiled,
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/engine/base.py",
line 1240, in _execute_context
    e, statement, parameters, cursor, context
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/engine/base.py",
line 1458, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/util/compat.py",
line 296, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/engine/base.py",
line 1236, in _execute_context
    cursor, statement, parameters, context
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/sqlalchemy/engine/default.py",
line 536, in do_execute
    cursor.execute(statement, parameters)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/MySQLdb/cursors.py",
line 205, in execute
    self.errorhandler(self, exc, value)
  File
"/var/www/environments/kalivenv/lib/python2.7/site-packages/MySQLdb/connections.py",
line 36, in defaulterrorhandler
    raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError)
(1170, "BLOB/TEXT column 'public_key' used in key specification without
a key length") [SQL: u'CREATE INDEX usk_public_key_idx ON user_ssh_keys
(public_key)'] (Background on this error at: http://sqlalche.me/e/e3q8)


Am I missing some step?  I followed
https://kallithea.readthedocs.io/en/latest/upgrade.html.

I'm using MySQL 5.7.

Thanks

Edmund


More information about the kallithea-general mailing list