SQLite - Unknown col "is_empty" in index is_bare in all Versions after 18.01.2019 #2791

Closed
opened 2025-11-02 04:48:37 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @wofnull on GitHub (Jan 22, 2019).

  • Gitea version (or commit ref): 2d94561
  • Git version: 2.11
  • Operating system: Debian
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    2019/01/22 07:10:25 [I] Log Mode: File(Info)
    2019/01/22 07:10:25 [I] XORM Log Mode: File(Info)
    2019/01/22 07:10:25 [I] Cache Service Enabled
    2019/01/22 07:10:25 [I] Session Service Enabled
    2019/01/22 07:10:25 [I] Beginning ORM engine initialization.
    2019/01/22 07:10:25 [I] ORM engine initialization attempt #1/10...
    2019/01/22 07:10:25 [I] Backing off for 3 seconds
    2019/01/22 07:10:28 [I] ORM engine initialization attempt #2/10...
    2019/01/22 07:10:28 [I] Backing off for 3 seconds
    2019/01/22 07:10:31 [I] ORM engine initialization attempt #3/10...
    2019/01/22 07:10:31 [I] Backing off for 3 seconds
    2019/01/22 07:10:34 [I] ORM engine initialization attempt #4/10...
    2019/01/22 07:10:34 [I] Backing off for 3 seconds
    2019/01/22 07:10:37 [I] ORM engine initialization attempt #5/10...
    2019/01/22 07:10:37 [I] Backing off for 3 seconds
    2019/01/22 07:10:40 [I] ORM engine initialization attempt #6/10...
    2019/01/22 07:10:40 [I] Backing off for 3 seconds
    2019/01/22 07:10:43 [I] ORM engine initialization attempt #7/10...
    2019/01/22 07:10:43 [I] Backing off for 3 seconds
    2019/01/22 07:10:46 [I] ORM engine initialization attempt #8/10...
    2019/01/22 07:10:46 [I] Backing off for 3 seconds
    2019/01/22 07:10:49 [I] ORM engine initialization attempt #9/10...
    2019/01/22 07:10:49 [I] Backing off for 3 seconds
    2019/01/22 07:10:52 [I] ORM engine initialization attempt #10/10...
    2019/01/22 07:10:52 [...itea/routers/init.go:81 GlobalInit()] [E] ORM engine initialization failed: sync database struct error: Unknown col "is_empty" in index is_bare of table repository, columns [i
    d owner_id lower_name name description website default_branch num_watches num_stars num_forks num_issues num_closed_issues num_pulls num_closed_pulls num_milestones num_closed_milestones is_private i
    s_empty is_mirror is_fork fork_id size created_unix updated_unix is_fsck_enabled topics]

Description:

Since the weekend ( last sucessfull DB change Jan 18 01:58 gitea.db ) the gitea instance on my server failed to start after an automatic update to restart, it looks like a db change was not successfully made causing the server to fail on startup.

Switiching back to a version prior to the one from the 18th seems to work for the moment.

Originally created by @wofnull on GitHub (Jan 22, 2019). - Gitea version (or commit ref): 2d94561 - Git version: 2.11 - Operating system: Debian - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: 2019/01/22 07:10:25 [I] Log Mode: File(Info) 2019/01/22 07:10:25 [I] XORM Log Mode: File(Info) 2019/01/22 07:10:25 [I] Cache Service Enabled 2019/01/22 07:10:25 [I] Session Service Enabled 2019/01/22 07:10:25 [I] Beginning ORM engine initialization. 2019/01/22 07:10:25 [I] ORM engine initialization attempt #1/10... 2019/01/22 07:10:25 [I] Backing off for 3 seconds 2019/01/22 07:10:28 [I] ORM engine initialization attempt #2/10... 2019/01/22 07:10:28 [I] Backing off for 3 seconds 2019/01/22 07:10:31 [I] ORM engine initialization attempt #3/10... 2019/01/22 07:10:31 [I] Backing off for 3 seconds 2019/01/22 07:10:34 [I] ORM engine initialization attempt #4/10... 2019/01/22 07:10:34 [I] Backing off for 3 seconds 2019/01/22 07:10:37 [I] ORM engine initialization attempt #5/10... 2019/01/22 07:10:37 [I] Backing off for 3 seconds 2019/01/22 07:10:40 [I] ORM engine initialization attempt #6/10... 2019/01/22 07:10:40 [I] Backing off for 3 seconds 2019/01/22 07:10:43 [I] ORM engine initialization attempt #7/10... 2019/01/22 07:10:43 [I] Backing off for 3 seconds 2019/01/22 07:10:46 [I] ORM engine initialization attempt #8/10... 2019/01/22 07:10:46 [I] Backing off for 3 seconds 2019/01/22 07:10:49 [I] ORM engine initialization attempt #9/10... 2019/01/22 07:10:49 [I] Backing off for 3 seconds 2019/01/22 07:10:52 [I] ORM engine initialization attempt #10/10... 2019/01/22 07:10:52 [...itea/routers/init.go:81 GlobalInit()] [E] ORM engine initialization failed: sync database struct error: Unknown col "is_empty" in index is_bare of table repository, columns [i d owner_id lower_name name description website default_branch num_watches num_stars num_forks num_issues num_closed_issues num_pulls num_closed_pulls num_milestones num_closed_milestones is_private i s_empty is_mirror is_fork fork_id size created_unix updated_unix is_fsck_enabled topics] ## Description: Since the weekend ( last sucessfull DB change Jan 18 01:58 gitea.db ) the gitea instance on my server failed to start after an automatic update to restart, it looks like a db change was not successfully made causing the server to fail on startup. Switiching back to a version prior to the one from the 18th seems to work for the moment.
Author
Owner

