[JIRA] (JENKINS-48038) "Could not find the history docker layer" when publishing build Info to artifactory

4 views
Skip to first unread message

alastair@alastairs-place.net (JIRA)

unread,
Nov 26, 2019, 9:46:03 AM11/26/19
to jenkinsc...@googlegroups.com
Alastair Houghton updated an issue
 
Jenkins / Bug JENKINS-48038
"Could not find the history docker layer" when publishing build Info to artifactory
Change By: Alastair Houghton
Priority: Minor Major
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

alastair@alastairs-place.net (JIRA)

unread,
Nov 26, 2019, 9:46:03 AM11/26/19
to jenkinsc...@googlegroups.com
Alastair Houghton commented on Bug JENKINS-48038
 
Re: "Could not find the history docker layer" when publishing build Info to artifactory

This problem still exists; we're using Artifactory 6.9.1, and I'm seeing similar behaviour. Interestingly it doesn't always fail in this particular manner; sometimes I'm told that Jenkins was unable to find the manifest.json file instead. I think the problem is actually a race condition between the Jenkins plugin and Artifactory itself; I think what's happening is that the Jenkins plugin uploads the Docker image to Artifactory, and then immediately tries to find the history layer in the image. If the Artifactory installation is fast enough, that's fine, but if the Jenkins plugin catches Artifactory just at the wrong moment (I assume while it's moving from _uploads to the final destination, or something of that nature), it can't find one or more of the files and so you get these error messages.

Although this is listed as a "minor" problem, it's actually a pretty major bug in the Artifactory plug-in, because it makes doing

def server = Artifactory.server 'myServer'
def rtDocker = Artifactory.docker server:server

def buildInfo = rtDocker.push("myImage:some-tag", "docker/myImage")

server.publishBuildInfo buildInfo

fail, either on the push step, or alternatively (if it fails to find the manifest, as opposed to the history layer) it will succeed but the build will show a single empty module with no artifacts, even though you can see that the Docker image has been uploaded successfully.

alastair@alastairs-place.net (JIRA)

unread,
Nov 26, 2019, 9:55:04 AM11/26/19
to jenkinsc...@googlegroups.com
Alastair Houghton edited a comment on Bug JENKINS-48038
This problem still exists; we're using Artifactory 6.9.1, and I'm seeing similar behaviour. Interestingly it doesn't _always_ fail in this particular manner; sometimes I'm told that Jenkins was unable to find the manifest.json file instead. I _think_ the problem is actually a race condition between the Jenkins plugin and Artifactory itself; I think what's happening is that the Jenkins plugin uploads the Docker image to Artifactory, and then immediately tries to find the history layer in the image. If the Artifactory installation is fast enough, that's fine, but if the Jenkins plugin catches Artifactory just at the wrong moment (I assume while it's moving from _uploads to the final destination, or something of that nature), it can't find one or more of the files and so you get these error messages.


Although this is listed as a "minor" problem, it's actually a pretty major bug in the Artifactory plug-in, because it makes doing

{code :groovy }

def server = Artifactory.server 'myServer'
def rtDocker = Artifactory.docker server:server

def buildInfo = rtDocker.push("myImage:some-tag", "docker/myImage")

server.publishBuildInfo buildInfo
{code}

fail, either on the {{push}} step, or alternatively (if it fails to find the manifest, as opposed to the history layer) it will succeed but the build will show a single empty module with no artifacts, even though you can see that the Docker image has been uploaded successfully.


(It might be worth adding that the images I'm using here are very large. That might well increase the window during which this can happen.)
Reply all
Reply to author
Forward
0 new messages