Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31229

/rest/v1/assets REST API may not find assets when using Postgresql database

    Details

      Description

      Issue

      Search results using /rest/v1/assets REST API may not return the same results using PostgreSQL Database, as compared to using OrientDB database.

      Reproduce

      Using OrientDB:
      1. create a docker hosted repo
      2. deploy an image into it.
      3. perform a component search - example:

      curl -u admin:admin123 "http://localhost:9081/service/rest/v1/search?repository=docker-hosted-orientdb"
      {
        "items" : [ {
          "id" : "ZG9ja2VyLWhvc3RlZC1vcmllbnRkYjowYjY1MzJhYTY0Yzc2YjhjZjI0ZTgyM2FiNmZjNDQzNQ",
          "repository" : "docker-hosted-orientdb",
          "format" : "docker",
          "group" : null,
          "name" : "conda/miniconda3",
          "version" : "latest",
          "assets" : [ {
            "downloadUrl" : "http://localhost:9081/repository/docker-hosted-orientdb/v2/conda/miniconda3/manifests/latest",
            "path" : "v2/conda/miniconda3/manifests/latest",
            "id" : "ZG9ja2VyLWhvc3RlZC1vcmllbnRkYjo4YWRhNDNmY2EyMTlmNTNlYjZmOTYzYWMzYjdkYmQyZg",
            "repository" : "docker-hosted-orientdb",
            "format" : "docker",
            "checksum" : {
              "sha1" : "2211d2c92323849dc77354b6b1e4384a7db7df3d",
              "sha256" : "2141bfc4b60cc5eb332402207c80d884daa72fcefa48b50f3ccadd934d1f3d03"
            },
            "contentType" : "application/vnd.docker.distribution.manifest.v2+json",
            "lastModified" : "2022-02-15T15:42:27.361+00:00"
          } ],
          "tags" : [ ]
        } ],
        "continuationToken" : null
      }
      

      4. Now search for the asset - you get a result as expected:

       curl -u admin:admin123 "http://localhost:9081/service/rest/v1/assets/ZG9ja2VyLWhvc3RlZC1vcmllbnRkYjo4YWRhNDNmY2EyMTlmNTNlYjZmOTYzYWMzYjdkYmQyZg"
      {
        "downloadUrl" : "http://localhost:9081/repository/docker-hosted-orientdb/v2/conda/miniconda3/manifests/latest",
        "path" : "v2/conda/miniconda3/manifests/latest",
        "id" : "ZG9ja2VyLWhvc3RlZC1vcmllbnRkYjo4YWRhNDNmY2EyMTlmNTNlYjZmOTYzYWMzYjdkYmQyZg",
        "repository" : "docker-hosted-orientdb",
        "format" : "docker",
        "checksum" : {
          "sha1" : "2211d2c92323849dc77354b6b1e4384a7db7df3d",
          "sha256" : "2141bfc4b60cc5eb332402207c80d884daa72fcefa48b50f3ccadd934d1f3d03"
        },
        "contentType" : "application/vnd.docker.distribution.manifest.v2+json",
        "lastModified" : "2022-02-15T15:42:27.361+00:00",
        "blobCreated" : "2022-02-15T15:42:27.361+00:00",
        "lastDownloaded" : null
      }
      

      Problem: Now repeat the exact same steps using a PostgreSQL database. There will be no result for the /rest/v1/assets/ search by asset id.

      Expected

      PostgreSQL ( and H2) asset search results should be similar to OrientDB.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Matthew Piggott Matthew Piggott
            Team:
            NXRM - Sentinels
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title