Skip to content

DT not handling a blank name in an SBOM #2821

Closed

Description

@nigellh

Current Behavior

In theory, this should never happen, but.....

Tooling that automatically processes open source packages will return the package name based on a variety of possible fields in package definition files. Some of these have been incorrectly filled out and have a blank name.

The tooling puts a blank name in the field of the SBOM such as

"name": "",

As the field is there, it does not fail on the validation of the SBOM schema as it is a required field for the component, technically it does not require content.

When this imports into DT it gives the following:

�[36mdtrack-apiserver_1  |�[0m 2023-06-14 13:09:21,258 WARN [Persist] Insert of object "org.dependencytrack.model.Component@430b2e5f" using statement "INSERT INTO COMPONENT (AUTHOR,BLAKE2B_256,BLAKE2B_384,BLAKE2B_512,BLAKE3,CLASSIFIER,COPYRIGHT,CPE,DESCRIPTION,DIRECT_DEPENDENCIES,EXTENSION,EXTERNAL_REFERENCES,FILENAME,"GROUP",INTERNAL,LAST_RISKSCORE,LICENSE,LICENSE_URL,MD5,"NAME",TEXT,PARENT_COMPONENT_ID,PROJECT_ID,PUBLISHER,PURL,PURLCOORDINATES,LICENSE_ID,SHA1,SHA_256,SHA_384,SHA3_256,SHA3_384,SHA3_512,SHA_512,SWIDTAGID,UUID,VERSION) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" failed : NULL not allowed for column "NAME"; SQL statement:
�[36mdtrack-apiserver_1  |�[0m INSERT INTO COMPONENT (AUTHOR,BLAKE2B_256,BLAKE2B_384,BLAKE2B_512,BLAKE3,CLASSIFIER,COPYRIGHT,CPE,DESCRIPTION,DIRECT_DEPENDENCIES,EXTENSION,EXTERNAL_REFERENCES,FILENAME,"GROUP",INTERNAL,LAST_RISKSCORE,LICENSE,LICENSE_URL,MD5,"NAME",TEXT,PARENT_COMPONENT_ID,PROJECT_ID,PUBLISHER,PURL,PURLCOORDINATES,LICENSE_ID,SHA1,SHA_256,SHA_384,SHA3_256,SHA3_384,SHA3_512,SHA_512,SWIDTAGID,UUID,VERSION) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23502-214]
�[36mdtrack-apiserver_1  |�[0m 2023-06-14 13:09:21,259 ERROR [BomUploadProcessingTask] Error while processing bom
�[36mdtrack-apiserver_1  |�[0m javax.jdo.JDODataStoreException: Insert of object "org.dependencytrack.model.Component@430b2e5f" using statement "INSERT INTO COMPONENT (AUTHOR,BLAKE2B_256,BLAKE2B_384,BLAKE2B_512,BLAKE3,CLASSIFIER,COPYRIGHT,CPE,DESCRIPTION,DIRECT_DEPENDENCIES,EXTENSION,EXTERNAL_REFERENCES,FILENAME,"GROUP",INTERNAL,LAST_RISKSCORE,LICENSE,LICENSE_URL,MD5,"NAME",TEXT,PARENT_COMPONENT_ID,PROJECT_ID,PUBLISHER,PURL,PURLCOORDINATES,LICENSE_ID,SHA1,SHA_256,SHA_384,SHA3_256,SHA3_384,SHA3_512,SHA_512,SWIDTAGID,UUID,VERSION) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" failed : NULL not allowed for column "NAME"; SQL statement:
�[36mdtrack-apiserver_1  |�[0m INSERT INTO COMPONENT (AUTHOR,BLAKE2B_256,BLAKE2B_384,BLAKE2B_512,BLAKE3,CLASSIFIER,COPYRIGHT,CPE,DESCRIPTION,DIRECT_DEPENDENCIES,EXTENSION,EXTERNAL_REFERENCES,FILENAME,"GROUP",INTERNAL,LAST_RISKSCORE,LICENSE,LICENSE_URL,MD5,"NAME",TEXT,PARENT_COMPONENT_ID,PROJECT_ID,PUBLISHER,PURL,PURLCOORDINATES,LICENSE_ID,SHA1,SHA_256,SHA_384,SHA3_256,SHA3_384,SHA3_512,SHA_512,SWIDTAGID,UUID,VERSION) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23502-214]
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.api.jdo.JDOAdapter.getJDOExceptionForNucleusException(JDOAdapter.java:605)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:702)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:722)
�[36mdtrack-apiserver_1  |�[0m 	at alpine.persistence.AbstractAlpineQueryManager.persist(AbstractAlpineQueryManager.java:427)
�[36mdtrack-apiserver_1  |�[0m 	at org.dependencytrack.persistence.ComponentQueryManager.createComponent(ComponentQueryManager.java:306)
�[36mdtrack-apiserver_1  |�[0m 	at org.dependencytrack.persistence.QueryManager.createComponent(QueryManager.java:515)
�[36mdtrack-apiserver_1  |�[0m 	at org.dependencytrack.tasks.BomUploadProcessingTask.processComponent(BomUploadProcessingTask.java:206)
�[36mdtrack-apiserver_1  |�[0m 	at org.dependencytrack.tasks.BomUploadProcessingTask.inform(BomUploadProcessingTask.java:141)
�[36mdtrack-apiserver_1  |�[0m 	at alpine.event.framework.BaseEventService.lambda$publish$0(BaseEventService.java:101)
�[36mdtrack-apiserver_1  |�[0m 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
�[36mdtrack-apiserver_1  |�[0m 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
�[36mdtrack-apiserver_1  |�[0m 	at java.base/java.lang.Thread.run(Unknown Source)
�[36mdtrack-apiserver_1  |�[0m Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "NAME"; SQL statement:
�[36mdtrack-apiserver_1  |�[0m INSERT INTO COMPONENT (AUTHOR,BLAKE2B_256,BLAKE2B_384,BLAKE2B_512,BLAKE3,CLASSIFIER,COPYRIGHT,CPE,DESCRIPTION,DIRECT_DEPENDENCIES,EXTENSION,EXTERNAL_REFERENCES,FILENAME,"GROUP",INTERNAL,LAST_RISKSCORE,LICENSE,LICENSE_URL,MD5,"NAME",TEXT,PARENT_COMPONENT_ID,PROJECT_ID,PUBLISHER,PURL,PURLCOORDINATES,LICENSE_ID,SHA1,SHA_256,SHA_384,SHA3_256,SHA3_384,SHA3_512,SHA_512,SWIDTAGID,UUID,VERSION) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23502-214]
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:508)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.message.DbException.get(DbException.java:223)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.message.DbException.get(DbException.java:199)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.table.Column.validateConvertUpdateSequence(Column.java:365)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.table.Table.convertInsertRow(Table.java:926)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.command.dml.Insert.insertRows(Insert.java:167)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.command.dml.Insert.update(Insert.java:135)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.command.CommandContainer.executeUpdateWithGeneratedKeys(CommandContainer.java:242)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.command.CommandContainer.update(CommandContainer.java:163)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.command.Command.executeUpdate(Command.java:252)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:209)
�[36mdtrack-apiserver_1  |�[0m 	at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:169)
�[36mdtrack-apiserver_1  |�[0m 	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
�[36mdtrack-apiserver_1  |�[0m 	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.store.rdbms.SQLController.executeStatementUpdate(SQLController.java:430)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.store.rdbms.request.InsertRequest.execute(InsertRequest.java:520)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObjectInTable(RDBMSPersistenceHandler.java:162)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:138)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:4587)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.state.StateManagerImpl.makePersistent(StateManagerImpl.java:4564)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.ExecutionContextImpl.persistObjectInternal(ExecutionContextImpl.java:2014)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.ExecutionContext.persistObjectInternal(ExecutionContext.java:320)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.ExecutionContextImpl.persistObjectWork(ExecutionContextImpl.java:1862)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.ExecutionContextImpl.persistObject(ExecutionContextImpl.java:1723)
�[36mdtrack-apiserver_1  |�[0m 	at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:697)
�[36mdtrack-apiserver_1  |�[0m 	... 10 common frames omitted
�[36mdtrack-apiserver_1  |�[0m 2023-06-14 13:09:21,268 WARN [General] ExecutionContext closed with active transaction, so rolling back the active transaction

At this point it stops importing any further entries and does not process any vulnerabilities in those that have been imported.

The only way to tell there is an error is to look in the logs, but if you only have access to the web interface all appears to have worked, just nothing is happening after it has failed.

In theory, you could skip this entry and let the rest continue and process properly, but wondering if the SBOM should just completely reject it with an error for them to fix.

Steps to Reproduce

1.Import an SBOM with a blank component (library) name

Expected Behavior

Not error in the way that it does

Dependency-Track Version

4.8.0

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

Whatever is in the container.

Browser

Mozilla Firefox

Checklist

Activity

  1. added
    defect
    on Jun 15, 2023
  2. Atharex commented on Aug 31, 2023

    @Atharex

    Seeing a similar behavior...

    It would be nice to skip the troublesome component, instead of breaking the import of a whole project

  3. aarz-snl commented on Sep 13, 2024

    @aarz-snl

    I have tried like 3 different sbom tools and none of them work uploading cyclonedx formats to dependency track -- there's no way they have this tool out there like it works... pretty bad

  4. nigellh commented on Sep 13, 2024

    @nigellh
    Author

    Hi @aarz-snl . If you have a valid SBOM, DT is exceptionally good. It really needs the correct to to generate them.

    You can validate the SBOM with https://github.com/CycloneDX/cyclonedx-cli to check it is valid

  5. added a commit that references this issue on Sep 13, 2024
    146b9e1
  6. added this to the 4.12 milestone on Sep 13, 2024
  7. added
    p2
    size/S
    on Sep 13, 2024
  8. nscuro commented on Sep 13, 2024

    @nscuro
    Member

    @nigellh We're going to assume the name - in DT now when we encounter an empty component name in a BOM. It's unfortunate but there seem to be a lot of BOM generators out there that produce component data with empty names, and due to an oversight in the CycloneDX schema, it can't be caught during schema validation.

  9. aarz-snl commented on Sep 16, 2024

    @aarz-snl

    Hi @aarz-snl . If you have a valid SBOM, DT is exceptionally good. It really needs the correct to to generate them.

    You can validate the SBOM with https://github.com/CycloneDX/cyclonedx-cli to check it is valid

    I'm using pretty widely used sbom generating tools ( syft, trivy ) is there a recommendation for one that works? I'm ensuring its cyclonedx and syft I even tried all of the versions they support. There's always some field that DT cannot handle. That would mean that these tools are NOT putting out valid sboms?

  10. nigellh commented on Sep 16, 2024

    @nigellh
    Author

    We have our own bespoke one as we have found some of the commercial ones not the best. If it passes validation it should be OK, just unfortunately, while it checks for a name field it does not check that there is anything in it

  11. github-actions commented on Oct 18, 2024

    @github-actions
    Contributor

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  12. locked as resolved and limited conversation to collaborators on Oct 18, 2024
  13. added a commit that references this issue on Jun 17, 2026
    b411ac4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectp2size/S

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions