Skip to content

sqlite Migration: add approval whitelists to protected branches fails #5760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 7 tasks
jsimonetti opened this issue Jan 18, 2019 · 6 comments
Closed
2 of 7 tasks
Labels
issue/duplicate The issue has already been reported.

Comments

@jsimonetti
Copy link

jsimonetti commented Jan 18, 2019

  • Gitea version (or commit ref): docker 1.7.0-rc2
  • Git version:
  • Operating system:
  • 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/18 11:59:09 [I] Log Mode: File(Info)
2019/01/18 11:59:09 [I] XORM Log Mode: File(Info)
2019/01/18 11:59:09 [I] Cache Service Enabled
2019/01/18 11:59:09 [I] Session Service Enabled
2019/01/18 11:59:09 [I] Migration: add approval whitelists to protected branches
2019/01/18 11:59:09 [...itea/routers/init.go:61 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Unknown col "is_empty" in index is_bare of table repository, columns [id 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 is_empty is_mirror is_fork fork_id size is_fsck_enabled topics created_unix updated_unix]

Description

The migration fails because the index was created using:
CREATE INDEX `IDX_repository_is_bare` ON `repository` ("is_empty");

The index should actually be:
CREATE INDEX `IDX_repository_is_bare` ON `repository` (`is_empty`);
(note the backticks instead of quotes)

Manually editting the database and doing:
sqlite> DROP INDEX `IDX_repository_is_bare`;
sqlite> CREATE INDEX `IDX_repository_is_bare` ON `repository` (`is_empty`);

now allows for the db migration to v74 to succeed.

@serverwentdown
Copy link
Contributor

Thanks! This affected me when I upgraded.

@lunny
Copy link
Member

lunny commented Jan 18, 2019

please confirm #5762 fix this issue.

@theasp
Copy link
Contributor

theasp commented Jan 18, 2019

Using the docker image that was pushed after that commit (image c98e58549906), I am still having this issue.

2019/01/18 15:57:04 [...itea/routers/init.go:61 GlobalInit()] [E] Failed to initialize ORM engine: sync database struct error: Unknown col "is_empty" in index is_bare of table repository, columns [id 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 is_empty is_mirror is_fork fork_id size created_unix updated_unix is_fsck_enabled topics]

@zeripath
Copy link
Contributor

If unfortunately you were hit by the migration bug and starting your gitea failed, please follow the below steps:

  • Stop gitea if it's still running
  • Change the value of the table version from 79 to 78
  • Restart gitea

@zeripath zeripath added the issue/duplicate The issue has already been reported. label Jan 18, 2019
@zeripath
Copy link
Contributor

@theasp you may need to explicitly run gitea migrate too

@zeripath
Copy link
Contributor

This is a duplicate of #5759

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

No branches or pull requests

5 participants