DependencyTrack / hyades

Incubating project for decoupling responsibilities from Dependency-Track's monolithic API server into separate, scalable services.
https://dependencytrack.github.io/hyades/latest
Apache License 2.0
58 stars 18 forks source link

Only one component shown plus error on console when reading components from db #1536

Open san-zrl opened 13 hours ago

san-zrl commented 13 hours ago

Current Behavior

When loading the hyades SBOM (downloaded from api server's landing page) 237 components were read but only one is shown in UI.

image

In addition some warning messages and an error pop up on the console that point to table column type inconsistencies for AUTHORS.

2024-09-26 11:43:00,415 WARN [Persistence] Request to convert value of type java.lang.String to type java.util.List but this is not yet supported. Raise an issue and contribute the code to support this conversion, with a testcase that demonstrates the problem [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,415 WARN [Retrieve] Unable to convert query value of type java.lang.String to field of type java.util.List [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,416 WARN [Persistence] Request to convert value of type java.lang.String to type java.util.List but this is not yet supported. Raise an issue and contribute the code to support this conversion, with a testcase that demonstrates the problem [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,416 WARN [Retrieve] Unable to convert query value of type java.lang.String to field of type java.util.List [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,416 WARN [Persistence] Request to convert value of type java.lang.String to type java.util.List but this is not yet supported. Raise an issue and contribute the code to support this conversion, with a testcase that demonstrates the problem [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,416 WARN [Retrieve] Unable to convert query value of type java.lang.String to field of type java.util.List [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,416 ERROR [Query] Query needs to return objects of type "org.dependencytrack.model.sqlmapping.ComponentProjection" but it was impossible to set the field "authors" type "java.lang.String". The field should have either a public set/put method, or be public. [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]
2024-09-26 11:43:00,416 WARN [Query] Exception thrown while loading remaining rows of query : Query needs to return objects of type "org.dependencytrack.model.sqlmapping.ComponentProjection" but it was impossible to set the field "authors" type "java.lang.String". The field should have either a public set/put method, or be public. [requestId=96f694d4-8848-4b5f-9a01-d1c7c3514f75]

My guess is that the problem is related to a recent change that added changeSet v5.6.0-3 to src/main/resources/migration/changelog-v5.6.0.xml

Steps to Reproduce

  1. Clone main branch of hyades API server and let it run again basic hyades environment (redpanda+postgres)
  2. Download DT SBOM from apiserver's homepage
  3. UpLoad DT SBOM into DT
  4. Click refresh button

Expected Behavior

237 components should be shown and no warning should come up.

Hyades Version

https://github.com/DependencyTrack/hyades-apiserver/tree/main

Repository Type

Hyades apiserver

Browser

Google Chrome

Checklist

nscuro commented 12 hours ago

Thanks for reporting!

My guess is that the problem is related to a recent change that added changeSet v5.6.0-3 to src/main/resources/migration/changelog-v5.6.0.xml

You are right, the mapping logic being used for the component endpoint doesn't adequately deal with that change. Will fix ASAP.