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

Webhook not working with return Processed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: gitea-plugin
    • Labels:
    • Environment:
      Jenkins version : 2.222.3
      Gitea version : 1.8.1
      All components run on docker container
    • Similar Issues:

      Description

      I have configured a Weeb Hook on Gitea server.

      The test of this hook seems to works fine (HTTP 200 return code and Response body = Processe) but no build is visible on Jenkins side.

        Attachments

          Activity

          Hide
          sadmin91 Boris Manchette added a comment -

          No problem.

          Could you describe which file is necessary to analyze this behaviour?

          Show
          sadmin91 Boris Manchette added a comment - No problem. Could you describe which file is necessary to analyze this behaviour?
          Hide
          stephenconnolly Stephen Connolly added a comment -

          The Multibranch project’s event log

          If multibranch is in an org folder, the org folder’s event logs

          Snipped around the event

          Would be a start anyway

          Show
          stephenconnolly Stephen Connolly added a comment - The Multibranch project’s event log If multibranch is in an org folder, the org folder’s event logs Snipped around the event Would be a start anyway
          Hide
          sadmin91 Boris Manchette added a comment -

          When I click on "Multibranch Pipeline Events", no event is tracing.

          Could you explain how to send the desired log file?

          Show
          sadmin91 Boris Manchette added a comment - When I click on "Multibranch Pipeline Events", no event is tracing. Could you explain how to send the desired log file?
          Hide
          stegss Steffen Gaisser added a comment -

          As far as I can see a possible problem with webhooks and the gitea plugin is the usage of ssh credentials for gitea with a different url. AFAIK, the webhook checks only the html url in the payload of the webhook:

          Gitea GiteaCreateSCMEvent.java

          In my case the https (html) and ssh url are different. The scm event was triggered but the event matcher will not find any matching jenkins job for the webhook. However, the return will be 200 and processed.

          You can test this with replacing the html url in the json, which gitea provides in the webhook view, and using curl to POST the request. If I inserted my ssh url in the html of the json, then the webhook triggered the job correctĺy.

          Entering an alias in the jenkins settings does not change the way, the event matcher works. I don't want to setup a specific jenkins user for gitea as I wanted to use deploy keys only. Another solution would be to add a check in GiteaCreateSCMEvent.isMatch(..) with the ssh url: ...(getPayload().getRepository().getSshUrl());...

          Show
          stegss Steffen Gaisser added a comment - As far as I can see a possible problem with webhooks and the gitea plugin is the usage of ssh credentials for gitea with a different url. AFAIK, the webhook checks only the html url in the payload of the webhook: Gitea GiteaCreateSCMEvent.java In my case the https (html) and ssh url are different. The scm event was triggered but the event matcher will not find any matching jenkins job for the webhook. However, the return will be 200 and processed. You can test this with replacing the html url in the json, which gitea provides in the webhook view, and using curl to POST the request. If I inserted my ssh url in the html of the json, then the webhook triggered the job correctĺy. Entering an alias in the jenkins settings does not change the way, the event matcher works. I don't want to setup a specific jenkins user for gitea as I wanted to use deploy keys only. Another solution would be to add a check in GiteaCreateSCMEvent.isMatch(..) with the ssh url: ...(getPayload().getRepository().getSshUrl());...
          Hide
          youngmit Mitchell Young added a comment -

          Steffen Gaisser I suspect that I am having a very similar issue to yours, but am struggling to reproduce your ability to get the job to fire off with a doctored JSON through curl. Could you provide a more complete example of what you're doing?

          Show
          youngmit Mitchell Young added a comment - Steffen Gaisser I suspect that I am having a very similar issue to yours, but am struggling to reproduce your ability to get the job to fire off with a doctored JSON through curl. Could you provide a more complete example of what you're doing?

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sadmin91 Boris Manchette
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: