Issue
When using the EC-Git plugin on a CloudBees CD/RO remote agent where the /tmp directory is mounted with the noexec flag or has restricted execution permissions, Git operations fail with a Permission denied error during code checkout.
The following error appears in the job logs:
Permission denied: /tmp
This prevents pipeline steps that involve Git operations from completing.
Explanation
When using Git CLI mode, the EC-Git plugin creates temporary scripts in the Java temporary directory, which defaults to /tmp on Linux/Unix systems (java.io.tmpdir). When /tmp is mounted with the noexec option, the operating system blocks execution of any files in that directory, causing the permission denied error.
Workaround
Two options are available depending on your environment.
Option 1: Switch to JGit
Configure the EC-Git plugin to use JGit instead of Git CLI. JGit is a pure Java implementation that does not create temporary scripts and is not affected by /tmp execution restrictions.
-
Navigate to .
-
Open your EC-Git plugin configuration.
-
In the Library to use field, select JGit lib.
-
Save the configuration.
| JGit may not support all advanced Git CLI features. Verify compatibility with your workflow requirements before switching. |
Option 2: Set a custom Java temporary directory
Configure a custom java.io.tmpdir pointing to a directory with execution permissions.
To set it via agent resource properties:
-
Navigate to the CloudBees CD/RO UI and go to the target agent resource.
-
Create a custom property sheet named
ec_environment_variables. -
Add a new property with the following values:
-
Property Name:
JAVA_TOOL_OPTIONS -
Value:
-Djava.io.tmpdir=/path/to/executable/tmpdir
-
-
Restart the agent to apply the changes.
Alternatively, add the following line to the agent’s wrapper.conf file and restart the agent:
set.JAVA_TOOL_OPTIONS=-Djava.io.tmpdir=/path/to/executable/tmpdir
Replace /path/to/executable/tmpdir with a directory on the agent that allows script execution and that the agent process has write access to.
|