Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
proget 500 Internal server error when pushing to a proget docker feed
-
@atripp said in proget 500 Internal server error when pushing to a proget docker feed:
we can also try to add something that allows you to patch via the UI as well!!
Huh? Well, I don't think this would be such a good idea. I assume you guys already have some code in proget for upgrading your DB-Schema when a new version is required. That's where the function should be replaced. This script is only meant as a intermediate solution until you guys have updated the function.
Cheers
-Fritz -
Hi @felfert ,
As an update, we'd are planning on this pattern instead of row/table locking (PG-3104). It gives us a lot more control and makes it a lot easier to avoid deadlocks.
I still can't reproduce the issue, but I see no reason this won't work.
CREATE OR REPLACE FUNCTION "DockerBlobs_CreateOrUpdateBlob" ( "@Feed_Id" INT, "@Blob_Digest" VARCHAR(128), "@Blob_Size" BIGINT, "@MediaType_Name" VARCHAR(255) = NULL, "@Cached_Indicator" BOOLEAN = NULL, "@Download_Count" INT = NULL, "@DockerBlob_Id" INT = NULL ) RETURNS INT LANGUAGE plpgsql AS $$ BEGIN -- avoid race condition when two procs call at exact same time PERFORM PG_ADVISORY_XACT_LOCK(HASHTEXT(CONCAT_WS('DockerBlobs_CreateOrUpdateBlob', "@Feed_Id", LOWER("@Blob_Digest")))); SELECT "DockerBlob_Id" INTO "@DockerBlob_Id" FROM "DockerBlobs" WHERE ("Feed_Id" = "@Feed_Id" OR ("Feed_Id" IS NULL AND "@Feed_Id" IS NULL)) AND "Blob_Digest" = "@Blob_Digest"; WITH updated AS ( UPDATE "DockerBlobs" SET "Blob_Size" = "@Blob_Size", "MediaType_Name" = COALESCE("@MediaType_Name", "MediaType_Name"), "Cached_Indicator" = COALESCE("@Cached_Indicator", "Cached_Indicator") WHERE ("Feed_Id" = "@Feed_Id" OR ("Feed_Id" IS NULL AND "@Feed_Id" IS NULL)) AND "Blob_Digest" = "@Blob_Digest" RETURNING * ) INSERT INTO "DockerBlobs" ( "Feed_Id", "Blob_Digest", "Download_Count", "Blob_Size", "MediaType_Name", "Cached_Indicator" ) SELECT "@Feed_Id", "@Blob_Digest", COALESCE("@Download_Count", 0), "@Blob_Size", "@MediaType_Name", COALESCE("@Cached_Indicator", 'N') WHERE NOT EXISTS (SELECT * FROM updated) RETURNING "DockerBlob_Id" INTO "@DockerBlob_Id"; RETURN "@DockerBlob_Id"; END $$; -
@atripp I tested this one and it works.
However:
In the meantime, i have updated to the released 25.0.9 (aka latest) and now I cannot reproduce the error either - even if I explicitely revert the function to the old one where it produced the error before
So I'm afraid that i might not be a reliable tester for this specific error anymore.
Cheers
-Fritz -
I updated to 25.0.9 as well, and still have the issue.
-
@pariv_0352 the code is not fixed in 25.0.9
However,
inedo/proget:25.0.10-ci.5will have the new code that should prevent this error -
@atripp said in proget 500 Internal server error when pushing to a proget docker feed:
the code is not fixed in 25.0.9
Yes, I got it, just to clarify that I still have the error, so you can use me as tester )
Should I try
25.0.10-ci.5+or wait for release? -
Hi @pariv_0352,
Thanks! I'd try out
25.0.10-ci.10-- it should work in theory! And if not then we'll just need to fix it anyway :)Thanks,
Steve -
@stevedennis
I’ll try it as soon as it’s out :) -
I have installed 25.0.10 release. I can't reproduce the error anymore.
-
I upgraded to 25.0.11-ci12 and have the problem. Its even worst then before, the workaround doesn't work any time.
-
Hi @thomas_3037 ,
The specific issue was already fixed; I'm going to close it because whatever your experiencing is different and the "history" in this long winding thread will only make it harder to understand ,
Please "start from the scratch" as if you never read this.
Thanks,
Alana
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login