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

Jenkins JNLP agents should not connect/schedule builds if the workspace cannot be created or not writable

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core, remoting
    • None

    Description

      It's a pretty old behavior, but I think it makes sense to fix it at some point:
      1) Setup the non-existent folder as a workspace for JNLP slaves
      2) Start slave from the user who has no permissions to create folders in the path
      3) Start JNLP slave

      Expected result:
      1) Slave startup fails (like in SSH slaves)

      Actual result:
      1) Slave starts
      2) Slaves accepts the builds
      3) The builds fail

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            JENKINS-39370 should address it out-of-the box

            There is no "workspace" concept in the remoting library itself, and this change should solve it

            oleg_nenashev Oleg Nenashev added a comment - JENKINS-39370 should address it out-of-the box There is no "workspace" concept in the remoting library itself, and this change should solve it
            recampbell Ryan Campbell added a comment -

            Oleg, you've marked this as In Review, but none of the issues link to any PR.

            recampbell Ryan Campbell added a comment - Oleg, you've marked this as In Review, but none of the issues link to any PR.

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            README.md
            docs/logging.md
            docs/workDir.md
            src/main/java/hudson/remoting/Engine.java
            src/main/java/hudson/remoting/FileSystemJarCache.java
            src/main/java/hudson/remoting/Launcher.java
            src/main/java/hudson/remoting/TeeOutputStream.java
            src/main/java/hudson/remoting/jnlp/Main.java
            src/main/java/org/jenkinsci/remoting/engine/WorkDirManager.java
            src/test/java/org/jenkinsci/remoting/engine/WorkDirManagerTest.java
            http://jenkins-ci.org/commit/remoting/76c9b8ccf14f7def1141565b0dee2e4d1c5508d4
            Log:
            [JENKINS-39370,JENKINS-39369] - Support of work directories in Remoting (#129)

            • [JENKINS-39370,JENKINS-39369] - Add workDir parameter and automatically create logs there if specified
            • Save the progress
            • JENKINS-39370 - Generalize the workspace manager for Java Web Start
            • JENKINS-39370 - Restrict the range of supported symbols in the remoting work directory
            • JENKINS-39130 - Allow specifying flag for failing initialization if workdir is missing
            • JENKINS-39370 - @stephenc noticed that workDir may be null, Intellij IDEA adoption fun
            • JENKINS-39370 - Another message, which likely breaks the CI instance
            • JENKINS-39817 - Introduce the agentLog parameter in remoting.jnlp.Main

            @stephenc suggested doing it in the PR, so I decided to address it as a part of JENKINS-39370.
            But the code still has initialization in hudson.remoting.Launcher for other logging modes.

            • Enable JUL logging to a log-rotated file by default
            • JENKINS-18578 - If workspace manager is defined, use JAR Cache within its interbal directory
            • JENKINS-39370 - Fix the workDirManager's log initialization in Launcher
            • JENKINS-39369 - Make JUL logging system configurable via property file
            • JENKINS-39369 - Fixes in logging management after the manual testing
            • JENKINS-39369 - Respect configuration being passed from java.util.logging.config.file system property
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: README.md docs/logging.md docs/workDir.md src/main/java/hudson/remoting/Engine.java src/main/java/hudson/remoting/FileSystemJarCache.java src/main/java/hudson/remoting/Launcher.java src/main/java/hudson/remoting/TeeOutputStream.java src/main/java/hudson/remoting/jnlp/Main.java src/main/java/org/jenkinsci/remoting/engine/WorkDirManager.java src/test/java/org/jenkinsci/remoting/engine/WorkDirManagerTest.java http://jenkins-ci.org/commit/remoting/76c9b8ccf14f7def1141565b0dee2e4d1c5508d4 Log: [JENKINS-39370,JENKINS-39369] - Support of work directories in Remoting (#129) [JENKINS-39370,JENKINS-39369] - Add workDir parameter and automatically create logs there if specified Save the progress JENKINS-39370 - Generalize the workspace manager for Java Web Start JENKINS-39370 - WiP - Save progress in the test suite JENKINS-39370 - Add tests for WorkDirManager JENKINS-39370 - Restrict the range of supported symbols in the remoting work directory JENKINS-39370 - Generalize the workspace initialization checks JENKINS-39130 - Allow specifying flag for failing initialization if workdir is missing JENKINS-39370 - Reference DirType in WorkDirManager Javadocs JENKINS-39370 - @stephenc noticed that workDir may be null, Intellij IDEA adoption fun JENKINS-39370 - Seems this message breaks our CI JENKINS-39370 - Another message, which likely breaks the CI instance JENKINS-39370 - Simplify the log handling logic JENKINS-39817 - Introduce the agentLog parameter in remoting.jnlp.Main @stephenc suggested doing it in the PR, so I decided to address it as a part of JENKINS-39370 . But the code still has initialization in hudson.remoting.Launcher for other logging modes. Enable JUL logging to a log-rotated file by default JENKINS-18578 - If workspace manager is defined, use JAR Cache within its interbal directory JENKINS-39370 - Fix the workDirManager's log initialization in Launcher JENKINS-39370 - Draft the documentation JENKINS-39369 - Make JUL logging system configurable via property file JENKINS-39369 - Fixes in logging management after the manual testing JENKINS-39369 - Add tests for the logging subsystem JENKINS-39369 - Respect configuration being passed from java.util.logging.config.file system property
            oleg_nenashev Oleg Nenashev added a comment -

            The feature has been integrated towards Remoting 2.68

            oleg_nenashev Oleg Nenashev added a comment - The feature has been integrated towards Remoting 2.68

            People

              oleg_nenashev Oleg Nenashev
              oleg_nenashev Oleg Nenashev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: