Updating Gitea from 1.22.6 to 1.23.7 fails for MSSQL (SQL Server) on Windows #14406

Closed
opened 2025-11-02 11:12:06 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @caerbannogwhite on GitHub (Apr 23, 2025).

Description

No response

Gitea Version

1.22.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2025/04/23 22:00:10 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: migrate: migration[299]: Add content version to issue and comment table failed: mssql: An explicit DROP INDEX is not allowed on index 'issue.issue$UQE_issue_repo_index'. It is being used for UNIQUE KEY constraint enforcement.

Screenshots

No response

Git Version

No response

Operating System

Windows x64

How are you running Gitea?

Self host

Database

MSSQL

Originally created by @caerbannogwhite on GitHub (Apr 23, 2025). ### Description _No response_ ### Gitea Version 1.22.6 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist 2025/04/23 22:00:10 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: migrate: migration[299]: Add content version to issue and comment table failed: mssql: An explicit DROP INDEX is not allowed on index 'issue.issue$UQE_issue_repo_index'. It is being used for UNIQUE KEY constraint enforcement. ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Windows x64 ### How are you running Gitea? Self host ### Database MSSQL
GiteaMirror added the type/bugissue/needs-feedback labels 2025-11-02 11:12:06 -06:00
Author
Owner

@techknowlogick commented on GitHub (Apr 23, 2025):

Which version of mssql are you using?

@techknowlogick commented on GitHub (Apr 23, 2025): Which version of mssql are you using?
Author
Owner

@techknowlogick commented on GitHub (Apr 24, 2025):

Also, did you mean 1.23.7? As updating minor versions don't usually have migrations

@techknowlogick commented on GitHub (Apr 24, 2025): Also, did you mean 1.23.7? As updating minor versions don't usually have migrations
Author
Owner

@caerbannogwhite commented on GitHub (Apr 24, 2025):

The database is currently stored with SQL Server 2019 (version 15.0.2130.3).
I already tried two or three times to upgrade from 1.22.6 to both 1.23.6 and 1.23.7, but the service doesn't start because of that error.

@caerbannogwhite commented on GitHub (Apr 24, 2025): The database is currently stored with SQL Server 2019 (version 15.0.2130.3). I already tried two or three times to upgrade from 1.22.6 to both 1.23.6 and 1.23.7, but the service doesn't start because of that error.
Author
Owner

@caerbannogwhite commented on GitHub (Apr 24, 2025):

Also, did you mean 1.23.7? As updating minor versions don't usually have migrations

Yes, apologies! I fixed the title.

@caerbannogwhite commented on GitHub (Apr 24, 2025): > Also, did you mean 1.23.7? As updating minor versions don't usually have migrations Yes, apologies! I fixed the title.
Author
Owner

@caerbannogwhite commented on GitHub (May 13, 2025):

I tried to update Gitea to 1.23.8, but it seems that the issue still persists

2025/05/13 21:28:04 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2025/05/13 21:28:04 cmd/web.go:205:serveInstalled() [I] PING DATABASE mssql
2025/05/13 21:28:04 ...dels/db/collation.go:185:preprocessDatabaseCollation() [W] Current database is using a case-insensitive collation "Latin1_General_CI_AS", although Gitea could work with it, there might be some rare cases which don't work as expected.
2025/05/13 21:28:04 routers/common/db.go:31:InitDBEngine() [W] Table version Column version db default is NULL, struct default is
2025/05/13 21:28:04 ...ations/migrations.go:494:Migrate() [I] Migration[302]: Add index to action_task stopped log_expired
2025/05/13 21:28:04 routers/common/db.go:46:migrateWithSetting() [W] Table action_task Column stopped db default is NULL, struct default is
2025/05/13 21:28:04 routers/common/db.go:46:migrateWithSetting() [W] Table action_task column log_expired db type is INT, struct type is BIT
2025/05/13 21:28:04 routers/common/db.go:46:migrateWithSetting() [W] Table action_task Column log_expired db default is NULL, struct default is
2025/05/13 21:28:04 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: migration[302]: Add index to action_task stopped log_expired failed: mssql: An explicit DROP INDEX is not allowed on index 'action_task.action_task$UQE_action_task_token_hash'. It is being used for UNIQUE KEY constraint enforcement.
2025/05/13 21:28:04 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
@caerbannogwhite commented on GitHub (May 13, 2025): I tried to update Gitea to 1.23.8, but it seems that the issue still persists ``` 2025/05/13 21:28:04 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #1/10... 2025/05/13 21:28:04 cmd/web.go:205:serveInstalled() [I] PING DATABASE mssql 2025/05/13 21:28:04 ...dels/db/collation.go:185:preprocessDatabaseCollation() [W] Current database is using a case-insensitive collation "Latin1_General_CI_AS", although Gitea could work with it, there might be some rare cases which don't work as expected. 2025/05/13 21:28:04 routers/common/db.go:31:InitDBEngine() [W] Table version Column version db default is NULL, struct default is 2025/05/13 21:28:04 ...ations/migrations.go:494:Migrate() [I] Migration[302]: Add index to action_task stopped log_expired 2025/05/13 21:28:04 routers/common/db.go:46:migrateWithSetting() [W] Table action_task Column stopped db default is NULL, struct default is 2025/05/13 21:28:04 routers/common/db.go:46:migrateWithSetting() [W] Table action_task column log_expired db type is INT, struct type is BIT 2025/05/13 21:28:04 routers/common/db.go:46:migrateWithSetting() [W] Table action_task Column log_expired db default is NULL, struct default is 2025/05/13 21:28:04 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: migration[302]: Add index to action_task stopped log_expired failed: mssql: An explicit DROP INDEX is not allowed on index 'action_task.action_task$UQE_action_task_token_hash'. It is being used for UNIQUE KEY constraint enforcement. 2025/05/13 21:28:04 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14406