You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Adjust app.ini to match the new 0.13.0 config.
Create a backup on machine one running 0.12.3 with ./gogs backup --exclude-repos
Move the backup to machine two running 0.13.0 and attempt a restore with ./gogs restore --from="backup.zip"
Shortly after the process starts, receive error Duplicate entry '' for key 'access_token.sha256'.
Expected behavior
Successful restore from one machine to the other.
Additional context
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
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 access_tokens.sha256 column:
NewMigration("migrate access tokens to store SHA56", migrateAccessTokenToSHA256),
There are two possible approaches:
Run the 0.13.0 version against the database on your old machine once, so it can complete the DB migration. Then backup again and restore.
Connect to the database on the new machine, and drop the unique constraint on the access_tokens.sha256 column, restore your backup, run 0.13.0 (which will add back the unique constraint as part of DB migration).
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?
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: