Jenkins Pipeline DSL任务报错:何处设置Durable Task插件心跳参数?
Got it, let's walk through exactly where to set that JVM parameter to resolve the error you're hitting. The issue here is that your filesystem is laggy enough that the default heartbeat check interval for the Durable Task plugin is too short—setting 300 (5 minutes) gives it more breathing room. Here are the most common places to add this parameter, depending on how you run Jenkins:
1. Jenkins Master (Global JVM Settings)
This is the main place to set it if your Pipeline runs on the master, or if you want the parameter applied across all nodes by default:
- Running Jenkins via WAR file: Add the parameter directly to your startup command:
java -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=300 -jar jenkins.war - Running as a Linux systemd service:
- Open the Jenkins service file (usually at
/etc/systemd/system/jenkins.serviceor/lib/systemd/system/jenkins.service) with a text editor. - Find the line starting with
Environment="JAVA_OPTS=...and append the parameter to the existing options. For example:Environment="JAVA_OPTS=-Djava.awt.headless=true -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=300" - Reload the systemd daemon and restart Jenkins:
sudo systemctl daemon-reload sudo systemctl restart jenkins
- Open the Jenkins service file (usually at
- Running as a Windows service:
- Open the Services manager, find the Jenkins service, right-click and select Properties.
- Go to the Java tab, scroll to the bottom of the "Java Options" list, and add a new line:
-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=300 - Click Apply and restart the Jenkins service.
2. Jenkins Agent Nodes
If your Pipeline runs on dedicated agent nodes, you'll need to add the parameter to the agent's JVM startup arguments:
- For agents launched via Java Web Start: Include the parameter in the agent's startup command (similar to the WAR file method above).
- For agents running as system services: Modify the agent's service file
JAVA_OPTSjust like we did for the master, then restart the agent service.
3. Verify the Parameter is Applied
To make sure the setting took effect:
- Go to Manage Jenkins → System Information.
- Scroll down to the System Properties section.
- Search for
org.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL—you should see its value listed as300.
That should resolve the JENKINS-48300 error by giving the plugin more time to check in with slow filesystems.
内容的提问来源于stack exchange,提问作者user9711638

