Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75579

Processes starting with JENKINS_HOME environment variable value of server not agent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • None
    • Windows 2019 Server

      We are in the process of migrating our Jenkins agents to new servers. In order to reduce path-too-long exceptions, we're using a different directory for the Jenkins home directory on the agents than on the server. The server uses D:\Jenkins_Home. The agents use D:\J . However, when Jenkins starts child build processes (specifically PowerShell), it sets the JENKINS_HOME environment variable to the path of the Jenkins home on the server/controller, not what's configured as the home directory on the node/agent configuration page.

      Steps to reproduce:

      1. Add a Jenkins node/agent to Jenkins. Set its home ("remote root directory") directory to be a different path than the server/controller's home directory.
      2. Run a build with a PowerShell step that just outputs the environment variables, e.g. dir env:.
      3. Note that the JENKINS_HOME environment variable is set to the controller's Jenkins home directory, not the one configured for the agent.

      I would expect that the JENKINS_HOME environment variable get set to the home directory for each agent.

            Unassigned Unassigned
            splatteredbits Aaron Jensen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: