-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 1062 (23000): Duplicate entry '' for key 'access_token.sha256' #7697
Comments
Hey, I think it because the backed-up data did not get chance to run the require DB migration that makes sure every row has a non-empty value for the gogs/internal/database/migrations/migrations.go Lines 55 to 56 in dd49412
There are two possible approaches:
Be noted that approach 2 only solves this specific error you're getting blocked (which, maybe the only one after all, or you may also hit #7687). |
I'll see if I can go with the first option. It's a production machine, so I wanted to avoid dealing with the update on it, as we need to move to the new machine anyway. About #7687, since we use LDAP for logging in, with a few native Gogs accounts, does that mean I would have to go through every non-LDAP account, login without a password and set it up again? |
It's been a while, but thought I'd write an update. I ran upgrade to 0.13.0 on the prod machine, which has been working more or less fine. However after migrating to the new machine, I noticed there have been several database
Also happens for several users, even though they haven't reported having any issues with Gogs.
Moreover, I had to create dir A side note, unrelated to the errors: I had to manually dump the database from the old machine and import into SQL on the new machine, as Gogs' native database restore command would always hang without any error. |
Gogs version
0.13.0
Git version
Operating system
RedHat 9
Database
MySQL 8.0.36
Describe the bug
I'm in the process of migrating Gogs 0.12.3 (on CentOS7) to another machine to Gogs 0.13.0 (on RedHat 9). I backed up Gogs 0.12.3 with adjusted 0.13.0 app.ini, moved it to the new machine, but when trying to restore the backup, I'm met with this database error
Duplicate entry '' for key 'access_token.sha256'
. I checked the database on both sides, and I cannot find the duplicate anywhere. I tried to manually remove it from the table, but I'm met with the same error upon restoring. Both installations are on the same MySQL version.Might be worth mentioning that 0.12.3 on the first machine was installed from Packager.io, while the new 0.13.0 version on the other machine was installed from binary.
To reproduce
./gogs backup --exclude-repos
./gogs restore --from="backup.zip"
Duplicate entry '' for key 'access_token.sha256'
.Expected behavior
Successful restore from one machine to the other.
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: