-
Notifications
You must be signed in to change notification settings - Fork 487
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
Artifact save failing due to incorrect fingerprint #458
Comments
The python code snippet I used to download the artifact #Get Artifact and save to disk
artifacts = build.get_artifact_dict()
for name, artifact in artifacts.iteritems():
print "Saving: "+name+" to "+os.getcwd()+"/"+name
artifact.save_to_dir(os.getcwd()) |
I found possible culprit and fixed it in PR #480. |
Using SHA 1bfb4d2, I still get the following errors: Note: fingerprints are enabled. The MD5 in that URL is incorrect for the artifact I'm attempting to download. Also, getting this error: WARNING:jenkinsapi.artifact:Jenkins artifact could not be identified. In this case, the fingerprint is correct. When I download the file manually from Jenkins, and run md5sum on it, I get the same checksum value. |
@troyer777 which version of jenkinsapi you are using? Could you try this with current HEAD if this repo? |
I am using the HEAD revision (SHA 1bfb4d2) |
Picking a way at this a bit... This failure: This is happening when an older version of the artifact already exists in the path specified to save_to_dir(). This is a common use-case for me - my script gets the last good build of a particular matrix job, and downloads a subset of the build variants. After a day or two, I'll re-run the script to grab the latest artifacts. Our builds age out quickly, and I get the error above when I have an older artifact in my save-dir, but the build no longer exists on Jenkins. The simple work around for this is to delete any old artifacts in the save directory first. I guess one feature request would be to add a new parameter to save_to_dir() that makes it ignore any pre-existing file. |
So if I ensure there are no artifacts already downloaded, I get the next error condition: This seems to be something that happens with matrix builds. In _verify_download, job.name is the name of our overall matrix job ("[redacted]_Nightly_Build_FW_Matrix"). At this point, the desired artifact is downloaded, and the md5 checksum of the downloaded file matches the fingerprint. validate_for_build is called, and does an HTTP GET on /fingerprint/ef4fcafc0cb30cc5ada310c363e24a99/api/python. This returns a chunk of JSON. In this JSON, the fileName and hash are as expected. The "name" field in "original" is the particular sub-build of our matrix build. In my case, it looks something like "[redacted]_Nightly_Build_FW_Matrix/APP=myapp=1,BUILD=chip=12345 board=ASIC_SVB scan_plan=1,RTOS=rtos=1 red_zone=0,VERSION=Release,label=mylabel". There's also a "usage" array with 1 item. This item's "name" is also the particular sub-build name. I believe we are failing validation because these sub-build names do not match job.name (the overall build matrix job). |
I think I'm having a similar issue. When I run a job that runs a build for multiple artifacts, I get the broken artifact error trying to fetch the ones that weren't updated. |
This issue should be re-opened, since the PR was reverted in #518. |
I am getting below error jenkinsapi.custom_exceptions.ArtifactBroken: Artifact **** seems to be broken Could some help here, I have already raised a issue #856 |
I am trying to trigger a Jenkins build and then download the artifact generated to my system.
In my case the artifact gets downloaded but probably the verification gets failed and the following gets printed on the console.
ERROR:root:Failed request at http://jenkins:8080/fingerprint/95d55fcb03623e130e099edadca1fa93/api/python with params: None
On my Jenkins UI the fingerprint of the file is shown as
MD5: 1bccb64e60524d933fa2d3f3334ce738
I then tried the following:
curl http://jenkins:8080/fingerprint/1bccb64e60524d933fa2d3f3334ce738/api/python --user username:password
which gives me the required JSON response
while trying the below returns
curl http://jenkins:8080/fingerprint/95d55fcb03623e130e099edadca1fa93/api/python --user username:password
HTTP ERROR 404
Problem accessing /fingerprint/95d55fcb03623e130e099edadca1fa93/api/python. Reason:
Powered by Jetty://
It looks like the md5 computed by Jenkins and the md5 computed by jenkinsapi don't match.
My system information:
Mac OSX El Capitan 10.11.5
Python version 2.7
jenkinsapi (0.2.30)
Jenkins v1.639
The text was updated successfully, but these errors were encountered: