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!

Error promoting maven package



  • Hi,

    I'm getting the following error when I attempt to promote a maven package. Some package promotions seem to work but others don't. Can you recommend any steps to fix it please?

    90dd3393-00e6-46a3-a04d-2f8f7eb47baf-image.png

    An error occurred promoting the package: 2627141MavenArtifacts_CreateOrUpdateArtifact90`Violation of PRIMARY KEY constraint 'PK__MavenArtifactFiles'. Cannot insert duplicate key in object 'dbo.MavenArtifactFiles'. The duplicate key value is (1603, 4.5.2-1, .jar).



  • @forcenet_4316 sorry I forgot to mention. This is ProGet Basic Version 5.3.38 (Build 4) running on linux/docker.


  • inedo-engineer

    Hi @forcenet_4316

    While the message isn't great, it's saying that the artifact (antlr4-runtime.jar-v4.5.2-1) is already in the target feed.

    Can you confirm if that's the case? We should improve the message of course, but i want to check it

    Thanks,
    Alana



  • Here are steps to reproduce even when the artifact is provably not in the feed.

    1. In the approved feed I go to the package and delete it.
      43cc30ac-6181-424d-8f8e-611f07cbd967-image.png

    2. The response is "Unexpected Error" however if I search again for the package I can see that it has been deleted. (BTW: The error is " An error occurred in the web application: Object reference not set to an instance of an object." at Inedo.ProGet.Feeds.Maven.MavenFeed.Inedo.ProGet.Feeds.IBrowsablePackageFeed.ListPackageVersionsAsync(CommonPackageId id) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp_E146812\Src\ProGetCoreEx\Feeds\Maven\MavenFeed.cs:line 663 )
      1d71e332-a99d-453f-8069-f7b3ba7f3e53-image.png

    3. Then I go back to the unapproved feed and promote the package, the result is the same error message as in my original post, even though the artifact is clearly not in the approved feed because I deleted it.


  • inedo-engineer

    Hello; sorry on the slow response, but I'm still trying to reproduce this. I even downloaded antlr4-runtime and can't seem to do it.

    [1] Are you able to provide us a copy of the MavenArtifactFiles in your database? Basically just SELECT * FROM MavenArtifactFiles, and send results to support at inedo dot com, with [QA-674] in the subject? That will let us spot some things right away. I'm struggling with seeing how this error is even possible, given the way that stored procedure works.

    [2] What version of ProGet are you using? When did you start using this maven feed.

    [3] Have you used replication for the feed?

    Thanks,
    Alana


  • inedo-engineer

    @forcenet_4316 very sorry on the delayed response -- didn't notice that you had sent something to the box (it gets filled with spam very quickly) I've reopened this issue, and we will investigate ASAP


  • inedo-engineer

    @forcenet_4316 thanks to the data you sent, I was finally able to figure this out!

    The problem is with antlr4-runtime-4.5.2-1-sources.jar. When ProGet replicates or promotes this package (logic is the same), the artifact's fileType is assumed to be .jar instead of -sources.jar; this is what's causing the PK constraint. This seems to only impact a very small number of artifacts, since I think I mostly saw .sources.jar in other cases (which would work).

    I've fixed this via PG-2011, which is scheduled for 6.0.1 (shipping later this week).

    Are you planning to upgrade to v6 soon? If not, I should be able to backport the fix to v5.3.



  • Thanks @atripp. If proget v6 becomes the recommended stable version then we'll upgrade to it, otherwise we'll stay with whatever the current release version is.


  • inedo-engineer

    @forcenet_4316 great, sounds good! Actually we didn't end up shipping 6.0.0 yet (we will soon), so I just changed PG-2011 to target 5.3.40, which is scheduled for release on Friday. This way it will be in both.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation