• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • github-plugin
    • None

      Jenkins does not start the automatic build of my pipelines when the github webhook is sent.

      There is a remark in the log: "Skipped <REPO> because it doesn't have a matching repository.".

      A week ago everything was working, and now it has abruptly stopped working.

      I tried to change ssh keys and github tokens, run the build manually, change branches and links to the repository, but none of this was successful.

      I tried to execute the script (https://pastebin.com/jV6695VV )
      and got the answer:
      ajur_signup_pipeline is empty
      Empty SCM for job: ajur_signup_pipeline
      Chem-Reagents is empty
      Empty SCM for job: Chem-Reagents
      mersi_pipeline is empty
      Empty SCM for job: mersi_pipeline

      For some reason, Jenkins tells me that I have no information about SCM in my plans, but this is not the case

          [JENKINS-71360] Webhook pushes doesn't trigger any job

          Oleg added a comment -

          If I use a public repository then trigger works fine, but if I use a private repo (organization) then trigger are not worked. Used credentials is correct

          Oleg added a comment - If I use a public repository then trigger works fine, but if I use a private repo (organization) then trigger are not worked. Used credentials is correct

          Mario added a comment -

          Is there any update on this issue?
          I confirm that I am having the same problem.

          Mario added a comment - Is there any update on this issue? I confirm that I am having the same problem.

          Mario added a comment - - edited

          Hi everyone, after some testing we found out that the problem is the skipDefaultCheckout() under options in pipeline groovy.

          Before this last upgrade the automatic start on push was working fine with this option enabled.

          After removing this option and running again once manually, everything works as usual.

          Mario added a comment - - edited Hi everyone, after some testing we found out that the problem is the skipDefaultCheckout() under options in pipeline groovy. Before this last upgrade the automatic start on push was working fine with this option enabled. After removing this option and running again once manually, everything works as usual.

          Oleg added a comment -

          Hi
          I switched to gh actions a long time ago. But your answer made me test your theory and it turned out to be correct! It's strange, but by removing skipDefaultCheckout(), my pipeline is working! In any case, thank you for sharing and not being indifferent.

          Oleg added a comment - Hi I switched to gh actions a long time ago. But your answer made me test your theory and it turned out to be correct! It's strange, but by removing skipDefaultCheckout(), my pipeline is working! In any case, thank you for sharing and not being indifferent.

          Alex added a comment -

          After tearing my hear out for an afternoon, I've found the culprit for this...

           

          The issue starts here:

          https://github.com/jenkinsci/github-plugin/blob/cf59d23e858e271eb0f2c0bcff72c9897f5b2d0a/src/main/java/org/jenkinsci/plugins/github/webhook/WebhookManager.java#L109

          And:

          https://github.com/jenkinsci/github-plugin/blob/cf59d23e858e271eb0f2c0bcff72c9897f5b2d0a/src/main/java/com/cloudbees/jenkins/GitHubRepositoryNameContributor.java#L128C13-L128C27

           

          This gets executed as part of registering the webhook (WebhookManager.registerFor), which calls parseAssociatedNames. parseAssociatedNames gets the SCMTriggerItem from the project/job that's passed in. The details for the SCMTriggerItem are from here:

          https://github.com/jenkinsci/workflow-job-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java#L543C1-L544C1

           

          Which from this snippet:

                  WorkflowRun b = getLastSuccessfulBuild();
                  if (b == null) {
                      b = getLastCompletedBuild();
                  }
                  if (b == null) {
                      return Collections.emptySet();
                  } 

          You can see that if there is no previous execution of your job, the SCMTriggerItem will be an empty set, so as far as the GitHub plugin is concerned, there's nothing to register against, and you end up with

          Alex added a comment - After tearing my hear out for an afternoon, I've found the culprit for this...   The issue starts here: https://github.com/jenkinsci/github-plugin/blob/cf59d23e858e271eb0f2c0bcff72c9897f5b2d0a/src/main/java/org/jenkinsci/plugins/github/webhook/WebhookManager.java#L109 And: https://github.com/jenkinsci/github-plugin/blob/cf59d23e858e271eb0f2c0bcff72c9897f5b2d0a/src/main/java/com/cloudbees/jenkins/GitHubRepositoryNameContributor.java#L128C13-L128C27   This gets executed as part of registering the webhook (WebhookManager.registerFor), which calls parseAssociatedNames. parseAssociatedNames gets the SCMTriggerItem from the project/job that's passed in. The details for the SCMTriggerItem are from here: https://github.com/jenkinsci/workflow-job-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java#L543C1-L544C1   Which from this snippet:         WorkflowRun b = getLastSuccessfulBuild();         if (b == null ) {             b = getLastCompletedBuild();         }         if (b == null ) {             return Collections.emptySet();         } You can see that if there is no previous execution of your job, the SCMTriggerItem will be an empty set, so as far as the GitHub plugin is concerned, there's nothing to register against, and you end up with

          Quatrix added a comment -

          I was able to resolve this issue by removing spaces from the 'Display name' of the multi branch pipeline. e.g I edited 'Web Application Multi-Branch Pipeline' to 'web-application-multi-branch-pipeline' and a push to GitHub resulted in a Jenkins build being triggered.

          Quatrix added a comment - I was able to resolve this issue by removing spaces from the ' Display name ' of the multi branch pipeline. e.g I edited ' Web Application Multi-Branch Pipeline ' to ' web-application-multi-branch-pipeline ' and a push to GitHub resulted in a Jenkins build being triggered.

            lanwen Kirill Merkushev
            lemar98 Oleg
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: