Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65296

Cannot (re)deploy artifact after upgrading plugin to 3.10.6: 404 error with JSON response "mandatory properties do not match"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None
    • Jenkins 2.286; Artifactory plugin 3.10.6

       After upgrading my Jenkins server from 2.284 to 2.286 and Artifactory plugin to 3.10.6 I now have a job that (re)deploys an artifact that is returning a 404 error. 

      Here's the (santizied) response we see in the build output:

       

      [consumer_0] Deploying artifact: https://artifactory.mysite.name/api-docs-local/myprod/0.1.2/swagger.json[consumer_0] Deploying artifact: https://artifactory.mysite.name/api-docs-local/myprod/0.1.2/swagger.jsonResponse received:  
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL /api-docs-local/myprod/0.1.2/swagger.json;vcs.revision=f1cae3b6cbd9c039d27846b5b83aa99d6e78f70b;build.timestamp=1617643825989;build.name=PR-delivery;build.number=5074;vcs.url=ssh://git@vcs.sitename/mysite/myprod was not found on this server.</p></body></html> Failed while reading the response from: 
      
      PUT https://artifactory.mysite.name/api-docs-local/myprod/0.1.2/swagger.json;vcs.revision=f1cae3b6cbd9c039d27846b5b83aa99d6e78f70b;build.timestamp=1617643825989;build.name=PR-delivery;build.number=5074;vcs.url=ssh%3A%2F%2Fgit%40vcs.sitename%2Fmysite%2Fmyprod HTTP/1.1
      
      Response received:  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL /api-docs-local/myprod/0.1.2/swagger.json;vcs.revision=f1cae3b6cbd9c039d27846b5b83aa99d6e78f70b;build.timestamp=1617643825989;build.name=PR-delivery;build.number=5074;vcs.url=ssh://git@vcs.sitename/mysite/myprod was not found on this server.</p></body></html> 
      
      Failed while reading the response from: PUT https://artifactory.mysite.name/api-docs-local/myprod/0.1.2/swagger.json;vcs.revision=f1cae3b6cbd9c039d27846b5b83aa99d6e78f70b;build.timestamp=1617643825989;build.name=PR-delivery;build.number=5074;vcs.url=ssh%3A%2F%2Fgit%40vcs.sitename%2Fmysite%2Fmyprod HTTP/1.1
      
      [consumer_0] An exception occurred during execution:java.lang.RuntimeException: java.io.IOException: Failed to deploy file. Status code: 404 at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44) at org.jfrog.build.extractor.producerConsumer.ConsumerRunnableBase.run(ConsumerRunnableBase.java:11) at java.lang.Thread.run(Thread.java:748)Caused by: java.io.IOException: Failed to deploy file. Status code: 404 at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:628) at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.doDeployArtifact(ArtifactoryBuildInfoClient.java:382) at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:370) at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:39) ... 2 more 
      
      ERROR: Failed uploading artifacts by spec
       
      

      There have been no changes on our Artifactory server and the start of the job failures matches up with when I upgraded Jenkins and the Artifactory plugin.

       

      Since the above didn't tell me much, I did a curl with the same URL and credentials as the above and got a little more helpful detail from the JSON response ("File 'api-docs-local:myprod/0.1.2/swagger.json' was found, but mandatory properties do not match." )

       

      curl -K ~/.curlrc -v 'https://artifactory.mysite.name/api-docs-local/myprod/0.1.2/swagger.json;vcs.revision=78b72869bc34a4e3225c6de863aee7763d9b724d;build.timestamp=1617725694420;build.name=PR-delivery;build.number=5081;vcs.url=ssh://git@vcs.sitename/mysite/myprod'
      
      
       Trying X.X.X.X:443..
      < HTTP/1.1 404 Not Found 
      < Date: Tue, 06 Apr 2021 18:34:04 GMT 
      < Server: Artifactory/6.18.1 
      < X-Artifactory-Id: <snip> 
      < Content-Type: application/json;charset=ISO-8859-1 
      < Access-Control-Allow-Origin: * 
      < Connection: close 
      < Transfer-Encoding: chunked 
      < { "errors" : [ { "status" : 404, "message" : "File 'api-docs-local:myprod/0.1.2/swagger.json' was found, but mandatory properties do not match." } ] 
      

      I'm not sure what properties it seems to be enforcing as mandatory.  Looking at https://www.jfrog.com/confluence/display/JFROG/Using+Properties+in+Deployment+and+Resolution#UsingPropertiesinDeploymentandResolution-Non-mandatoryProperties, it looks to me like "mandatory" parameters would have a {{+=}} in the URL, but I don't see any of those.

      Is it possible the plugin is now incorrectly treating non-mandatory properties as mandatory?

      Also for reference, here is the plugin "upload spec" for our Jenkins job

      {
       "files": [
         {
           "pattern": "docs/swagger.json",
           "target": "api-docs-local/myprod/${VERSION}/"
         }
        ]
       }

       

       

            eyalbe Eyal Ben Moshe
            smuskiew Steve Muskiewicz
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: