Failed to save configuration: Error 1062 (23000): Duplicate entry 'picture.disable_gravatar' for key 'UQE_system_setting_setting_key' #12095

Closed
opened 2025-11-02 09:58:01 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @blade1989 on GitHub (Nov 27, 2023).

Description

I updated my gitea, via docker. Gitea is installed using docker per the documentation: https://docs.gitea.com/installation/install-with-docker

after doing docker-compose up -d, I got the installer again. I pressed the Install Gitea button again, then I got the following message:

You are trying to install into an existing Gitea database
...
...
...

Re-installing with an existing Gitea database can cause multiple problems. In most cases, you should use your existing "app.ini" to run Gitea. If you know what you are doing, confirm the following:

[ ] The data encrypted by the SECRET_KEY in app.ini may be lost: users may not be able to log in with 2FA/OTP & mirrors may not function correctly. By checking this box you confirm that the current app.ini file contains the correct the SECRET_KEY.
[ ] The repositories and settings may need to be re-synchronized. By checking this box you confirm that you will resynchronize the hooks for the repositories and authorized_keys file manually. You confirm that you will ensure that repository and mirror settings are correct.
[ ] You confirm that you are absolutely sure that this Gitea is running with the correct app.ini location and that you are sure that you have to re-install. You confirm that you acknowledge the above risks.

I checked them all, and I then got:

Failed to save configuration: Error 1062 (23000): Duplicate entry 'picture.disable_gravatar' for key 'UQE_system_setting_setting_key'

The logs during installation time

gitea  | 2023/11/27 10:35:35 ...s/install/install.go:213:checkDatabase() [E] The database is likely to have been used by Gitea before, database migration version=280
gitea  | 2023/11/27 10:35:35 ...s/install/install.go:221:checkDatabase() [I] User confirmed re-installation of Gitea into a pre-existing database
gitea  | 2023/11/27 10:35:35 ...s/install/install.go:225:checkDatabase() [I] Gitea will be installed in a database with: hasPostInstallationUser=true, dbMigrationVersion=280

I am now stuck in the Gitea Installer.

Gitea Version

1.21.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

built in

Operating System

Ubuntu 22.04.3 LTS

How are you running Gitea?

Gitea is installed using docker per the documentation: https://docs.gitea.com/installation/install-with-docker

Database

MySQL/MariaDB

Originally created by @blade1989 on GitHub (Nov 27, 2023). ### Description I updated my gitea, via docker. Gitea is installed using docker per the documentation: https://docs.gitea.com/installation/install-with-docker after doing `docker-compose up -d`, I got the installer again. I pressed the `Install Gitea` button again, then I got the following message: > You are trying to install into an existing Gitea database > ... > ... > ... > Re-installing with an existing Gitea database can cause multiple problems. In most cases, you should use your existing "app.ini" to run Gitea. If you know what you are doing, confirm the following: > > [ ] The data encrypted by the SECRET_KEY in app.ini may be lost: users may not be able to log in with 2FA/OTP & mirrors may not function correctly. By checking this box you confirm that the current app.ini file contains the correct the SECRET_KEY. > [ ] The repositories and settings may need to be re-synchronized. By checking this box you confirm that you will resynchronize the hooks for the repositories and authorized_keys file manually. You confirm that you will ensure that repository and mirror settings are correct. > [ ] You confirm that you are absolutely sure that this Gitea is running with the correct app.ini location and that you are sure that you have to re-install. You confirm that you acknowledge the above risks. I checked them all, and I then got: > Failed to save configuration: Error 1062 (23000): Duplicate entry 'picture.disable_gravatar' for key 'UQE_system_setting_setting_key' The logs during installation time ```bash gitea | 2023/11/27 10:35:35 ...s/install/install.go:213:checkDatabase() [E] The database is likely to have been used by Gitea before, database migration version=280 gitea | 2023/11/27 10:35:35 ...s/install/install.go:221:checkDatabase() [I] User confirmed re-installation of Gitea into a pre-existing database gitea | 2023/11/27 10:35:35 ...s/install/install.go:225:checkDatabase() [I] Gitea will be installed in a database with: hasPostInstallationUser=true, dbMigrationVersion=280 ``` I am now stuck in the Gitea Installer. ### Gitea Version 1.21.1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version built in ### Operating System Ubuntu 22.04.3 LTS ### How are you running Gitea? Gitea is installed using docker per the documentation: https://docs.gitea.com/installation/install-with-docker ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 09:58:01 -06:00
Author
Owner

@lunny commented on GitHub (Nov 27, 2023):

It's dangerous to re-install in an exist database.

@lunny commented on GitHub (Nov 27, 2023): It's dangerous to re-install in an exist database.
Author
Owner

@blade1989 commented on GitHub (Nov 27, 2023):

@lunny I did not attempt a reinstall. I just did docker-compose up -d, which usually updates, with no problems... But this time, it thinks I am attempting a reinstall???

@blade1989 commented on GitHub (Nov 27, 2023): @lunny I did not attempt a reinstall. I just did `docker-compose up -d`, which usually updates, with no problems... But this time, it thinks I am attempting a reinstall???
Author
Owner

@blade1989 commented on GitHub (Nov 27, 2023):

@lunny I ran docker-compose pull;and docker-compose up -dand now it works again... I tried this several times before, but it didn't work then... 🤔

Now all I got is the following issue:
https://github.com/go-gitea/gitea/issues/27849#issue-1969392428

@blade1989 commented on GitHub (Nov 27, 2023): @lunny I ran `docker-compose pull;and docker-compose up -d`and now it works again... I tried this several times before, but it didn't work then... :thinking: Now all I got is the following issue: https://github.com/go-gitea/gitea/issues/27849#issue-1969392428
Author
Owner

@Chrisg2000 commented on GitHub (Nov 27, 2023):

I had the problem of landing on the "Gitea Install"-Page too, where it asked me to setup gitea again. I eventually figured out that the WorkPath, CustomPath and ConfigPath where wrong and were not point toward the volume under /data but rather to something like /var/lib/....

I corrected those paths via environment variables:

- GITEA_WORK_DIR=/data/gitea
- GITEA_CUSTOM=/data/gitea
- GITEA_APP_INI=/data/gitea/conf/app.ini

and now my instance is running fine again

@Chrisg2000 commented on GitHub (Nov 27, 2023): I had the problem of landing on the "Gitea Install"-Page too, where it asked me to setup gitea again. I eventually figured out that the `WorkPath`, `CustomPath` and `ConfigPath` where wrong and were not point toward the volume under `/data` but rather to something like `/var/lib/...`. I corrected those paths via environment variables: ``` - GITEA_WORK_DIR=/data/gitea - GITEA_CUSTOM=/data/gitea - GITEA_APP_INI=/data/gitea/conf/app.ini ``` and now my instance is running fine again
Author
Owner

@lunny commented on GitHub (Nov 28, 2023):

This has been fixed by #28243

@lunny commented on GitHub (Nov 28, 2023): This has been fixed by #28243
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12095