-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Cannot enable new repos after upgrading from v3.1.0 to v3.2.0. Duplicate entry for key 'UQE_orgs_name' #4918
Comments
Can confirm the same, with gitea on a remote server (latest version) and woodpecker 3.2.0 via helm. Here's a bit from the gitea log, 3.2.0 vs 3.1.0
|
Introduced in #4817 @qwerty287 @anbraten Do you have time to look into it? |
@greenaar @DHandspikerWade can you check your |
@xoxys As noted above, the gitea side shows a different access pattern on 3.2.0 vs 3.1.0, including a Downgraded, the exact same set of steps does neither of those, and does a get to hooks instead - i'm assuming if the first two gets in 3.2 had worked, they would've eventually ended on the same post. Here's the output from the SQL above:
|
Ok. So while i THOUGHT i was clicking different orgs.. I wasn't. Lots of repos in my personal org, and under 3.2, that fails. Orgs not associated with a user DO work. |
Yeah, this is the same issue Im seeing on my test instance. The forge_id of the user org is 0, while activating new repos in that org tries to add the org again with the correct ID. This is fixed in the linked PR, although the underlying issue is unclear (why are there entries in the orgs table with forge_id 0). @qwerty287 looks like this state in the DB isnt that weird 😆 |
OK, so the actual issue is that there are orgs with forge id 0. We just need a migration I think to update all forge id 0 => 1? |
Not sure if this is save. It would be better to lookup the forge_id from the forges table and update it properly. |
For now, that shouldn't be necessary because you can't have more than one forge currently if you haven't directly edited the DB. And if you did, you're responsible for the consequences of this. This is not supported by us I'd say. |
Agree but it also wouldnt too hard to lookup the Id from the forges table as well :) |
How would you do that? If there would be more than one forge, how do you want to know which is the right one? |
🤦♂️ yeah you are right, nevermind |
I'm seeing the same thing on my end as well
|
Manually applying the suggested migration on 3.2.0 seems to resolve the issue. Worth noting that I needed to delete and enable the repo I had tried to enable in 3.2.0 before rolling 3.1.0. I don't have an other examples, but I can roll back to a backup if needed, a migration may be needed to correct repos enabled during 3.2.0. |
Component
server
Describe the bug
After upgrading to 3.2.0, I am no longer able to enable new repos in the server dashboard. Attempting results in a error notification and the message "Error 1062 (23000): Duplicate entry 'devin' for key 'UQE_orgs_name'" being written to the server logs with "devin" being admin and only user. Also happens in the current
next
version.Rolling back to 3.1.0, repos can be enabled without issue.
Steps to reproduce
/repos
page.Expected behavior
I should be able to enable a repo without error.
System Info
Additional context
woodpeckerci/woodpecker-server:v3.2.0
andwoodpeckerci/woodpecker-server:next-1232ceb794
container images.Server debug log: server.debug.log
Kubernetes Manifest:
Validations
next
version already [https://woodpecker-ci.org/versions]The text was updated successfully, but these errors were encountered: