• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • matrix-project-plugin
    • None
    • Jenkins 1.518

      I have seen matrix sub-jobs abort before even starting a build on a slave machine. On investigating further I see that for some reason the sub-job config.xml files contain the tags:
      <disabled>true</disabled>
      even though the matrix job is enabled and indeed the top level config.xml contains:
      <disabled>false</disabled>
      This seems to happen to jobs that have been copied from other matrix jobs where the axis configurations have changed a few times.
      Since the user has no control over this tag it must be redundant. I think that the code should force the disabled tag to be false for all child jobs.

          [JENKINS-19179] Matrix sub-jobs get disabled

          Jesse Glick added a comment -

          As noted in this Q&A the workaround is to browse to configure on the matrix configuration and uncheck Disabled.

          Clearly one bug is that a matrix configuration got disabled somehow, i.e. the MatrixConfiguration.disabled field was set. How?

          The next bug is that configure (and configSubmit) are even available on matrix configurations (albeit without a sidebar link), when there does not seem to be any intent for these config.xml files to be individually configurable. (The configure page shows all sorts of options, such as SCMs, which are definitely not supposed to be allowed on configurations.) These URLs should presumably be blocked. The config.xml URL is also available; in GET mode this might be OK, but a POST to it is probably also bad.

          Then there is the problem that despite the fact that MatrixConfiguration.supportsMakeDisabled is false, so no UI button appears to explicitly enable or disable the project, isDisabled is not overridden to unconditionally return true.

          Jesse Glick added a comment - As noted in this Q&A the workaround is to browse to configure on the matrix configuration and uncheck Disabled . Clearly one bug is that a matrix configuration got disabled somehow, i.e. the MatrixConfiguration.disabled field was set. How? The next bug is that configure (and configSubmit ) are even available on matrix configurations (albeit without a sidebar link), when there does not seem to be any intent for these config.xml files to be individually configurable. (The configure page shows all sorts of options, such as SCMs, which are definitely not supposed to be allowed on configurations.) These URLs should presumably be blocked. The config.xml URL is also available; in GET mode this might be OK, but a POST to it is probably also bad. Then there is the problem that despite the fact that MatrixConfiguration.supportsMakeDisabled is false, so no UI button appears to explicitly enable or disable the project, isDisabled is not overridden to unconditionally return true .

          Artur Szostak added a comment -

          I remember trying that very trick a few times, but with limited success. However, I did find a workaround that has worked every time so far. One needs to go to the Jenkins script console and run the following script:

          def jenkins = hudson.model.Hudson.instance;
          def job = jenkins.getItem("job-name");
          for (cfg in job.getItems()) {
          cfg.disabled = false;
          println(cfg.disabled);
          }

          Note: the job-name above should be replaced with the appropriate matrix job name that is causing the problem.
          This script effectively runs through the sub-jobs of the matrix job and forces them to enabled.

          Artur Szostak added a comment - I remember trying that very trick a few times, but with limited success. However, I did find a workaround that has worked every time so far. One needs to go to the Jenkins script console and run the following script: def jenkins = hudson.model.Hudson.instance; def job = jenkins.getItem("job-name"); for (cfg in job.getItems()) { cfg.disabled = false; println(cfg.disabled); } Note: the job-name above should be replaced with the appropriate matrix job name that is causing the problem. This script effectively runs through the sub-jobs of the matrix job and forces them to enabled.

          Oleg Nenashev added a comment -

          I propose to explicitly prohibit the disabling of Matrix configurations.
          It would just workaround issues like JENKINS-18164.

          Oleg Nenashev added a comment - I propose to explicitly prohibit the disabling of Matrix configurations. It would just workaround issues like JENKINS-18164 .

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/hudson/matrix/MatrixConfiguration.java
          src/main/resources/hudson/matrix/Messages.properties
          http://jenkins-ci.org/commit/matrix-project-plugin/fe786b4b47e8137f538e451a3ed888ace5e85780
          Log:
          [FIXED JENKINS-19179] - Prevent the disabling of Matrix Configurations

          This change blocks calls, which try to disable matrix configurations.
          MatrixConfiguration::isDisabled() always returns the parent's value.

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/matrix/MatrixConfiguration.java src/main/resources/hudson/matrix/Messages.properties http://jenkins-ci.org/commit/matrix-project-plugin/fe786b4b47e8137f538e451a3ed888ace5e85780 Log: [FIXED JENKINS-19179] - Prevent the disabling of Matrix Configurations This change blocks calls, which try to disable matrix configurations. MatrixConfiguration::isDisabled() always returns the parent's value. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/hudson/matrix/MatrixConfiguration.java
          http://jenkins-ci.org/commit/matrix-project-plugin/2a0d3da2936e43fe5542be7772de2b115fff20d8
          Log:
          JENKINS-19179 - Allow internal API calls, which disable the project.

          This change provides the compatibility with project deletion flows, which disable configurations/projects before the deletion.
          All specified values will be replaced by the current status of the parent project.

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/matrix/MatrixConfiguration.java http://jenkins-ci.org/commit/matrix-project-plugin/2a0d3da2936e43fe5542be7772de2b115fff20d8 Log: JENKINS-19179 - Allow internal API calls, which disable the project. This change provides the compatibility with project deletion flows, which disable configurations/projects before the deletion. All specified values will be replaced by the current status of the parent project. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Oleg Nenashev added a comment -

          I've synced the data to a wrong branch.Please ignore previous SCM notifications

          Oleg Nenashev added a comment - I've synced the data to a wrong branch.Please ignore previous SCM notifications

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/hudson/matrix/MatrixConfiguration.java
          src/main/resources/hudson/matrix/Messages.properties
          http://jenkins-ci.org/commit/matrix-project-plugin/c5ed324690b68eaa636da879dae801e5f323178f
          Log:
          Merge pull request #5 from synopsys-arc-oss/JENKINS-19179

          [FIXED JENKINS-19179] - Prevent the disabling of Matrix Configurations

          Compare: https://github.com/jenkinsci/matrix-project-plugin/compare/b888102cb7dc...c5ed324690b6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/matrix/MatrixConfiguration.java src/main/resources/hudson/matrix/Messages.properties http://jenkins-ci.org/commit/matrix-project-plugin/c5ed324690b68eaa636da879dae801e5f323178f Log: Merge pull request #5 from synopsys-arc-oss/ JENKINS-19179 [FIXED JENKINS-19179] - Prevent the disabling of Matrix Configurations Compare: https://github.com/jenkinsci/matrix-project-plugin/compare/b888102cb7dc...c5ed324690b6

            oleg_nenashev Oleg Nenashev
            aszostak Artur Szostak
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: