-
Notifications
You must be signed in to change notification settings - Fork 487
fingerprinted artifact from multiple builds causes exception #430
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Could you post here json from build 739 (http://jenkins.clearcare.it:8080/unit-test-worker/739/api) and http://jenkins.clearcare.it:8080/unit-test-worker/739/fingerprint/ I guess that the problem here because of this code: if not self._data["original"] is None:
if self._data["original"]["name"] == job:
if self._data["original"]["number"] == build:
return True It looks that Jenkins stores only one version of the artefact for the same md5 fingerprint and any artefacts generated by later builds will not be stored. So the file name of artefact will be nosetests_500.tar in all builds till fingerprint stays the same. I think that easiest way to solve this is to not put build number into artefact's name... |
Here is the json from unit-test-worker/739/api/json: {"actions":[{"parameters":[{"name":"GIT_HASH","value":"e6410e96be176bda6a012fd5cdab18b1771f9eec"},{"name":"UPSTREAM_BUILD_NUMBER","value":"114"},{"name":"TEST_LIST","value":"python manage.py test receivables.tests.view_tests,python manage.py test twilio_app,python manage.py test geocode,python manage.py test logit,python manage.py test accounting_exports.tests.helpers"}]},{"causes":[{"shortDescription":"Started by user sre","userId":"sre@clearcareonline.com","userName":"sre"}]},{},{"buildsByBranchName":{"detached":{"buildNumber":739,"buildResult":null,"marked":{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","branch":[{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","name":"detached"}]},"revision":{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","branch":[{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","name":"detached"}]}}},"lastBuiltRevision":{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","branch":[{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","name":"detached"}]},"remoteUrls":["git@github.com:clearcare/clearcare.git"],"scmName":""},{},{},{},{"parameters":[{"name":"DESCRIPTION_SETTER_DESCRIPTION","value":"From Driver: 114"}]},{},{},{}],"artifacts":[{"displayPath":"nosetests_739.tar","fileName":"nosetests_739.tar","relativePath":"nosetests_739.tar"},{"displayPath":"results_739.txt","fileName":"results_739.txt","relativePath":"results_739.txt"}],"building":false,"description":"From Driver: 114","displayName":"#739","duration":598461,"estimatedDuration":572127,"executor":null,"fullDisplayName":"unit-test-worker #739","id":"739","keepLog":false,"number":739,"queueId":29640,"result":"FAILURE","timestamp":1459465315675,"url":"http://jenkins.clearcare.it:8080/job/unit-test-worker/739/","builtOn":"eod-us-west-2_m3.large-172.31.3.106-29b0adb6","changeSet":{"items":[],"kind":"git"},"culprits":[]} And here is the FULL json from the unit-test-worker/739/api/xml?depth=2 {"actions":[{"parameters":[{"name":"GIT_HASH","value":"e6410e96be176bda6a012fd5cdab18b1771f9eec"},{"name":"UPSTREAM_BUILD_NUMBER","value":"114"},{"name":"TEST_LIST","value":"python manage.py test receivables.tests.view_tests,python manage.py test twilio_app,python manage.py test geocode,python manage.py test logit,python manage.py test accounting_exports.tests.helpers"}]},{"causes":[{"shortDescription":"Started by user sre","userId":"sre@clearcareonline.com","userName":"sre"}]},{},{"buildsByBranchName":{"detached":{"buildNumber":739,"buildResult":null,"marked":{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","branch":[{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","name":"detached"}]},"revision":{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","branch":[{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","name":"detached"}]}}},"lastBuiltRevision":{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","branch":[{"SHA1":"e6410e96be176bda6a012fd5cdab18b1771f9eec","name":"detached"}]},"remoteUrls":["git@github.com:clearcare/clearcare.git"],"scmName":""},{"tags":[]},{},{},{"parameters":[{"name":"DESCRIPTION_SETTER_DESCRIPTION","value":"From Driver: 114"}]},{},{},{}],"artifacts":[{"displayPath":"nosetests_739.tar","fileName":"nosetests_739.tar","relativePath":"nosetests_739.tar"},{"displayPath":"results_739.txt","fileName":"results_739.txt","relativePath":"results_739.txt"}],"building":false,"description":"From Driver: 114","displayName":"#739","duration":598461,"estimatedDuration":572127,"executor":null,"fullDisplayName":"unit-test-worker #739","id":"739","keepLog":false,"number":739,"queueId":29640,"result":"FAILURE","timestamp":1459465315675,"url":"http://jenkins.clearcare.it:8080/job/unit-test-worker/739/","builtOn":"eod-us-west-2_m3.large-172.31.3.106-29b0adb6","changeSet":{"items":[],"kind":"git"},"culprits":[],"fingerprint":[{"fileName":"nosetests_500.tar","hash":"1276481102f218c981e0324180bafd9f","original":{"name":"unit-test-worker","number":500},"timestamp":1459348516686,"usage":[{"name":"unit-test-worker","ranges":{"ranges":[{"end":501,"start":500},{"end":540,"start":506},{"end":599,"start":579},{"end":740,"start":739},{"end":752,"start":751},{"end":769,"start":768}]}}]},{"fileName":"results_739.txt","hash":"b22363c4cae1f2a88fb9ae24521cb2a5","original":{"name":"unit-test-worker","number":739},"timestamp":1459465913782,"usage":[{"name":"unit-test-worker","ranges":{"ranges":[{"end":740,"start":739}]}}]}]} Correct, by naming the artifacts the same the problem goes away, but it would be nice not to have this requirement. Hope this helps, and thanks for looking into this! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closed due to inactivity |
This is still a problem:
If Jenkins stores files by hash and the It seems that it would be better if
With this change the |
…an "fileName". Jenkins only stores one version of an artifact by its hash and by the original filename. Subsequent stores of an artifact with an identical hash but different filename will point to the original artifact. If a duplicate artifact (identical hash) has a different filename than the original filename then that new filename will be stored as a name in the build artifacts but will not change the fileName of the original artifact. This makes it problematic to compare against the original fileName when validating a build artifact that has been saved. Since the md5sum hash is computed for the local, saved artifact it can be compared against the Jenkins artifact ID (viz hash) for validation. This avoids the problem of identical artifacts having additional filenames. Using the hash is also a better way of validating data integrity rather than using the fileName even when the filename matches.
…fileName" Jenkins only stores one version of an artifact by its hash and by the original filename. Subsequent stores of an artifact with an identical hash but different filename will point to the original artifact. If a duplicate artifact (identical hash) has a different filename than the original filename then that new filename will be stored as a name in the build artifacts but will not change the fileName of the original artifact. This makes it problematic to compare against the original fileName when validating a build artifact that has been saved. Since the md5sum hash is computed for the local, saved artifact it can be compared against the Jenkins artifact ID (viz hash) for validation. This avoids the problem of identical artifacts having additional filenames. Using the hash is also a better way of validating data integrity rather than using the fileName even when the filename matches.
I have a build that saves an artifact. If I run that build multiple times, the artifact gets saved multiple times. The artifact is the same for all the builds (it has the same md5sum)
If I download the artifact from a build, I get an exception:
As you can see, this artifact comes from multiple builds (the above code is downloading from build 739, but notice build 500 is in this list too):

It fails because in fingerprint.py, in function validate_for_build, it thinks this artifact is coming from build 500, not build 739:
I think this function needs to optimized to look at ALL builds whose fingerprint matches the artifact.
The text was updated successfully, but these errors were encountered: