Skip to content

[JENKINS-34146] Disabled parametrized jobs could be build from build URL #17013

Closed

Description

@jenkins-infra-bot

If you use the build URL you could launch disabled parametrized jobs

1 - Create a Job (any type)
2 - add a parameter
3 - copy build URL
4 - disable the job
5 - paste the URL on browser and go to it
6 - the build asks for parameters and could be launch
7 - the build is keep on queue forever


Originally reported by ifernandezcalvo, imported from: Disabled parametrized jobs could be build from build URL
  • assignee: ifernandezcalvo
  • status: Resolved
  • priority: Minor
  • component(s): core
  • resolution: Fixed
  • resolved: 2016-04-22T22:41:14+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

If you use the build URL you could launch disabled parametrized jobs

1 - Create a Job (any type) 2 - add a parameter 3 - copy build URL 4 - disable the job 5 - paste the URL on browser and go to it 6 - the build asks for parameters and could be launch 7 - the build is keep on queue forever

  • environment: 1.625

Activity

  1. jenkins-infra-bot commented on Apr 11, 2016

    @jenkins-infra-bot
    Author
    • Remote link associated with this issue:

  2. jenkins-infra-bot commented on Apr 12, 2016

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      Cannot reproduce on 1.642.2. While the page "This build requires parameters" appears, submitting the form does not result in a queue item.

      Apr 12, 2016 4:31:16 PM hudson.model.Executor finish1
      SEVERE: Executor threw an exception
      java.lang.Error: The null Executable has been created for hudson.model.queue.WorkUnit@35711043[work=jobname]. The task cannot be executed
      	at hudson.model.Executor.run(Executor.java:397)
      

      This could probably be improved, but Jenkins does not expose the reported problem (anymore).

      Please make sure issues you report actually occur in current versions of Jenkins.

    Cannot reproduce on 1.642.2. While the page "This build requires parameters" appears, submitting the form does not result in a queue item.

    Apr 12, 2016 4:31:16 PM hudson.model.Executor finish1
    SEVERE: Executor threw an exception
    java.lang.Error: The null Executable has been created for hudson.model.queue.WorkUnit@​35711043[work=jobname]. The task cannot be executed
    	at hudson.model.Executor.run(Executor.java:397)
    
    

    This could probably be improved, but Jenkins does not expose the reported problem (anymore).

    Please make sure issues you report actually occur in current versions of Jenkins.

  3. jenkins-infra-bot commented on Apr 13, 2016

    @jenkins-infra-bot
    Author
    ifernandezcalvo:
    • Original comment link
    • Raw content of original comment:

      I could reproduce it on 1.642.3.2

      in ParameterizedJobMixIn ask for parameters before to check if it is asJob().isBuildable()

          public final void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException {
              if (delay == null) {
                  delay = new TimeDuration(asJob().getQuietPeriod());
              }
      
              // if a build is parameterized, let that take over
              ParametersDefinitionProperty pp = asJob().getProperty(ParametersDefinitionProperty.class);
              if (pp != null && !req.getMethod().equals("POST")) {
                  // show the parameter entry form.
                  req.getView(pp, "index.jelly").forward(req, rsp);
                  return;
              }
      
              hudson.model.BuildAuthorizationToken.checkPermission(asJob(), asJob().getAuthToken(), req, rsp);
      
              if (pp != null) {
                  pp._doBuild(req, rsp, delay);
                  return;
              }
      
              if (!asJob().isBuildable()) {
                  throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR, new IOException(asJob().getFullName() + " is not buildable"));
              }
      

      This order solve de problem.

          public final void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException {
              if (delay == null) {
                  delay = new TimeDuration(asJob().getQuietPeriod());
              }
      
          <span class="code-keyword">if</span> (!asJob().isBuildable()) {
              <span class="code-keyword">throw</span> HttpResponses.error(SC_INTERNAL_SERVER_ERROR, <span class="code-keyword">new</span> IOException(asJob().getFullName() + <span class="code-quote">" is not buildable"</span>));
          }
      
          <span class="code-comment">// <span class="code-keyword">if</span> a build is parameterized, let that take over
      

      ParametersDefinitionProperty pp = asJob().getProperty(ParametersDefinitionProperty.class);
      if (pp != null && !req.getMethod().equals("POST")) {
      // show the parameter entry form.
      req.getView(pp, "index.jelly").forward(req, rsp);
      return;
      }

    I could reproduce it on 1.642.3.2

    in ParameterizedJobMixIn ask for parameters before to check if it is asJob().isBuildable()

        public final void doBuild(StaplerRequest req, StaplerResponse rsp, @​QueryParameter TimeDuration delay) throws IOException, ServletException {
    if (delay == null) {
        delay = new TimeDuration(asJob().getQuietPeriod());
    }
    
    // if a build is parameterized, let that take over
    ParametersDefinitionProperty pp = asJob().getProperty(ParametersDefinitionProperty.class);
    if (pp != null && !req.getMethod().equals("POST")) {
        // show the parameter entry form.
        req.getView(pp, "index.jelly").forward(req, rsp);
        return;
    }
    
    hudson.model.BuildAuthorizationToken.checkPermission(asJob(), asJob().getAuthToken(), req, rsp);
    
    if (pp != null) {
        pp._doBuild(req, rsp, delay);
        return;
    }
    
    if (!asJob().isBuildable()) {
        throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR, new IOException(asJob().getFullName() + " is not buildable"));
    }
    

    This order solve de problem.

        public final void doBuild(StaplerRequest req, StaplerResponse rsp, @​QueryParameter TimeDuration delay) throws IOException, ServletException {
    if (delay == null) {
        delay = new TimeDuration(asJob().getQuietPeriod());
    }
    
    if (!asJob().isBuildable()) {
        throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR, new IOException(asJob().getFullName() + " is not buildable"));
    }
    
    // if a build is parameterized, let that take over
    ParametersDefinitionProperty pp = asJob().getProperty(ParametersDefinitionProperty.class);
    if (pp != null && !req.getMethod().equals("POST")) {
        // show the parameter entry form.
        req.getView(pp, "index.jelly").forward(req, rsp);
        return;
    }
    
  4. jenkins-infra-bot commented on Apr 13, 2016

    @jenkins-infra-bot
    Author
    ifernandezcalvo:

    I made a pull request with the change #2262

  5. jenkins-infra-bot commented on Apr 22, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Ivan Fernandez Calvo
    Path:
    core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
    http://jenkins-ci.org/commit/jenkins/37e7856b017fcf700d314086a709f00601edef00
    Log:
    JENKINS-34146 check if build is build able before to ask for parameters

  6. jenkins-infra-bot commented on Apr 22, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Daniel Beck
    Path:
    core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
    http://jenkins-ci.org/commit/jenkins/f6e431b80c4d162560419fa51633224a9724bb0d
    Log:
    Merge pull request #2262 from kuisathaverat/JENKINS-34146

    [FIX JENKINS-34146] check if build is build able before to ask for parameters

    Compare: ce9de5a...f6e431b

  7. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions