database update issue #2084

Closed
opened 2025-11-02 04:23:39 -06:00 by GiteaMirror · 14 comments
Owner

Originally created by @migolovanov on GitHub (Jul 21, 2018).

When i tried to apply v1.5.0-rc2, got issue while starting gitea with following error:

2018/07/21 18:23:28 [I] Log Mode: File(Info) 2018/07/21 18:23:28 [I] XORM Log Mode: File(Info) 2018/07/21 18:23:28 [I] Cache Service Enabled 2018/07/21 18:23:28 [I] Session Service Enabled 2018/07/21 18:23:28 [I] Migration: remove commits and settings unit types 2018/07/21 18:23:28 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Error 1054: Unknown column 'index' in 'field list'

Originally created by @migolovanov on GitHub (Jul 21, 2018). When i tried to apply v1.5.0-rc2, got issue while starting gitea with following error: `2018/07/21 18:23:28 [I] Log Mode: File(Info) 2018/07/21 18:23:28 [I] XORM Log Mode: File(Info) 2018/07/21 18:23:28 [I] Cache Service Enabled 2018/07/21 18:23:28 [I] Session Service Enabled 2018/07/21 18:23:28 [I] Migration: remove commits and settings unit types 2018/07/21 18:23:28 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Error 1054: Unknown column 'index' in 'field list'`
GiteaMirror added the type/bug label 2025-11-02 04:23:39 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jul 21, 2018):

@migolovanov which database/OS are you using?

Edit: Also, how are you installing Gitea? As the official release of the RC isn't out yet.

@techknowlogick commented on GitHub (Jul 21, 2018): @migolovanov which database/OS are you using? Edit: Also, how are you installing Gitea? As the official release of the RC isn't out yet.
Author
Owner

@lafriks commented on GitHub (Jul 21, 2018):

From what version are you upgrading?

@lafriks commented on GitHub (Jul 21, 2018): From what version are you upgrading?
Author
Owner

@migolovanov commented on GitHub (Jul 21, 2018):

I migrated from gogs to 1.0.0, then updated to 1.4.3 and then to 1.5.0-rc1.
Database is mysql and since i enabled indexing i see "index" column in follwing tables: commit_status, issue, pull_request

@migolovanov commented on GitHub (Jul 21, 2018): I migrated from gogs to 1.0.0, then updated to 1.4.3 and then to 1.5.0-rc1. Database is mysql and since i enabled indexing i see "index" column in follwing tables: commit_status, issue, pull_request
Author
Owner

@lafriks commented on GitHub (Jul 21, 2018):

Do you see in xorm.log at what SQL it fails?

@lafriks commented on GitHub (Jul 21, 2018): Do you see in xorm.log at what SQL it fails?
Author
Owner

@migolovanov commented on GitHub (Jul 21, 2018):

Yes there are following requests:

2018/07/21 19:02:49 [I] PING DATABASE mysql
2018/07/21 19:02:49 [I] [SQL] SELECT `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? and `TABLE_NAME`=? []interface {}{"gogs", "version"}
2018/07/21 19:02:49 [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [gogs version id]
2018/07/21 19:02:49 [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [gogs version version]
2018/07/21 19:02:49 [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1}
2018/07/21 19:02:49 [I] [SQL] SELECT `id`, `unit_types` FROM `team` LIMIT 100
2018/07/21 19:02:49 [I] [SQL] DELETE FROM `repo_unit` WHERE `type` IN (?,?) []interface {}{4, 7}
2018/07/21 19:02:49 [I] [SQL] UPDATE `repo_unit` SET `type` = `type` - ?, `index` = `index` - ? WHERE (`type` > ?) []interface {}{1, 1, 7}
@migolovanov commented on GitHub (Jul 21, 2018): Yes there are following requests: ``` 2018/07/21 19:02:49 [I] PING DATABASE mysql 2018/07/21 19:02:49 [I] [SQL] SELECT `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? and `TABLE_NAME`=? []interface {}{"gogs", "version"} 2018/07/21 19:02:49 [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [gogs version id] 2018/07/21 19:02:49 [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [gogs version version] 2018/07/21 19:02:49 [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1} 2018/07/21 19:02:49 [I] [SQL] SELECT `id`, `unit_types` FROM `team` LIMIT 100 2018/07/21 19:02:49 [I] [SQL] DELETE FROM `repo_unit` WHERE `type` IN (?,?) []interface {}{4, 7} 2018/07/21 19:02:49 [I] [SQL] UPDATE `repo_unit` SET `type` = `type` - ?, `index` = `index` - ? WHERE (`type` > ?) []interface {}{1, 1, 7} ```
Author
Owner

@lafriks commented on GitHub (Jul 21, 2018):

What is result for such query in database?

SELECT `id`, `version` FROM `version` WHERE `id`=1 LIMIT 1;
@lafriks commented on GitHub (Jul 21, 2018): What is result for such query in database? ``` SELECT `id`, `version` FROM `version` WHERE `id`=1 LIMIT 1; ```
Author
Owner

@migolovanov commented on GitHub (Jul 21, 2018):

MariaDB [gogs]> SELECT `id`, `version` FROM `version` WHERE `id`=1 LIMIT 1;
+----+---------+
| id | version |
+----+---------+
|  1 |      38 |
+----+---------+
1 row in set (0.00 sec)
@migolovanov commented on GitHub (Jul 21, 2018): ``` MariaDB [gogs]> SELECT `id`, `version` FROM `version` WHERE `id`=1 LIMIT 1; +----+---------+ | id | version | +----+---------+ | 1 | 38 | +----+---------+ 1 row in set (0.00 sec) ```
Author
Owner

@lafriks commented on GitHub (Jul 21, 2018):

Did upgrade to 1.4.3 was successful? Version number should be much higher for it...

@lafriks commented on GitHub (Jul 21, 2018): Did upgrade to 1.4.3 was successful? Version number should be much higher for it...
Author
Owner

@migolovanov commented on GitHub (Jul 21, 2018):

Yes, it worked fine even on 1.5.0-rc1. But i guess the issue is related to code search which i enabled in config.

@migolovanov commented on GitHub (Jul 21, 2018): Yes, it worked fine even on 1.5.0-rc1. But i guess the issue is related to code search which i enabled in config.
Author
Owner

@migolovanov commented on GitHub (Jul 21, 2018):

I believe i fixed this issue by restoring original DB but updating version number to some higher value (have no idea when it went wrong). By the way, which version number is relevant to 1.5.0-rc2 in db?

@migolovanov commented on GitHub (Jul 21, 2018): I believe i fixed this issue by restoring original DB but updating version number to some higher value (have no idea when it went wrong). By the way, which version number is relevant to 1.5.0-rc2 in db?
Author
Owner

@lafriks commented on GitHub (Jul 21, 2018):

It should be 69 I think

@lafriks commented on GitHub (Jul 21, 2018): It should be 69 I think
Author
Owner

@ptman commented on GitHub (Aug 1, 2018):

is this the only thing blocking 1.5.0 release? did anyone reproduce?

@ptman commented on GitHub (Aug 1, 2018): is this the only thing blocking 1.5.0 release? did anyone reproduce?
Author
Owner

@techknowlogick commented on GitHub (Aug 1, 2018):

@ptman there have been a couple more PRs merged into the 1.5 branch which means there will be likely another RC made before 1.5 gets released.

@techknowlogick commented on GitHub (Aug 1, 2018): @ptman there have been a couple more PRs merged into the 1.5 branch which means there will be likely another RC made before 1.5 gets released.
Author
Owner

@techknowlogick commented on GitHub (Dec 12, 2019):

Closing this issue as we have been unable to reproduce (we have since implemented migration tests into each CI run).

@techknowlogick commented on GitHub (Dec 12, 2019): Closing this issue as we have been unable to reproduce (we have since implemented migration tests into each CI run).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2084