You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When uploading a BOM via the v1/bom endpoint, the user is given a "#/definitions/BomUploadResponse" containing a token as response.
This token can then be used in order to query the current processing status via the v1/bom/token/{uuid} endpoint. It only gives a boolean result though - either the BOM is currently being processed - or it isn't.
When uploading a BOM, a lot of stuff can go wrong though - leading to either no project being created - or even incomplete projects within DependencyTrack without any feedback to the user about any of those error states. The only possibility to see that (and what) something went wrong is to look at the server logs - which aren't accessible to the user.
See issues for examples: #3371 #3324 #3274 #3081 #2821
... and more.
Proposed Behavior
The v1/bom/token/{uuid} endpoint shall include information about any errors encountered during the processing of a BOM. This includes stuff like "wrong format" - but also any exception that happened during processing.
Since the las commit there was a huge progress. So here is the
Current Behavior
Since #7127, GET /api/v1/bom/token/{uuid} and GET /api/v1/event/token/{uuid} return { processing, status } with PENDING / RUNNING / COMPLETED / FAILED. The frontend is starting to use this to show the processing state after an upload (DependencyTrack/frontend#FRONTEND_ISSUE). Three gaps remain that the frontend cannot fill on its own:
No phase. One token covers two runs: the BOM import, then the project analysis (vulnerability analysis, policy evaluation, metrics). The status reports only the most recently started one. So clients cannot tell "components are being imported" from "components are in, analysis is running". They also cannot tell "analysis is waiting for a slot" (PENDING again after the import finished, because of the per-project analysis concurrency limit) from "the upload has not started yet". And when processing fails, they cannot tell whether the import or the analysis failed, which needs a different reaction from the user.
Status only by token. The token exists only in the client that uploaded the BOM. Users who open a project while a CI pipeline, a colleague or another browser has an upload processing see nothing. Most large BOMs arrive that way.
1. Phase and failure reason on the token response. Extend the existing response with two optional fields, following the pattern of #7127 (dedicated enums, no workflow internals):
{
"processing": false,
"status": "FAILED",
"phase": "IMPORTING",
"failure": {
"reason": "BOM_INVALID",
"message": "Unexpected end of JSON input at line 48213"
}
}
phase: IMPORTING or ANALYZING, derived from which of the runs labelled with the token is current.
failure: a curated, user-facing reason and message, set where the BOM import and the analysis fail. Raw exception messages and stack traces would not be exposed. Reasons could be e.g. BOM_INVALID, BOM_PROCESSING or ANALYSIS. Examples of the message: "field publisher exceeds 255 characters" (BOM upload fails without feedback due to field max length #1665), or "unexpected end of JSON input".
2. Processing status per project (REST API v2). An endpoint such as GET /api/v2/projects/{uuid}/bom-processing would return the status, phase, failure, start time and origin of the project's latest BOM upload. The runs are already labelled with the project UUID. It would follow portfolio access control like the other project endpoints.
For (2), is a project-level endpoint the preferred shape, or should the status be part of the v2 project representation?
Finished workflow runs are deleted after 1 day (dt.dex-engine.maintenance.run-retention-ms), so a failure is only visible for that long. Is that acceptable for now, or should the outcome of the latest import be persisted on the project (as asked in Failed parsing of file should be flagged in the project #2890)? Persisting it would mean a schema change.
Should the curated failure message also be carried by the existing BOM_PROCESSING_FAILED notification?
I'm happy to contribute (1) and (2) based on the answers.
Activity
[-]Propper feedback on BOM upload[/-][+]Proper feedback on BOM upload[/+]nscuro commentedon Jan 15, 2024
Related:
savek-cc commentedon Jan 15, 2024
That looks a lot like what we're currently trying to integrate...
cmboling commentedon Jan 19, 2024
Looking forward to #3218 as this will help me understand formatting issues of SBOMs 🚀
savek-cc commentedon Jan 19, 2024
@cmboling for SBOM formatting issues maybe check/validate your SBOM using https://cyclonedx.github.io/cyclonedx-web-tool/
duderoot commentedon Nov 15, 2026
Since the las commit there was a huge progress. So here is the
Current Behavior
Since #7127,
GET /api/v1/bom/token/{uuid}andGET /api/v1/event/token/{uuid}return{ processing, status }withPENDING/RUNNING/COMPLETED/FAILED. The frontend is starting to use this to show the processing state after an upload (DependencyTrack/frontend#FRONTEND_ISSUE). Three gaps remain that the frontend cannot fill on its own:FAILEDstatus says nothing about why. Users who hit BOM upload fails without feedback due to field max length #1665 (field too long), BOM import fails silently when a purl contains non-ASCII characters (packageurl-java 1.5.0 corrupts percent-encoding, overflowing PURLCOORDINATES) #7314 (purl encoding) or a malformed file can only find the cause in the server log, which most of them cannot see.PENDINGagain after the import finished, because of the per-project analysis concurrency limit) from "the upload has not started yet". And when processing fails, they cannot tell whether the import or the analysis failed, which needs a different reaction from the user.Related: #1665, #3379, #2890, #5809, #7314.
Proposed Behavior
1. Phase and failure reason on the token response. Extend the existing response with two optional fields, following the pattern of #7127 (dedicated enums, no workflow internals):
{ "processing": false, "status": "FAILED", "phase": "IMPORTING", "failure": { "reason": "BOM_INVALID", "message": "Unexpected end of JSON input at line 48213" } }phase:IMPORTINGorANALYZING, derived from which of the runs labelled with the token is current.failure: a curated, user-facing reason and message, set where the BOM import and the analysis fail. Raw exception messages and stack traces would not be exposed. Reasons could be e.g.BOM_INVALID,BOM_PROCESSINGorANALYSIS. Examples of the message: "field publisher exceeds 255 characters" (BOM upload fails without feedback due to field max length #1665), or "unexpected end of JSON input".2. Processing status per project (REST API v2). An endpoint such as
GET /api/v2/projects/{uuid}/bom-processingwould return the status, phase, failure, start time and origin of the project's latest BOM upload. The runs are already labelled with the project UUID. It would follow portfolio access control like the other project endpoints.Questions
dt.dex-engine.maintenance.run-retention-ms), so a failure is only visible for that long. Is that acceptable for now, or should the outcome of the latest import be persisted on the project (as asked in Failed parsing of file should be flagged in the project #2890)? Persisting it would mean a schema change.BOM_PROCESSING_FAILEDnotification?I'm happy to contribute (1) and (2) based on the answers.