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

First poll does not run on copied jobs which aren't yet saved or applied

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • None

      When i creat a new job by copying another job, the first poll does not run.
      Even when i click "poll now" the poll does not seem to run.
      If i open the configuration of the new job and save, the polling starts to work.

      Any ideas what the problem is? I am happy to provide logs but i am unsure which loggers to use?

      This is causing major problems for us because we have automated job creation to copy a template job. At the moment all these jobs need to be manually re-saved in order to run which is causing much delay.

          [JENKINS-30745] First poll does not run on copied jobs which aren't yet saved or applied

          jake bishop created issue -
          jake bishop made changes -
          Description Original: When i creat a new job by copying another job, the first poll does not run.
          Even when i click "poll now" the poll does not seem to run.
          If i open the configuration of the new job and save, the polling starts to work.

          Any ideas what the problem is? I am happy to provide logs but i am unsure which loggers to use?
          New: When i creat a new job by copying another job, the first poll does not run.
          Even when i click "poll now" the poll does not seem to run.
          If i open the configuration of the new job and save, the polling starts to work.

          Any ideas what the problem is? I am happy to provide logs but i am unsure which loggers to use?

          This is causing major problems for us because we have automated job creation to copy a template job. At the moment all these jobs need to be manually re-saved in order to run which is causing much delay.

          Copied job is not buildable, you should re-save configuration, works as designed.

          Kanstantsin Shautsou added a comment - Copied job is not buildable, you should re-save configuration, works as designed.
          Kanstantsin Shautsou made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          jake bishop added a comment -

          integer It used to work and now it does not. Also why are copied jobs not buildable by design? They exist and have a configuration. Why do you want to force it to re save.

          This essentially stops this from working: https://entagen.github.io/jenkins-build-per-branch/

          jake bishop added a comment - integer It used to work and now it does not. Also why are copied jobs not buildable by design? They exist and have a configuration. Why do you want to force it to re save. This essentially stops this from working: https://entagen.github.io/jenkins-build-per-branch/
          jake bishop made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Mark Waite added a comment - - edited

          yakobe can you help with a little more information?

          What was the last version where you know it worked?

          What plugin versions are you running now?

          What steps do I need to take to duplicate the problem?

          I'd prefer that you respond with more detail and fewer steps than "implement everything described at https://entagen.github.io/jenkins-build-per-branch/ ", unless that is truly the simplest way to duplicate the problem. That looks like it will take several hours for me to construct a repeatable case, and I'm not confident where it will fail or how it will fail. When I need to spend several hours duplicating a bug report, it reduces the time I can spend on the other aspects of the git plugin and the git client plugin. If it is that involved to duplicate the problem, it will likely be several weeks before I'm able to investigate.

          You said:

          When i creat a new job by copying another job, the first poll does not run.
          Even when i click "poll now" the poll does not seem to run.
          If i open the configuration of the new job and save, the polling starts to work.

          Steps I tried (define a new job, edit the job definition):

          1. Define a new job "JENKINS-30745-copied-job-does-not-poll" as a copy of existing job "git-client-plugin-my-coverage"
          2. Simplify the configuration of the new job before saving it
          3. Save the new job definition
          4. Click "Poll Now", confirm polling works

          Steps I tried (define a new job without editing the job definition):

          1. Define a new job "JENKINS-30745-copied-job-does-not-poll-no-edit" as a copy of existing job "JENKINS-21553-maven-https-NPE"
          2. Save the new job definition
          3. Click "Poll Now", confirm polling works

          Maybe you have a different way of creating the copied job which doesn't pass through the same route as the user interface that I used?

          Steps I tried (command line copy a job without editing job definition):

          1. java -jar jenkins-cli.jar -s http://localhost:8080/ copy-job JENKINS-23415-wildcard JENKINS-30745-cli-copied
          2. Open Jenkins UI, press "Poll now" on JENKINS-30745-cli-copied, confirm polling works

          You may also want to experiment with the multi-branch plugin. It automatically creates jobs when a branch is created, and automatically deletes jobs when a branch is deleted. I've found that I use it frequently for development on the git client plugin and the git plugin.

          Mark Waite added a comment - - edited yakobe can you help with a little more information? What was the last version where you know it worked? What plugin versions are you running now? What steps do I need to take to duplicate the problem? I'd prefer that you respond with more detail and fewer steps than "implement everything described at https://entagen.github.io/jenkins-build-per-branch/ ", unless that is truly the simplest way to duplicate the problem. That looks like it will take several hours for me to construct a repeatable case, and I'm not confident where it will fail or how it will fail. When I need to spend several hours duplicating a bug report, it reduces the time I can spend on the other aspects of the git plugin and the git client plugin. If it is that involved to duplicate the problem, it will likely be several weeks before I'm able to investigate. You said: When i creat a new job by copying another job, the first poll does not run. Even when i click "poll now" the poll does not seem to run. If i open the configuration of the new job and save, the polling starts to work. Steps I tried (define a new job, edit the job definition): Define a new job " JENKINS-30745 -copied-job-does-not-poll" as a copy of existing job "git-client-plugin-my-coverage" Simplify the configuration of the new job before saving it Save the new job definition Click "Poll Now", confirm polling works Steps I tried (define a new job without editing the job definition): Define a new job " JENKINS-30745 -copied-job-does-not-poll-no-edit" as a copy of existing job " JENKINS-21553 -maven-https-NPE" Save the new job definition Click "Poll Now", confirm polling works Maybe you have a different way of creating the copied job which doesn't pass through the same route as the user interface that I used? Steps I tried (command line copy a job without editing job definition): java -jar jenkins-cli.jar -s http://localhost:8080/ copy-job JENKINS-23415 -wildcard JENKINS-30745 -cli-copied Open Jenkins UI, press "Poll now" on JENKINS-30745 -cli-copied, confirm polling works You may also want to experiment with the multi-branch plugin. It automatically creates jobs when a branch is created, and automatically deletes jobs when a branch is deleted. I've found that I use it frequently for development on the git client plugin and the git plugin.

          jake bishop added a comment -

          Thanks for the feedback. I'll try to provide as much info as i can. I think that the entagen script does not save the new job definition in the same way.

          If i follow your steps:

          Steps I tried (define a new job without editing the job definition):

          Define a new job "JENKINS-30745-copied-job-does-not-poll-no-edit" as a copy of existing job "JENKINS-21553-maven-https-NPE"
          Save the new job definition
          Click "Poll Now", confirm polling works

          Then polling also works. If i do this instead (i.e. dont do the second step)

          • Define a new job "JENKINS-30745-copied-job-does-not-poll-no-edit" as a copy of existing job "JENKINS-21553-maven-https-NPE"
          • Save the new job definition Visit the new job from the dashboard without saving first
          • Click "Poll Now"
            Then polling does not happen. I have to go in and re-save to get it to work.
            The entagen script seems to leave the job in the same status.

          As i say, this worked until several weeks ago. Unfortunately i dont know what was the last version where it was ok because i thought it was just a small break and would be fixed in the next / upcoming release (happens sometimes).

          I can provide logs etc if you let me know what could be useful

          jake bishop added a comment - Thanks for the feedback. I'll try to provide as much info as i can. I think that the entagen script does not save the new job definition in the same way. If i follow your steps: Steps I tried (define a new job without editing the job definition): Define a new job " JENKINS-30745 -copied-job-does-not-poll-no-edit" as a copy of existing job " JENKINS-21553 -maven-https-NPE" Save the new job definition Click "Poll Now", confirm polling works Then polling also works. If i do this instead (i.e. dont do the second step) Define a new job " JENKINS-30745 -copied-job-does-not-poll-no-edit" as a copy of existing job " JENKINS-21553 -maven-https-NPE" Save the new job definition Visit the new job from the dashboard without saving first Click "Poll Now" Then polling does not happen. I have to go in and re-save to get it to work. The entagen script seems to leave the job in the same status. As i say, this worked until several weeks ago. Unfortunately i dont know what was the last version where it was ok because i thought it was just a small break and would be fixed in the next / upcoming release (happens sometimes). I can provide logs etc if you let me know what could be useful

          Mark Waite added a comment -

          I don't understand how a job copied from the UI but not saved would be expected to work "out of the box". I think the act of saving (or applying) the job is a critical part of the job creation, and until that is done, I assume that the job is not completely initialized. However, that is just a supposition on my part, not something I can say is fact based on experiments or review of the code.

          Can you alter your process to use the same copy-job process as is done by the jenkins-cli.jar when it runs as a command line job? It seems to perform a sufficient copy for polling, without requiring that you do anything more than run the command line jar.

          I appreciate the offer to share logs, but analyzing log files shifts the bulk of the investigation to me. There are many more submitters of bug reports and pull requests than there are plugin maintainers. I need as much help from bug reporters and pull request submitters as I can get so that I can help as many people as possible as effectively as possible.

          Mark Waite added a comment - I don't understand how a job copied from the UI but not saved would be expected to work "out of the box". I think the act of saving (or applying) the job is a critical part of the job creation, and until that is done, I assume that the job is not completely initialized. However, that is just a supposition on my part, not something I can say is fact based on experiments or review of the code. Can you alter your process to use the same copy-job process as is done by the jenkins-cli.jar when it runs as a command line job? It seems to perform a sufficient copy for polling, without requiring that you do anything more than run the command line jar. I appreciate the offer to share logs, but analyzing log files shifts the bulk of the investigation to me. There are many more submitters of bug reports and pull requests than there are plugin maintainers. I need as much help from bug reporters and pull request submitters as I can get so that I can help as many people as possible as effectively as possible.

          jake bishop added a comment - - edited

          I could understand that if the job did not exist until you click the `save` button on the configuration. However, since it is created and exists without saving i feel it should work. I.e. i just copied the job with a new name, it takes me to the config page but i dont need to change anything else.

          jake bishop added a comment - - edited I could understand that if the job did not exist until you click the `save` button on the configuration. However, since it is created and exists without saving i feel it should work. I.e. i just copied the job with a new name, it takes me to the config page but i dont need to change anything else.

            Unassigned Unassigned
            yakobe jake bishop
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: