Project

General

Profile

Actions

Bug #5151

closed

Invalid "lock" field in database after upgrade from 1.6.0 (w/ solution)

Added by Systems Administration about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
02.01.2017
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

Had Rhodecode 1.6.0, upgraded to Enterprise 4.5.2 and then to Community 4.5.2.
A few repositories were locked, and the locked field in the repositories table contained values like:

2:1390490226.2
47:1425983969.33

Attempts to start the indexer using rhodecode-index lead to the following:

$ ~/.rccontrol/community-1/profile/bin/rhodecode-index --instance-name=community-1
Using <WhooshIndexBuilder(/opt/rhodecode/.rccontrol/community-1/data/index)> for building full text search
Indexing data types ['commits', 'files']
Internal server error

The log contains:

ERROR [rhodecode.api] Unhandled exception occured on api call:
Traceback (most recent call last):
File "/opt/rhodecode/store/cgg0ln7k2xdn96xi5kp8phzl5320aay9-python2.7-rhodecode-enterprise-ce-4.5.2/lib/python2.7/site-packages/rhodecode/api/init.py", line 254, in request_view
ret_value = func(**call_params)
File "/opt/rhodecode/store/cgg0ln7k2xdn96xi5kp8phzl5320aay9-python2.7-rhodecode-enterprise-ce-4.5.2/lib/python2.7/site-packages/rhodecode/api/views/repo_api.py", line 263, in get_repos
for repo in repo_list]
File "/opt/rhodecode/store/cgg0ln7k2xdn96xi5kp8phzl5320aay9-python2.7-rhodecode-enterprise-ce-4.5.2/lib/python2.7/site-packages/rhodecode/model/db.py", line 1637, in get_api_data
user_id, _time, _reason = self.locked
File "/opt/rhodecode/store/7whz4rq77cg2az9ywlay6myk72rcpizg-python2.7-SQLAlchemy-0.9.9/lib/python2.7/site-packages/sqlalchemy/ext/hybrid.py", line 742, in __get
_
return self.fget(instance)
File "/opt/rhodecode/store/cgg0ln7k2xdn96xi5kp8phzl5320aay9-python2.7-rhodecode-enterprise-ce-4.5.2/lib/python2.7/site-packages/rhodecode/model/db.py", line 1358, in locked
user_id, timelocked, reason = self._locked.split(':')
ValueError: need more than 2 values to unpack

Fixed executing the following query:

UPDATE repositories SET locked = locked || ':no reason' WHERE locked IS NOT NULL;

Actions #1

Updated by Marcin Kuzminski [CTO] about 7 years ago

Thanks for reporting this, we'll add a patch to "handle" this better for older RC releases ! Enjoy our community version !

Actions #2

Updated by Marcin Kuzminski [CTO] about 7 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF