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

ERROR 1061 (42000) at line 5: Duplicate key name 'IDX_oauth2_application_uid' #30399

Open
blade1989 opened this issue Apr 10, 2024 · 4 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@blade1989
Copy link

blade1989 commented Apr 10, 2024

Description

Trying to import a .sql file created with gitea dump.

Gitea Version

1.21.10

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Excerpt of the terminal:

mariadb -h {server} -u {DB_USER} -p{PASSWORD} {DB_NAME} </path/to/dump/gitea-db.sql
ERROR 1061 (42000) at line 5: Duplicate key name 'IDX_oauth2_application_uid'

Line 5:

CREATE INDEX `IDX_oauth2_application_uid` ON `oauth2_application` (`uid`);

When I grep for the key name, I can only find one;

grep 'IDX_oauth2_application_uid' /data/apps/gitea/dump/gitea-db.sql -n
5:CREATE INDEX `IDX_oauth2_application_uid` ON `oauth2_application` (`uid`);

Git Version

No response

Operating System

Ubuntu 22.04.3 LTS

How are you running Gitea?

Docker rootless

Database

MySQL/MariaDB

@lunny
Copy link
Member

lunny commented Apr 12, 2024

Maybe you old database have already this index? You should create a new blank database and import it but not override an old database.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Apr 12, 2024
@blade1989
Copy link
Author

It's a blank database. It was a migration test. new database server.

@lunny lunny removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label May 8, 2024
@yp05327
Copy link
Contributor

yp05327 commented May 9, 2024

I can not image this would happen in a newly created database, and the command was executed at the first time. 🤔

@yp05327
Copy link
Contributor

yp05327 commented Jun 4, 2024

Can you provide the version of your MariaDB?

And if it is possible, can you provide the details of how to reproduce this issue.
For example, how did you deploy your MariaDB and the version of it.
And line1~line5 in gitea-db.sql, of cause, you can mask your private information if you need.

@yp05327 yp05327 added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

No branches or pull requests

3 participants