I’m facing a MalformedInputException: Input length = 4
error after updating both my Jenkins controller and agent nodes to Java 21 on Windows. This only happens in production; our staging environment, running an identical pipeline, works fine with Java 21.
Current Setup:
- OS: Windows on both controller and agent nodes.
- Java Version: Recently updated to Java 21.
- Error:
MalformedInputException: Input length = 4
, triggered during a specific stage of the build. - Agent Version: Running the latest
agent.jar
.
Troubleshooting So Far:
- Ensured
agent.jar
on both nodes is using Java 21. - Followed https://support.snyk.io/hc/en-us/articles/9889983968925-Snyk-test-on-Jenkins-plugin-fails-with-MalformedInputException-Input-length-1-in-debug-log to set encoding, but no luck.
- Added
-Dfile.encoding=UTF-8
to the Jenkins global options, both on controller and agents. - Cleared Java cache on both nodes and restarted services.
Additional Questions:
- Are there any known compatibility issues with Java 21 and Jenkins on Windows?
- Could there be specific encoding configurations in
agent.jar
or Jenkins that need adjusting after the update?
Any advice would be greatly appreciated! Thank you in advance for your help.