Possible SQLite Hang Post-Upgrade #2689

Closed
opened 2025-11-02 04:44:34 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @nephatrine on GitHub (Dec 25, 2018).

  • Gitea version: 4586ae3
  • Git version: 2.20.1-r0
  • Operating system: Alpine Linux
  • 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:
2018/12/25 09:26:07 [I] Deleting incorrect topics...
2018/12/25 09:26:07 [I] Deleting 'repo_topic' rows for topics with ids = []
2018/12/25 09:26:07 [I] Deleting topics with id = []
2018/12/25 09:26:07 [I] Checking the number of topics in the repositories...
2018/12/25 09:26:07 [I] Deleting superfluous topics for repositories (more than 25 topics)...
2018/12/25 09:26:07 [I] Updating repositories 'topics' fields...
2018/12/25 09:26:07 [I] Migration: move team units to team_unit table
2018/12/25 09:26:07 [W] Unable to drop columns in SQLite
2018/12/25 09:26:07 [I] Migration: add issue_dependencies
2018/12/25 09:26:07 [I] Migration: protect each scratch token
2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [team_unit]
2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [team_unit]
2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [issue_dependency]
2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [issue_dependency]
2018/12/25 09:26:07 [I] [SQL] ALTER TABLE `two_factor` ADD `scratch_salt` TEXT NULL ;
2018/12/25 09:26:07 [I] [SQL] ALTER TABLE `two_factor` ADD `scratch_hash` TEXT NULL ;
2018/12/25 09:26:07 [I] [SQL] BEGIN TRANSACTION
2018/12/25 09:26:07 [I] [SQL] SELECT `id`, `uid`, `secret`, `scratch_token`, `scratch_salt`, `scratch_hash`, `last_used_passcode`, `created_unix`, `updated_unix` FROM `two_factor` LIMIT 100
2018/12/25 09:26:07 [I] [SQL] UPDATE `two_factor` SET `scratch_salt` = ?, `scratch_hash` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"I3M9mYVz2S", "429119af38a2e125513d2c0d44b09bd72715afc308d03a27f6b55d48e22a6d65de4c5d2a1ab6e63a00a5f789091aba4ac230", 1545747967, 1}
2018/12/25 09:26:07 [I] [SQL] SELECT `id`, `uid`, `secret`, `scratch_token`, `scratch_salt`, `scratch_hash`, `last_used_passcode`, `created_unix`, `updated_unix` FROM `two_factor` LIMIT 100 OFFSET 100

Description

Updated gitea binary. I don't recall what the previous commit ref was but it was probably from June. I can dig through my backups to get that if needed though. Seems to hang during startup while protecting scratch tokens during db migration. There's only one registered user on this instance and only 3-4 repos so I wouldn't expect migrating the db to take long. Have left it for hours without any change in status or feedback on what it is currently doing/what the progress (if any) is.

Originally created by @nephatrine on GitHub (Dec 25, 2018). - Gitea version: 4586ae3 - Git version: 2.20.1-r0 - Operating system: Alpine Linux - 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: ``` 2018/12/25 09:26:07 [I] Deleting incorrect topics... 2018/12/25 09:26:07 [I] Deleting 'repo_topic' rows for topics with ids = [] 2018/12/25 09:26:07 [I] Deleting topics with id = [] 2018/12/25 09:26:07 [I] Checking the number of topics in the repositories... 2018/12/25 09:26:07 [I] Deleting superfluous topics for repositories (more than 25 topics)... 2018/12/25 09:26:07 [I] Updating repositories 'topics' fields... 2018/12/25 09:26:07 [I] Migration: move team units to team_unit table 2018/12/25 09:26:07 [W] Unable to drop columns in SQLite 2018/12/25 09:26:07 [I] Migration: add issue_dependencies 2018/12/25 09:26:07 [I] Migration: protect each scratch token ``` ``` 2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [team_unit] 2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [team_unit] 2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [issue_dependency] 2018/12/25 09:26:07 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [issue_dependency] 2018/12/25 09:26:07 [I] [SQL] ALTER TABLE `two_factor` ADD `scratch_salt` TEXT NULL ; 2018/12/25 09:26:07 [I] [SQL] ALTER TABLE `two_factor` ADD `scratch_hash` TEXT NULL ; 2018/12/25 09:26:07 [I] [SQL] BEGIN TRANSACTION 2018/12/25 09:26:07 [I] [SQL] SELECT `id`, `uid`, `secret`, `scratch_token`, `scratch_salt`, `scratch_hash`, `last_used_passcode`, `created_unix`, `updated_unix` FROM `two_factor` LIMIT 100 2018/12/25 09:26:07 [I] [SQL] UPDATE `two_factor` SET `scratch_salt` = ?, `scratch_hash` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"I3M9mYVz2S", "429119af38a2e125513d2c0d44b09bd72715afc308d03a27f6b55d48e22a6d65de4c5d2a1ab6e63a00a5f789091aba4ac230", 1545747967, 1} 2018/12/25 09:26:07 [I] [SQL] SELECT `id`, `uid`, `secret`, `scratch_token`, `scratch_salt`, `scratch_hash`, `last_used_passcode`, `created_unix`, `updated_unix` FROM `two_factor` LIMIT 100 OFFSET 100 ``` ## Description Updated gitea binary. I don't recall what the previous commit ref was but it was probably from June. I can dig through my backups to get that if needed though. Seems to hang during startup while protecting scratch tokens during db migration. There's only one registered user on this instance and only 3-4 repos so I wouldn't expect migrating the db to take long. Have left it for hours without any change in status or feedback on what it is currently doing/what the progress (if any) is.
Author
Owner

@typeless commented on GitHub (Dec 25, 2018):

If you can build from source, you may try to replace the x with sess in the following line
https://github.com/go-gitea/gitea/blob/master/models/migrations/v71.go#L47

Of course, you better back up your data before experimenting.

@typeless commented on GitHub (Dec 25, 2018): If you can build from source, you may try to replace the `x` with `sess` in the following line https://github.com/go-gitea/gitea/blob/master/models/migrations/v71.go#L47 Of course, you better back up your data before experimenting.
Author
Owner

@nephatrine commented on GitHub (Dec 26, 2018):

That worked! Thanks.

@nephatrine commented on GitHub (Dec 26, 2018): That worked! Thanks.
Author
Owner

@typeless commented on GitHub (Dec 27, 2018):

@nephatrine send a pull request?

@typeless commented on GitHub (Dec 27, 2018): @nephatrine send a pull request?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2689