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

REST API checksum search leads to a 400 response unless specifying the repository name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.21.0, 7.27.0
    • Fix Version/s: 7.33.6
    • Component/s: REST API
    • Labels:
      None
    • Location:
      External

      Description

      Description:

      When performing a checksum search using the REST API checksum search stating a sha256 value of a file, the response returns a 400 error saying:

      > curl -uadmin:password http://art.jfrog.farm:8082/artifactory/api/search/checksum\?sha256\=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\?repos\=test-debian-virtual {   "errors" : [ {     "status" : 400,     "message" : "Checksum contains invalid characters"   } ] }

       

      However, if adding the repository name as a query parameter, we get the desired result:

      > curl "http://art.jfrog.farm:8082/artifactory/api/search/checksum?sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855&repos=test-debian-local" 
      
      {   "results" : [ {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-amd64/by-hash/SHA256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-i386/Packages"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-amd64/by-hash/MD5Sum/d41d8cd98f00b204e9800998ecf8427e"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-i386/by-hash/SHA1/da39a3ee5e6b4b0d3255bfef95601890afd80709"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/com/res/binary-i386/by-hash/SHA1/da39a3ee5e6b4b0d3255bfef95601890afd80709"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/com/res/binary-i386/by-hash/MD5Sum/d41d8cd98f00b204e9800998ecf8427e"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/com/res/binary-i386/by-hash/SHA256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/com/res/binary-i386/Packages"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-i386/by-hash/SHA256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-amd64/Packages"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-amd64/by-hash/SHA1/da39a3ee5e6b4b0d3255bfef95601890afd80709"   }, {     "uri" : "http://art.jfrog.farm:8082/artifactory/api/storage/test-debian-local/dists/linux/test/binary-i386/by-hash/MD5Sum/d41d8cd98f00b204e9800998ecf8427e"   } ] }

       

      Afterward, this behavior will persist with every sha256 value (of files that are not empty, as well).

      Steps to reproduce:

      1. Create a Debian virtual repository that aggregates a Debian local repository
      2. Upload a Debian package to the local repository and verify that the index files are present in the virtual repo as well
      3. Delete the package from the local repository
      4. Search for a specific sha256 of an empty file or any other file
      5. You are expected to get this error unless stating a specific repository (either local or virtual)

      Customer impact:

      Customers are not able to search across all repositories and need to perform the search per repository. 

       

      This was reproduced on 7.27.6 as well. In this version, it was reproduced even without deleting the package first.

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              elinaf Elina Floim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

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