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

maven submodule build fails doing mkdir on master

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: maven-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.427 (also tested git 9dca500e2 private build).
      Master ubuntu 10.04 and slave ubuntu 11.04
      Build is configured to use maven 2.2.1.

      Description

      I have a multi-module maven project that builds correctly on a slave node but when I invoke a "build now" on one of the sub-modules of the build it fails with mkdir failed.

      The mkdir path is correct for the slave but I instrumented the code and did a local build based off current git and it seems to me that the mkdir is being performed on the master node (this would explain the failure because directory permissions will forbid the mkdir on the master).

      I see the following in the build log.

      Started by user richm
      Building remotely on bishop
      java.io.IOException: Failed to mkdirs: /opt/jenkins/slave/workspace/tcserv/tcserv/tcweb
      at hudson.FilePath.mkdirs(FilePath.java:817)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1191)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:555)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:443)
      at hudson.model.Run.run(Run.java:1376)
      at hudson.maven.MavenBuild.run(MavenBuild.java:257)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)
      FATAL: null
      java.lang.NullPointerException
      at hudson.maven.MavenBuild$RunnerImpl.post2(MavenBuild.java:753)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604)
      at hudson.model.Run.run(Run.java:1401)
      at hudson.maven.MavenBuild.run(MavenBuild.java:257)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)

      But after having added a few LOGGER.warn() calls into FilePath#mkdir() I see the following output on the master log (but nothing in the slave log)

      26-Aug-2011 22:40:39 hudson.FilePath$8 invoke
      WARNING: Mkdirs for file /opt/jenkins/slave/workspace/tcserv/tcserv/tcweb with channel hudson.remoting.LocalChannel@45cb0cdc
      26-Aug-2011 22:40:39 hudson.FilePath$8 invoke
      WARNING: 2nd Mkdirs for file /opt/jenkins/slave/workspace/tcserv/tcserv/tcweb
      26-Aug-2011 22:40:39 hudson.FilePath$8 invoke
      WARNING: mkdirs said false

      If I temporarily create a writable parent folder on the master then the mkdirs succeeds.

      Note the NPE that occurs after the mkdirs/checkout has failed is unrelated to the primary failure. I've got a patch that stops the NPE and will issue a pull request for that particular bit in due course.

        Activity

        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Richard Mortimer
        Path:
        core/src/main/java/hudson/model/AbstractBuild.java
        maven-plugin/src/main/java/hudson/maven/MavenBuild.java
        http://jenkins-ci.org/commit/jenkins/bafad70c0becf3376aed0751ef34f345a21a84c0
        Log:
        JENKINS-10831 maven submodule build fails doing mkdir on master.

        Remove the shadow copy of buildOn from MavenBuild.java and move the setter to
        AbstractBuild to allow MavenModuleSetBuild.java to continue to set the
        build node.
        (cherry picked from commit 67262e455f818bf693d1bd7a5987c9268b29c52e)

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: core/src/main/java/hudson/model/AbstractBuild.java maven-plugin/src/main/java/hudson/maven/MavenBuild.java http://jenkins-ci.org/commit/jenkins/bafad70c0becf3376aed0751ef34f345a21a84c0 Log: JENKINS-10831 maven submodule build fails doing mkdir on master. Remove the shadow copy of buildOn from MavenBuild.java and move the setter to AbstractBuild to allow MavenModuleSetBuild.java to continue to set the build node. (cherry picked from commit 67262e455f818bf693d1bd7a5987c9268b29c52e)
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Richard Mortimer
        Path:
        maven-plugin/src/main/java/hudson/maven/MavenBuild.java
        http://jenkins-ci.org/commit/jenkins/d630404282c993756497d2adf884413d87b89cc4
        Log:
        Ignore null reporters field and avoid a NPE.
        The NPE can occur if a build fails during checkout and hence the run phase
        never gets called. See JENKINS-10831 for an example of this happening.
        (cherry picked from commit 2fa40188b91bd0f55c611fbd0cb2878c8d55da55)

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: maven-plugin/src/main/java/hudson/maven/MavenBuild.java http://jenkins-ci.org/commit/jenkins/d630404282c993756497d2adf884413d87b89cc4 Log: Ignore null reporters field and avoid a NPE. The NPE can occur if a build fails during checkout and hence the run phase never gets called. See JENKINS-10831 for an example of this happening. (cherry picked from commit 2fa40188b91bd0f55c611fbd0cb2878c8d55da55)
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Richard Mortimer
        Path:
        changelog.html
        http://jenkins-ci.org/commit/jenkins/bac1f8a013a5e716641dc66ad877021bcc9f5996
        Log:
        Add changelog entry for JENKINS-10831
        (cherry picked from commit f8e92df4d54b6bb405a11503e3cc3763049d4c0d)

        Conflicts:

        changelog.html

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: changelog.html http://jenkins-ci.org/commit/jenkins/bac1f8a013a5e716641dc66ad877021bcc9f5996 Log: Add changelog entry for JENKINS-10831 (cherry picked from commit f8e92df4d54b6bb405a11503e3cc3763049d4c0d) Conflicts: changelog.html
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Richard Mortimer
        Path:
        src/main/java/hudson/maven/MavenBuild.java
        http://jenkins-ci.org/commit/maven-plugin/b7bdae110772e8972f561db154958a6bf7df8350
        Log:
        Ignore null reporters field and avoid a NPE.
        The NPE can occur if a build fails during checkout and hence the run phase
        never gets called. See JENKINS-10831 for an example of this happening.

        Originally-Committed-As: 2fa40188b91bd0f55c611fbd0cb2878c8d55da55

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: src/main/java/hudson/maven/MavenBuild.java http://jenkins-ci.org/commit/maven-plugin/b7bdae110772e8972f561db154958a6bf7df8350 Log: Ignore null reporters field and avoid a NPE. The NPE can occur if a build fails during checkout and hence the run phase never gets called. See JENKINS-10831 for an example of this happening. Originally-Committed-As: 2fa40188b91bd0f55c611fbd0cb2878c8d55da55
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Richard Mortimer
        Path:
        src/main/java/hudson/maven/MavenBuild.java
        http://jenkins-ci.org/commit/maven-plugin/61cac17925d494606476920c9fa31cd26d1a835e
        Log:
        JENKINS-10831 maven submodule build fails doing mkdir on master.

        Remove the shadow copy of buildOn from MavenBuild.java and move the setter to
        AbstractBuild to allow MavenModuleSetBuild.java to continue to set the
        build node.

        Originally-Committed-As: 67262e455f818bf693d1bd7a5987c9268b29c52e

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: src/main/java/hudson/maven/MavenBuild.java http://jenkins-ci.org/commit/maven-plugin/61cac17925d494606476920c9fa31cd26d1a835e Log: JENKINS-10831 maven submodule build fails doing mkdir on master. Remove the shadow copy of buildOn from MavenBuild.java and move the setter to AbstractBuild to allow MavenModuleSetBuild.java to continue to set the build node. Originally-Committed-As: 67262e455f818bf693d1bd7a5987c9268b29c52e

          People

          • Assignee:
            oldelvet Richard Mortimer
            Reporter:
            oldelvet Richard Mortimer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: