Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26867

Artifacts With Date in Date Range ( /api/search/dates) REST API results in 404 status code when there is an empty response.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Deferred
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: REST API
    • Labels:
      None
    • Environment:

      Artifactory version: All 6.x and 7.x versions

      DB type & Version : Derby

      Is this an HA env? - No

      Is this On-Prem or SaaS? - On-prem & SaaS

    • Location:
      External

      Description

      Problem description: 

      When executing the Artifacts With Date in Date Range ( /api/search/dates) REST API and there are no artifacts which are matching the mentioned condition, currently, it results in a 404 response as below:

      curl –uadmin:password "http://localhost:8081/artifactory/api/search/dates?dateFields=lastModified&from=1646031543000&repos=maven-xray-test"
      {
        "errors" : [ {
          "status" : 404,
          "message" : "No results found."
        } ]
      }%

      Expected behavior:

      We should get a response a 200 status code as the response with an empty array as the results. 

      For example: 

      {
        "results" : [ ]
      }

      Steps to reproduce: 

      1 – Create a local repository and deploy a few artifacts on day one.

      2 – On day two, execute the same REST API by modifying the ‘from’ parameter with the current epoch time and the ‘repos’ parameter. It gives a 404 response with a "No results found” error message. 

      curl –uadmin:password "http://localhost:8081/artifactory/api/search/dates?dateFields=lastModified&from=1646031543000&repos=maven-xray-test"
      

      Possible workaround: No

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              vigneshc Vignesh C
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26877 -
                  SYNCHRONIZED
                  • Last Sync Date: