go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.01k stars 5.31k forks source link

Error 1061 (42000): Duplicate key name issues when using MySQL Aria storage engine #31210

Open miqraeng opened 1 month ago

miqraeng commented 1 month ago

Description

When restoring the gitea database form a backup I got a lot of messages of type Error 1061 (42000): Duplicate key name ....

I got those same messages when doing an upgrade, and when restoring the original database. The command gitea doctor check-db-version gave these messages.

After some research I discovered that my MariaDB database engine was set to Aria Recreating the database with InnoDB restored proper functionality

Gitea Version

1.19.3 to 1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

2.30.2

Operating System

Debian GNU/Linux 11 (bullseye) AMD64

How are you running Gitea?

downloaded releases

Database

MySQL/MariaDB

lunny commented 1 month ago

I think Gitea now just supports innodb Engine. https://docs.gitea.com/help/faq#upgrade-errors-with-mysql

miqraeng commented 1 month ago

True, but it would be nice if the gitea doctor feature could identify the issue and possibly remedy it.