Skip to content
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

Unable to migrate from version 1.7.1 to version 1.8.0-rc1 Docker #6373

Closed
2 of 7 tasks
theobolo opened this issue Mar 19, 2019 · 3 comments
Closed
2 of 7 tasks

Unable to migrate from version 1.7.1 to version 1.8.0-rc1 Docker #6373

theobolo opened this issue Mar 19, 2019 · 3 comments
Labels
Milestone

Comments

@theobolo
Copy link

theobolo commented Mar 19, 2019

  • Gitea version (or commit ref): Docker Image : 1.8 / latest / 1.8.0-rc1
  • Git version: 2.18.1
  • Operating system: Kubernetes 1.12.5 / Ubuntu 18.02
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

Hello guys, i'm trying to update my Dockerized Gitea from 1.7.1 to 1.8 and i'm facing a SQL Migration issue during startup :

2019/03/19 16:03:58 �[1;36m[T] AppPath: /app/gitea/gitea�[0m
2019/03/19 16:03:58 �[1;36m[T] AppWorkPath: /app/gitea�[0m
2019/03/19 16:03:58 �[1;36m[T] Custom path: /data/gitea�[0m
2019/03/19 16:03:58 �[1;36m[T] Log path: /data/gitea/log�[0m
2019/03/19 16:03:58 �[1;32m[I] Gitea v3934d9c built with go1.12.1 : bindata, sqlite, sqlite_unlock_notify�[0m
2019/03/19 16:03:58 �[1;32m[I] Log Mode: File(Debug)�[0m
2019/03/19 16:03:58 �[1;32m[I] Log Mode: Console(Debug)�[0m
2019/03/19 16:03:58 �[1;32m[I] XORM Log Mode: File(Debug)�[0m
2019/03/19 16:03:58 �[1;32m[I] XORM Log Mode: Console(Debug)�[0m
2019/03/19 16:03:58 �[1;32m[I] Cache Service Enabled�[0m
2019/03/19 16:03:58 �[1;32m[I] Session Service Enabled�[0m
2019/03/19 16:03:58 �[1;33m[W] Notify Mail Service: Mail Service is not enabled�[0m
2019/03/19 16:03:58 �[1;32m[I] Beginning ORM engine initialization.�[0m
2019/03/19 16:03:58 �[1;32m[I] ORM engine initialization attempt #1/10...�[0m
2019/03/19 16:03:58 �[1;32m[I] PING DATABASE sqlite3�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? []interface {}{"version"}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`id`%') or (sql like '%[id]%')) [version]�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`version`%') or (sql like '%[version]%')) [version]�[0m
2019/03/19 16:03:58 �[1;32m[I] Migration: hot fix for wrong release sha1 on release table�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] BEGIN TRANSACTION�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `id`, `repo_id`, `sha1`, `tag_name` FROM `release` WHERE (is_tag=?) ORDER BY `id` ASC LIMIT 100 []interface {}{false}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{6}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"23c53a91e836bc7e7c91bbb5c1545ceedf390938", 3}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{28}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"6c406fb2418ae8e4f5898306f0c1b1e99e5a448c", 4}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{19}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"682e67cc983d9b15def6fa098a3b3fbbbd7f592a", 6}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{7}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:03:58 �[1;32m[I] [SQL] ROLL BACK�[0m
2019/03/19 16:03:58 �[1;34m[D] ORM engine initialization attempt #1/10 failed. Error: migrate: do migrate: object does not exist [id: v1.4.5, rel_path: ]�[0m
2019/03/19 16:03:58 �[1;32m[I] Backing off for 3 seconds�[0m
2019/03/19 16:04:01 �[1;32m[I] ORM engine initialization attempt #2/10...�[0m
2019/03/19 16:04:01 �[1;32m[I] PING DATABASE sqlite3�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? []interface {}{"version"}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`id`%') or (sql like '%[id]%')) [version]�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`version`%') or (sql like '%[version]%')) [version]�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1}�[0m
2019/03/19 16:04:01 �[1;32m[I] Migration: hot fix for wrong release sha1 on release table�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] BEGIN TRANSACTION�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `id`, `repo_id`, `sha1`, `tag_name` FROM `release` WHERE (is_tag=?) ORDER BY `id` ASC LIMIT 100 []interface {}{false}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{6}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"23c53a91e836bc7e7c91bbb5c1545ceedf390938", 3}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{28}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"6c406fb2418ae8e4f5898306f0c1b1e99e5a448c", 4}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{19}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"682e67cc983d9b15def6fa098a3b3fbbbd7f592a", 6}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{7}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:01 �[1;32m[I] [SQL] ROLL BACK�[0m
2019/03/19 16:04:01 �[1;34m[D] ORM engine initialization attempt #2/10 failed. Error: migrate: do migrate: object does not exist [id: v1.4.5, rel_path: ]�[0m
2019/03/19 16:04:01 �[1;32m[I] Backing off for 3 seconds�[0m
2019/03/19 16:04:04 �[1;32m[I] ORM engine initialization attempt #3/10...�[0m
2019/03/19 16:04:04 �[1;32m[I] PING DATABASE sqlite3�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? []interface {}{"version"}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`id`%') or (sql like '%[id]%')) [version]�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`version`%') or (sql like '%[version]%')) [version]�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] BEGIN TRANSACTION�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `id`, `repo_id`, `sha1`, `tag_name` FROM `release` WHERE (is_tag=?) ORDER BY `id` ASC LIMIT 100 []interface {}{false}�[0m
2019/03/19 16:04:04 �[1;32m[I] Migration: hot fix for wrong release sha1 on release table�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{6}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"23c53a91e836bc7e7c91bbb5c1545ceedf390938", 3}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{28}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"6c406fb2418ae8e4f5898306f0c1b1e99e5a448c", 4}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{19}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] UPDATE `release` SET `sha1` = ? WHERE `id`=? []interface {}{"682e67cc983d9b15def6fa098a3b3fbbbd7f592a", 6}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `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_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{7}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] SELECT `name` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{2}�[0m
2019/03/19 16:04:04 �[1;32m[I] [SQL] ROLL BACK�[0m
2019/03/19 16:04:04 �[1;34m[D] ORM engine initialization attempt #3/10 failed. Error: migrate: do migrate: object does not exist [id: v1.4.5, rel_path: ]�[0m
2019/03/19 16:04:04 �[1;32m[I] Backing off for 3 seconds�[0m

I'm running Gitea on Kubernetes using a Statefulset and a ConfigMap with official Gitea images,
Here is my config, mounted as a ConfigMap to the Pod :

kind: ConfigMap
apiVersion: v1
metadata:
  name: gitea-config
  namespace: fleeters-hosting
data:
  app.ini: |-
    APP_NAME = Gitea: Git with a cup of tea
    RUN_MODE = prod

    [repository]
    ROOT = /data/git/repositories

    [repository.upload]
    TEMP_PATH = /data/gitea/uploads

    [server]
    APP_DATA_PATH = /data/gitea
    SSH_DOMAIN    = XXXXXXXXXXXXXXXX
    HTTP_PORT     = 3000
    ROOT_URL      = XXXXXXXXXXX
    DISABLE_SSH   = false
    SSH_PORT      = 22
    OFFLINE_MODE  = false
    LFS_CONTENT_PATH = /data/git/lfs

    [database]
    HOST     = mysql:3306
    PATH     = /data/gitea/gitea.db
    DB_TYPE  = sqlite3
    NAME     = gogs
    USER     = root
    PASSWD   =
    SSL_MODE = disable

    [indexer]
    ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

    [session]
    PROVIDER_CONFIG = /data/gitea/sessions
    PROVIDER        = file

    [picture]
    AVATAR_UPLOAD_PATH      = /data/gitea/avatars
    DISABLE_GRAVATAR        = false
    ENABLE_FEDERATED_AVATAR = true

    [attachment]
    PATH = /data/gitea/attachments

    [log]
    ROOT_PATH = /data/gitea/log
    MODE      = file,console
    LEVEL     = Debug

    [service]
    REGISTER_EMAIL_CONFIRM = false
    ENABLE_NOTIFY_MAIL     = true
    DISABLE_REGISTRATION   = true
    ENABLE_CAPTCHA         = false
    REQUIRE_SIGNIN_VIEW    = true

    [security]
    INSTALL_LOCK   = true
    SECRET_KEY     = XXXXXXXXXXXXXXXXX
    INTERNAL_TOKEN = XXXXXXXXXXXXXXXXXXXXXXXX

    [oauth2]
    JWT_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Do you have any solution or workaround ?

Thanks

@lunny
Copy link
Member

lunny commented Mar 20, 2019

That's because some of your repositories has unsynced tags on database and git data. The solution is to delete the records on the table release manually. And I think I will change the migrations to ignore the unsynced tags.

@jolheiser
Copy link
Member

Should this be closed per #6387?

@zeripath
Copy link
Contributor

Yes I think this is fixed.

@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
Projects
None yet
Development

No branches or pull requests

5 participants