Uploaded image for project: 'Infrastructure'
  1. Infrastructure
  2. INFRA-1072

Artifactory returns HTTP 200 instead of HTTP 404 when requesting a missing resource

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: artifactory
    • Labels:
      None
    • Similar Issues:

      Description

      Current behavior:
      When trying to download a missing file, repo.jenkins-ci.org returns HTTP 200 and a JSON payload:

      {
        "errors" : [ {
          "status" : 404,
          "message" : "File not found."
        } ]
      }
      

      Expected behavior:
      When trying to download a missing file, the server should return HTTP 404:

      The 404 (Not Found) status code indicates that the origin server did
      not find a current representation for the target resource or is not
      willing to disclose that one exists.
      RFC7231, Section 6.5.4

      Steps to reproduce:

      1. curl -s -S https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.3/swarm-client-3.3-jar-with-dependencies.jar -o client.jar
      2. cat client.jar

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -
          $ curl -i https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.3/swarm-client-3.3-jar-with-dependencies.jar
          HTTP/1.1 404 Not Found
          Date: Fri, 17 Feb 2017 12:30:39 GMT
          Content-Type: application/json;charset=ISO-8859-1
          Transfer-Encoding: chunked
          Server: Artifactory/4.16.0
          X-Artifactory-Id: aoloss1b-jenkinsci
          X-Node: nginx-shared4c.gcoss-use1
          Via: 1.1 google
          Alt-Svc: clear
          
          {
            "errors" : [ {
              "status" : 404,
              "message" : "File not found."
            } ]
          }
          Show
          danielbeck Daniel Beck added a comment - $ curl -i https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.3/swarm-client-3.3-jar-with-dependencies.jar HTTP/1.1 404 Not Found Date: Fri, 17 Feb 2017 12:30:39 GMT Content-Type: application/json;charset=ISO-8859-1 Transfer-Encoding: chunked Server: Artifactory/4.16.0 X-Artifactory-Id: aoloss1b-jenkinsci X-Node: nginx-shared4c.gcoss-use1 Via: 1.1 google Alt-Svc: clear { "errors" : [ { "status" : 404, "message" : "File not found." } ] }
          Hide
          danielbeck Daniel Beck added a comment -

          Maybe try with -f next time.

          Show
          danielbeck Daniel Beck added a comment - Maybe try with -f next time.

            People

            • Assignee:
              danielbeck Daniel Beck
              Reporter:
              cryptidvulpes Jami Lindh
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: