Skip to content

[Dependency-Track integration] JSON BOM upload fails with Dependency Track 4.2.2 #53

Open
@ghost

Description

Steps:

  1. Generate JSON BOM with cdxgen for node project
  2. Base64 encode that JSON BOM and added it into another JSON file that has the format required for upload to DT
  3. Upload to DT via the REST API
  4. Got an error while processing it in the DT api server
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
dtrack-apiserver_1  |  at [Source: (byte[])"{
dtrack-apiserver_1  |   "bomFormat": "CycloneDX",
dtrack-apiserver_1  |   "specVersion": "1.2",
dtrack-apiserver_1  |   "serialNumber": "urn:uuid:f70802e7-ceac-495f-b60a-650c52199f0b",
dtrack-apiserver_1  |   "version": 1,
dtrack-apiserver_1  |   "metadata": {
dtrack-apiserver_1  |     "timestamp": "2021-05-12T06:53:34.244Z",
dtrack-apiserver_1  |     "tools": [
dtrack-apiserver_1  |       {
dtrack-apiserver_1  |         "tool": {
dtrack-apiserver_1  |           "vendor": "AppThreat",
dtrack-apiserver_1  |           "name": "cdxgen",
dtrack-apiserver_1  |           "version": "2.3.1"
dtrack-apiserver_1  |         }
dtrack-apiserver_1  |       }
dtrack-apiserver_1  |     ],
dtrack-apiserver_1  |     "authors": [
dtrack-apiserver_1  |       {
dtrack-apiserver_1  |         "author": {
dtrack-apiserver_1  |           "name": {
dtrack-apiserver_1  |             "name": "Team AppThreat"
dtrack-apiserver_1  |           },
dtrack-apiserver_1  |           "email": "cloud@appth"[truncated 618575 bytes]; line: 20, column: 19] (through reference chain: org.cyclonedx.model.Bom["metadata"]->org.cyclonedx.model.Metadata["authors"]->java.util.ArrayList[0]->org.cyclonedx.model.OrganizationalContact["name"])

I suspect that the authors field is causing the error.

I've also tried uploading the raw JSON BOM via the web UI and encountered the same issue.

When I removed the authors field from the BOM, everything seems to be working fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions