How to Resolve Common Jenkins Compatibility and Configuration Issues
This guide walks through fixing Performance plugin incompatibility, adjusting Jenkins CSP security, customizing access paths, handling git clone timeouts, fixing batch command failures, updating vulnerable jars, running JNLP files on Windows nodes, disabling CSRF, tuning JVM memory, and optimizing disk usage to keep Jenkins stable and efficient.
Performance Plugin Compatibility Issue
In freestyle projects using the Performance plugin to collect build artifacts, the latest versions (Jenkins v2.298, Performance v3.19) cause table and div misalignment on the configuration page, preventing saves. Three workarounds are:
Convert the freestyle project to a pipeline project.
Manually edit the project's config.xml on the server to enable saving.
Downgrade Jenkins; the plugin works on Jenkins v2.263.4 LTS after backing up and checking other plugin compatibilities.
Modifying Jenkins Security Policy (CSP)
When using the Robot Framework Plugin, previewing test reports fails with "Opening Robot Framework log failed" because Jenkins enforces a restrictive CSP that only allows CSS and images hosted on the server.
sandbox; default-src 'none'; img-src 'self'; style-src 'self';Solution using Startup Trigger and Groovy plugin:
Create a job that runs at Jenkins startup.
In "Build Triggers", select "Build when node starts" with no label and a quiet period of 0.
In the "Build" step, choose "Execute system Groovy" and run:
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "");Restart Jenkins; the Robot Framework report loads correctly.
Custom Jenkins Relative Access Path
When Jenkins is behind an Nginx proxy and needs a custom base path, modify jenkins.xml:
Locate jenkins.xml in the Jenkins installation root.
Add --prefix="/jenkins" to the arguments node.
Restart Jenkins; access via http://localhost:29908/jenkins.
Verify the proxy configuration.
If agents were already connected via JNLP, update the jenkins-slave.xml on the agent to correct the -jnlpUrl parameter.
git clone Failure: Killed by signal 15
The clone task is killed after exceeding the default 10‑minute timeout, causing the error shown in the screenshots.
Solution: increase the clone timeout in the job configuration to accommodate large repositories or slow networks.
Build Step 'Execute Windows Batch Command' Marked Build as Failure
Even when all test cases succeed, Jenkins may send a failure email due to the batch step exiting with a non‑zero code.
Fix: add exit 0 as the last line of the batch script (or equivalent in shell) to indicate successful completion.
Replacing Vulnerable JAR in Jenkins Running on Tomcat
The commons-fileupload-1.3.1-jenkins-2.jar bundled in jenkins.war has security issues. To replace it with version 1.4 without triggering scans, create a symbolic link.
Download commons-fileupload-1.4.jar.
Create a symlink (admin rights) pointing to the new JAR.
Delete the old JAR.
Restart Tomcat.
mklink webapps\jenkins\WEB-INF\lib\commons-fileupload-1.3.1-jenkins-2.jar webapps\jenkins\WEB-INF\lib\commons-fileupload-1.4.jarWindows Node Cannot Run JNLP File
If double‑clicking the .jnlp file on a Windows agent does nothing, run it from the command line: javaws slave-agent.jnlp The console will show the error; fixing Java security settings resolves the issue.
Disabling CSRF Protection
Older Jenkins versions allowed disabling CSRF via the UI, but newer versions require a startup parameter.
-Dhudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION=trueAdd this to the Tomcat startup script or the Jenkins JAR launch command.
Modifying JVM Memory Settings
Default JVM memory is insufficient, leading to OutOfMemoryError: PermGen space. Adjust JAVA_OPTS before launch:
set JAVA_OPTS=
-server
-Xms5000M
-Xmx5000M
-Xss512k
-XX:+AggressiveOpts
-XX:+UseBiasedLocking
-XX:PermSize=256M
-XX:MaxPermSize=512M
-XX:+DisableExplicitGC
-XX:MaxTenuringThreshold=31
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:LargePageSizeInBytes=128m
-XX:+UseFastAccessorMethods
-XX:+UseCMSInitiatingOccupancyOnly
-Djava.awt.headless=trueExplanation of key flags is provided in the original text.
Configuration Optimizations to Reduce Disk Usage
Discard Old Builds
Set a retention policy to keep builds for at most 2 days or the latest 30 builds, automatically cleaning older ones.
Disk Usage Plugin
Not recommended as it may cause server lag.
Scheduled Tomcat Log Cleanup
Create a Jenkins job that periodically deletes Tomcat log files to prevent disk exhaustion.
Setting Build Timeout
Configure a timeout for jobs that hang, preventing excessive memory consumption and potential Jenkins crashes.
Setting Global Properties
Define environment variables under "Manage Jenkins → Configure System → Global properties" to avoid hard‑coding values in pipelines.
Unified Script Management
Install the "Managed Script" plugin, add Groovy scripts under "Managed files", and reference them in jobs via "Execute managed script" for centralized maintenance.
Lightweight Backup
Use the "ThinBackup" plugin for full or incremental backups of Jenkins configuration without stopping the server; it excludes build history and artifacts for faster operation.
Architect's Must-Have
Professional architects sharing high‑quality architecture insights. Covers high‑availability, high‑performance, high‑stability designs, big data, machine learning, Java, system, distributed and AI architectures, plus internet‑driven architectural adjustments and large‑scale practice. Open to idea‑driven, sharing architects for exchange and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
