Comments (3)
Thank you @sephiroth-j !
The file encoding of the bom.json was UTF-8. But the jenkins was the problem.
In our environment we have a jenkins master running on Linux and a jenkins slave running on windows 2019.
I added two user environment variables:
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
LANG = en_US.UTF-8
Source of this information was: https://www.linkedin.com/pulse/how-resolve-utf-8-encoding-issue-jenkins-ajuram-salim#:~:text=In%20normal%20cases%20Jenkins%20pass%20the%20characters%20in,4%20bytes%29%20which%20can%20encode%20all%20possible%20characters.
After that, the bom.json for angular is uploaded successfully. So the ticket can be closed / rejected.
I just wonder why I could upload a bom.json for nuget-packages in the same jenkinsfile and environment and with the bom.json for npm/angular it did not work.
Maybe that's a point for the documentation?
Thank you and sorry for opening the issue!
Stefan
from dependency-track-plugin.
Please check the encoding of the file and the encoding of the Jenkins machine where this actions runs on. The source of the MalformedInputException
is likely to be located in Jenkins core functionality.
/**
* Reads this file into a string, by using the current system encoding on the remote machine.
*/
public String readToString() throws IOException, InterruptedException {
return act(new ReadToString());
}
private static class ReadToString extends MasterToSlaveFileCallable<String> {
private static final long serialVersionUID = 1L;
@Override
public String invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
return Files.readString(fileToPath(f), Charset.defaultCharset());
}
}
Versions of Jenkins prior to 2.346 did not used the default charset (1, 2), they used Files.readAllBytes(Path)
. Now, Files.readString(Path, Charset)
is used and the only difference that matters is this call .
return JLA.newStringNoRepl(ba, cs);
from dependency-track-plugin.
The next major release will update the Jenkins baseline and incorporate the file reading changes introduced in Jenkins 2.346.
from dependency-track-plugin.
Related Issues (20)
- Dtrack-API with contextpath not accessible
- Implement Support for SBOM Quality Score Tool (sbomqs) HOT 2
- Using the dependency-track-plugin behind an (authenticating) proxy HOT 1
- Allow overrideGlobals to override Global timeout and interval settings.
- Explanation of upload error "Error was: Input length = 1 HOT 1
- I don't want to show Dependency-Track Project on Jenkins HOT 1
- HTTP 403 Forbidden, but curl works fine HOT 1
- Upload with Parent uuid does not work with 4.10.0 HOT 2
- Request Tier 2 Plugin for Dependency Track CloudBees HOT 1
- how to build the project HOT 1
- Update to Vue.js 3
- Fails if Dependencey Track API server returns Not Modified HOT 3
- sbom upload fails with "Input length = 1" after Jenkins upgrade HOT 1
- Set stage as unstable
- Is it possible to fail Jenkins on specific critical finding instead of Critical integer value. HOT 1
- Plugin throws exception when timeouts are 0 HOT 1
- Builds fail on return-code 304 - No Modification HOT 1
- upstream request timeout when uploading large sbom HOT 1
- Allow parentname and parentversion to be used during upload HOT 1
- Include artifact name in Publishing Logline
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dependency-track-plugin.