maven deploy:deploy-file fails (409 Conflict), yet artifact uploads successfully

前端 未结 9 1463
长情又很酷
长情又很酷 2020-12-13 12:38

NOTE:

I now realize that the jar got placed into my repository, but the pom.xml did not. Now, I have another project where the pom.xml fails to

9条回答
  •  -上瘾入骨i
    2020-12-13 13:26

    I have been experiencing the same problem. (TL;DR: solution see last line)

    During the deploy from jenkins to Artifactory, sometimes (magic!) a 409 - conflict error appeared with the following error message on the Artifactory log:

    [WARN ] (o.a.e.UploadServiceImpl:239) - Sending HTTP error code 409: Checksum policy 'LocalRepoChecksumPolicy: CLIENT' rejected the artifact 'gradle-integration:com.redacted.java/fooProject/123/foo-123.jar'. Checksums info: ChecksumsInfo{checksums={SHA-1=ChecksumInfo{type=SHA-1, original='da39a3ee5e6b4b0d3255bfef95601890afd80709', actual='1459689f0be058f4ecef7e6fe3576f1550a8afda'}, MD5=ChecksumInfo{type=MD5, original='d41d8cd98f00b204e9800998ecf8427e', actual='14c7a498de028d6eb5882b3c698bc456'}}}.

    As the trained eye might notice: The MD5# d41d8cd98f00b204e9800998ecf8427e is the checksum for an empty file or string.

    Which means that the following must be happening: The copy job that prepares the Artifacts in the publish folder had not finished and therefore the file was empty when the checksum was calculated.

    However when the deploy happened the file was there, Artifactory now receives a checksum which is incorrect and correctly refuses the file with the error code 409.

    THE SOLUTION (is simple): Make 100% sure the files are definitely there before you start the deploy job (add a pause or proper logic).

提交回复
热议问题