DependencyTrack / DependencyTrack/dependency-track

Error was: Input length = 1 while publishing bom.xml in Jenkins pipeline for node.js applications

Open
#2,202 17 comments 0 reactions 0 assignees View on GitHub
defect in triage
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior

After an upgrade from 4.5.0 to 4.6.2 all Jenkins nodejs pipelines started to fail with the same error code.
Error was: Input length = 1
```
[Pipeline] sh
+ case $- in
+ return
+ npx @cyclonedx/bom@3.10.6 --include-dev -o bom.xml
npx: installed 76 in 9.844s
[Pipeline] dependencyTrackPublisher
[DependencyTrack] Publishing artifact to Dependency-Track
[DependencyTrack] An error occurred processing artifact "/home/jenkins/workspace/i-project_minimal-project_master/bom.xml". Error was: Input length = 1
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Uploading artifact failed
[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
Finished: FAILURE
```
So far my troubleshooting included:
1. Downgrading OWASP Dependency Track Jenkins plugin from 4.2.0 to 4.0.0 since it was upgraded in the same time as pipelines started to fail.
2. Checked project files for UTF-8 Encoding
3. Changed `npx @cyclonedx/cyclonedx-npm` to npx `@cyclonedx/bom@3.10.6 `

### Steps to Reproduce

1. Upgrade Dependency Track from 4.5.0 to 4.6.2
2. Upgrade OWASP Dependency Track Plugin from 4.0.0 to 4.2.0
3. Nothing else, nodejs pipelines just breaks on publishing to D-Track from now.

### Expected Behavior

Publish bom.xml to Dependency Track

### Dependency-Track Version

4.6.2

### Dependency-Track Distribution

Container Image

### Database Server

PostgreSQL

### Database Server Version

_No response_

### Browser

Mozilla Firefox

### Checklist

- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.