@zeripath commented on GitHub (Jan 22, 2019):

Please could you check the value of the version table in sqlite.

SELECT * FROM version

If your version is 79 you have two options:

  • Drop it back to 78 and restart - the migration script should work now. Please get back to us if not.
  • DROP INDEX IF EXISTS IDX_repository_is_bare

If your version is 78 the DROP command above should work but, shouldn't be necessary, and it was definitely working until the last change.

@zeripath commented on GitHub (Jan 22, 2019): Please could you check the value of the version table in sqlite. ```sql SELECT * FROM version ``` If your version is 79 you have two options: * Drop it back to 78 and restart - the migration script should work now. Please get back to us if not. * `DROP INDEX IF EXISTS IDX_repository_is_bare` If your version is 78 the DROP command above should work but, shouldn't be necessary, and it was definitely working until the last change.
Author
Owner

@zeripath commented on GitHub (Jan 22, 2019):

Please get back to us to tell us what version you have

@zeripath commented on GitHub (Jan 22, 2019): Please get back to us to tell us what version you have
Author
Owner

@wofnull commented on GitHub (Jan 22, 2019):

DB Version is 79 as suspected

Set it back to 78 , Update happened upon next restart of GITEA -> Access is now possible again.

@wofnull commented on GitHub (Jan 22, 2019): DB Version is 79 as suspected > Set it back to 78 , Update happened upon next restart of GITEA -> Access is now possible again.
Author
Owner

@zeripath commented on GitHub (Jan 22, 2019):

Cool I'll close this issue.

@zeripath commented on GitHub (Jan 22, 2019): Cool I'll close this issue.
Author
Owner

@xeals commented on GitHub (Jan 23, 2019):

I'm getting the same issue on DB version 74. Not sure how practical the above advice is due to skipping migrations. Any advice?

@xeals commented on GitHub (Jan 23, 2019): I'm getting the same issue on DB version 74. Not sure how practical the above advice is due to skipping migrations. Any advice?
Author
Owner

@zeripath commented on GitHub (Jan 23, 2019):

Have you tried gitea migrate?

@zeripath commented on GitHub (Jan 23, 2019): Have you tried `gitea migrate`?
Author
Owner

@xeals commented on GitHub (Jan 23, 2019):

I thought I had and was getting a non-working result, but it's now working. Sorry for the hassle.

@xeals commented on GitHub (Jan 23, 2019): I thought I had and was getting a non-working result, but it's now working. Sorry for the hassle.
Author
Owner

@MNickelson commented on GitHub (Jan 25, 2019):

My database says it's version 79. I will try resetting it to 78 or dropping it tonight.

@MNickelson commented on GitHub (Jan 25, 2019): My database says it's version 79. I will try resetting it to 78 or dropping it tonight.
Author
Owner

@andrew-from-toronto commented on GitHub (Jul 14, 2019):

I've just recently hit this as well - dropping index resolved (changing version to 78 broke things more), but seems like bad migration if it's happening to multiple people.

@andrew-from-toronto commented on GitHub (Jul 14, 2019): I've just recently hit this as well - dropping index resolved (changing version to 78 broke things more), but seems like bad migration if it's happening to multiple people.
Author
Owner

@zeripath commented on GitHub (Jul 14, 2019):

@andrewhunt12 we need a little more info - we've put multiple fixes in for this. We even run the migration on a test db for every pr, merge, release and tag.

So if it's still not working could you please tell us when and how you hit this.

@zeripath commented on GitHub (Jul 14, 2019): @andrewhunt12 we need a little more info - we've put multiple fixes in for this. We even run the migration on a test db for every pr, merge, release and tag. So if it's still not working could you please tell us when and how you hit this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2791