-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Container registry fails with duplicate key (HTTP 500) #21822
Comments
Should be a duplicate of #19586 The problem should be gone if you limit the upload with |
@KN4CK3R it can be the same ticket - not sure from reading it but it looks close - but please note that 1. |
It has nothing to do with the upload id. |
@KN4CK3R how can you get twice the same id when a single build pushes images sequentially? The only cause I found was that the entropy on the machine was way too low (almost 0) so the crypto generator was not that random. If it is another cause the error should probably guide to something more relevant since nothing is logged except the id is already taken. |
|
@KN4CK3R ok but since a container can be pushed N (>= 1) times with the same tag - and gitea code is compliant with that and it complies to my tests where often we can do it smoothly without any errors. So the error shouldn't occur right? So only option I saw from a code standpoint - for this issue maybe not the other one once again - is that the id generation is not random enough. Is it that hard to solve the issue? It is really bothering to have to run ~10 times the same CI job and get 9 failures due to it. I installed an entropy generator yesterday on the machine but not sure it will be sufficient. |
I know you don't want to hear that but it has nothing to do with the upload id. |
@KN4CK3R ok, have to admit I don't care much what is the solution but I need one - and concurrency control is not sufficient. |
Sure, we all want a solution and that's the attitude the open source community needs. If you can propose a solution we will happily implement it. |
@KN4CK3R have to admit if the issue is not the id I'm not sure which one it is so hard to help :s. |
I'm using jib (serialize=true to get a single thread) i observe the same behavior but the files are likely not the same (layers). Would using a monothreaded queue be an option in gitea if your analyzis right? can be easy to test |
I think this issue is related to #19586 and it's likely having been resolved. Feel free to reopen if there is still any problem. |
Description
Regularly on container updates (~10 apps by build) we get some HTTP 500 because a duplicate key is found:
The reason seems to be that the container id is generated using util.Crypto methods and the entropy in the gitea pod is not high enough to be really random.
Can be neat to use a more advanced algorithm mixing random, timestamp and thread to ensure the unicity, at least in a mono instance deployment.
Gitea Version
1.17
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Kubernetes
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: