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

Unreliable defaulting of Jenkins.workspaceDir

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Jenkins.workspaceDir is supposed to default to $JENKINS_HOME/workspace/ on new installations: the "modern" location, consistent with that of slaves. But if you do not save the Jenkins global configuration during the first startup, on the next startup $JENKINS_HOME/jobs/ exists yet $JENKINS_HOME/config.xml does not, so the "compatibility" code kicks in and the old location is used!

      Just setting this field to the new value in the instance initializer probably does not suffice, since installations upgraded from before the introduction of this field would be incorrectly switched to the new value.

      Probably suffices to adjust the check to also check for the existence of $JENKINS_HOME/config.xml, since most old installations would have saved this file at least once.

        Attachments

          Issue Links

            Activity

            Hide
            davida2009 David Aldrich added a comment -

            Baptiste Mathus I see this message in our console log:

            Feb 18, 2019 8:29:06 AM WARNING jenkins.branch.WorkspaceLocatorImpl getWorkspaceRoot
            JENKINS-2111 path sanitization ineffective when using legacy Workspace Root Directory ‘${ITEM_ROOTDIR}/workspace’; switch to ‘${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}’ as in JENKINS-8446 / JENKINS-21942
            

            I don't understand the message. Please will you suggest how I can fix the problem in our Jenkins installation?

            Show
            davida2009 David Aldrich added a comment - Baptiste Mathus I see this message in our console log: Feb 18, 2019 8:29:06 AM WARNING jenkins.branch.WorkspaceLocatorImpl getWorkspaceRoot JENKINS-2111 path sanitization ineffective when using legacy Workspace Root Directory ‘${ITEM_ROOTDIR}/workspace’; switch to ‘${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}’ as in JENKINS-8446 / JENKINS-21942 I don't understand the message. Please will you suggest how I can fix the problem in our Jenkins installation?
            Hide
            dmolesuc3 David Moles added a comment -

            I'm seeing the same, in a Docker image configured with JCasC.

             

            Show
            dmolesuc3 David Moles added a comment - I'm seeing the same, in a Docker image configured with JCasC.  
            Hide
            kerrhome Shannon Kerr added a comment - - edited

            Baptiste Mathus I'm seeing the same.  Do we know what needs to be done to correct this?  Per Jesse Glick on JENKINS-2111 this is not something we should ignore.

            Show
            kerrhome Shannon Kerr added a comment - - edited Baptiste Mathus I'm seeing the same.  Do we know what needs to be done to correct this?  Per Jesse Glick on JENKINS-2111 this is not something we should ignore.
            Hide
            batmat Baptiste Mathus added a comment - - edited

            I think we are going to try and look into this, but anyone feel free to give it a shot if you feel like it. See https://github.com/jenkinsci/jenkins/pull/3364 partly for hints, as it touches mainly the related code area.

            Fixing this should not be too hard for an experienced Java developer.

            *UPDATE: also, David Moles it would be very interesting if you can provide a GitHub repo for such a Docker image demonstrating the issue. Definitely should help fixing this more quickly.
            UPDATE2: as said by Jesse too, if you are seeing this, this would also mean you are building on the master node, which is generally strongly discouraged.*

            Show
            batmat Baptiste Mathus added a comment - - edited I think we are going to try and look into this, but anyone feel free to give it a shot if you feel like it. See https://github.com/jenkinsci/jenkins/pull/3364 partly for hints, as it touches mainly the related code area. Fixing this should not be too hard for an experienced Java developer. *UPDATE: also, David Moles it would be very interesting if you can provide a GitHub repo for such a Docker image demonstrating the issue. Definitely should help fixing this more quickly. UPDATE2: as said by Jesse too, if you are seeing this, this would also mean you are building on the master node, which is generally strongly discouraged.*
            Hide
            jglick Jesse Glick added a comment -

            My suggestion as of 2018-04-24 is to just toss out the partially broken compatibility code and only mention the recommended location in the code. Simpler and probably good enough.

            Show
            jglick Jesse Glick added a comment - My suggestion as of 2018-04-24 is to just toss out the partially broken compatibility code and only mention the recommended location in the code. Simpler and probably good enough.

              People

              • Assignee:
                Unassigned
                Reporter:
                jglick Jesse Glick
              • Votes:
                5 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated: