Upgrade Community -1

Veeramani P's Avatar

Veeramani P

25 Sep, 2018 12:46 PM

We doing upgrade for rhodecode version 4.8 to 4.13. We use rccontrol self-update and rccontrol upgrade vcsserver-1. VCS server updated without any problem. But when we upgrade rccontrol upgrade community-1 its getting folling error

*************************
*** SQLA BASE RESET ! ***
*************************
2018-09-25 17:19:56,357 INFO sqlalchemy.engine.base.Engine
ALTER TABLE user_logs ADD user_data_json TEXT(16384)
2018-09-25 17:19:56,357 INFO sqlalchemy.engine.base.Engine ()
2018-09-25 17:19:56,364 INFO sqlalchemy.engine.base.Engine ROLLBACK
Traceback (most recent call last):
  File "/opt/rhodecode/store/05rnz2r9hq1ks2xl7mr2zdcvnrs8iq2b-python2.7-pastescript-2.0.2/bin/.paster-wrapped", line 12, in <module>
    sys.exit(run())
  File "/opt/rhodecode/store/05rnz2r9hq1ks2xl7mr2zdcvnrs8iq2b-python2.7-pastescript-2.0.2/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
    invoke(command, command_name, options, args[1:])
  File "/opt/rhodecode/store/05rnz2r9hq1ks2xl7mr2zdcvnrs8iq2b-python2.7-pastescript-2.0.2/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
    exit_code = runner.run(args)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/paster_commands/__init__.py", line 68, in run
    return super(BasePasterCommand, self).run(args[1:])
  File "/opt/rhodecode/store/05rnz2r9hq1ks2xl7mr2zdcvnrs8iq2b-python2.7-pastescript-2.0.2/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
    result = self.command()
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/paster_commands/upgrade_db.py", line 44, in command
    self.path_to_ini_file, self.options.__dict__.get('force_ask'))
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/rc_commands/upgrade_db.py", line 52, in command
    dbmanage.upgrade()
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/db_manage.py", line 188, in upgrade
    api.upgrade(db_uri, repository_path, step)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/versioning/api.py", line 188, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<decorator-gen-19>", line 2, in _migrate
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/versioning/util/__init__.py", line 159, in with_engine
    return f(*a, **kw)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/versioning/api.py", line 368, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/versioning/schema.py", line 92, in runchange
    change.run(self.engine, step)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/versioning/script/py.py", line 144, in run
    script_func(engine)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/versions/072_version_4_8_0.py", line 42, in upgrade
    user_data.create(table=user_log_table)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/changeset/schema.py", line 535, in create
    engine._run_visitor(visitorcallable, self, connection, **kwargs)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1929, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1538, in _run_visitor
    **kwargs).traverse_single(element)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/changeset/ansisql.py", line 56, in traverse_single
    ret = super(AlterTableVisitor, self).traverse_single(elem)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/changeset/ansisql.py", line 105, in visit_column
    self.execute()
  File "/opt/rhodecode/store/bvs2x0ddj4ibl2a7qgvyk1702yky995m-python2.7-rhodecode-enterprise-ce-4.13.2/lib/python2.7/site-packages/rhodecode/lib/dbmigrate/migrate/changeset/ansisql.py", line 44, in execute
    return self.connection.execute(self.buffer.getvalue())
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 939, in execute
    return self._execute_text(object, multiparams, params)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1097, in _execute_text
    statement, parameters
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/opt/rhodecode/store/w86lbfsp9kyqn32ny5f2k9ilcdq9fzah-python2.7-sqlalchemy-1.1.18/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/rhodecode/store/qy6y6npssdfx02kg1cg66lgazr98lx1l-python2.7-mysql-python-1.2.5/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/opt/rhodecode/store/qy6y6npssdfx02kg1cg66lgazr98lx1l-python2.7-mysql-python-1.2.5/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1060, "Duplicate column name 'user_data_json'") [SQL: u'\nALTER TABLE user_logs ADD user_data_json TEXT(16384)']
Upgrade of RhodeCode Community failed.
Rolling back to previous version.
Auto starting community-1
Supervisord state is: RUNNING
[rhode@kaservices ~]$

Kindly provide the solution for this.

  1. Support Staff 1 Posted by Marcin Kuzminsk... on 25 Sep, 2018 12:55 PM

    Marcin Kuzminski's Avatar

    This is odd, looks like your database is in incosistent state. Could you try to drop the column user_data_json before the upgrade ? it's really just metadata for audit-logs that come in later stages.

  2. 2 Posted by Veeramani P on 25 Sep, 2018 01:30 PM

    Veeramani P's Avatar

    Its not working, When we drop user_data_json after we upgrade community -1 getting error like this

      raise errorclass, errorvalue
    sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1060, "Duplicate column name 'version'") [SQL: u'\nALTER TABLE user_logs ADD version VARCHAR(255)']
    Upgrade of RhodeCode Community failed.
    Rolling back to previous version.
    Auto starting community-1

    after deleting version getting duplicate column name from another table.
    Kindly provide the solution.

  3. Support Staff 3 Posted by Marcin Kuzminsk... on 25 Sep, 2018 02:40 PM

    Marcin Kuzminski's Avatar

    Ok, please try to drop columns:

    user_data_json
    version
    action_data_json

    from user_log table, and try again...

  4. 4 Posted by Veeramani P on 26 Sep, 2018 04:34 AM

    Veeramani P's Avatar

    Finally its working. Rhodecode community updated latest version (4.13)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac