EC-Git plugin fails with permission denied error on remote agents with noexec /tmp directory

Last Reviewed:2026-06-09()
2 minute readKnowledge base

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.

Environment

  • CloudBees CD/RO

  • EC-Git plugin

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.

Resolution

No permanent fix is available. See Workaround below.

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.

  1. Navigate to DevOps Essentials  Plugin Management  Plugin Configurations.

  2. Open your EC-Git plugin configuration.

  3. In the Library to use field, select JGit lib.

  4. 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:

  1. Navigate to the CloudBees CD/RO UI and go to the target agent resource.

  2. Create a custom property sheet named ec_environment_variables.

  3. Add a new property with the following values:

    • Property Name: JAVA_TOOL_OPTIONS

    • Value: -Djava.io.tmpdir=/path/to/executable/tmpdir

  4. 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.
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.