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

SCMSource is [BitbucketSCMSource] which is not supported

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi,

      I have Bitbucket Team/Project with default configuration

      I already configured the webhook by using the guide here:  https://plugins.jenkins.io/bitbucket/
       
      But when I'm pusing code changes I can see that the jenkins got the webhook

      2021-03-07 17:37:47.044+0000 [id=258] INFO c.c.j.p.BitbucketPayloadProcessor#processWebhookPayload: Received commit hook notification for {"scm":"git","website":null,"uuid":"{c647e2e1-15a6-4d01-891c-b1b43282cae8}","links":{"self":{"href":"https://api.bitbucket.org/2.0/repositories/myorg/myservice"},"html":{"href":"https://bitbucket.org/myorg/myservice"},"avatar":{"href":"https://bytebucket.org/ravatar/%7Bc647e2e1-15a6-4d01-891c-b1b43282cae8%7D?ts=default"}},"project":{"links":{"self":{"href":"https://api.bitbucket.org/2.0/workspaces/myorg/projects/CP"},"html":{"href":"https://bitbucket.org/myorg/workspace/projects/CP"},"avatar":{"href":"https://bitbucket.org/account/user/myorg/projects/CP/avatar/32?ts=1614678995"}},"type":"project","name":"myorg Platform","key":"CP","uuid":"{09d0cc61-f823-47ec-b0e8-2edabb72cc63}"},"full_name":"myorg/myservice","owner":{"username":"myorg","display_name":"myorg","type":"team","uuid":"{664512eb-246b-41e4-9fb3-de8e2003c064}","links":{"self":{"href":"https://api.bitbucket.org/2.0/teams/%7B664512eb-246b-41e4-9fb3-de8e2003c064%7D"},"html":{"href":"https://bitbucket.org/%7B664512eb-246b-41e4-9fb3-de8e2003c064%7D/"},"avatar":{"href":"https://bitbucket.org/account/myorg/avatar/"}}},"workspace":{"slug":"myorg","type":"workspace","name":"myorg","links":{"self":{"href":"https://api.bitbucket.org/2.0/workspaces/myorg"},"html":{"href":"https://bitbucket.org/myorg/"},"avatar":{"href":"https://bitbucket.org/workspaces/myorg/avatar/?ts=1614788230"}},"uuid":"{664512eb-246b-41e4-9fb3-de8e2003c064}"},"type":"repository","is_private":true,"name":"myservice"}2021-03-07 17:37:47.044+0000 [id=258] INFO c.c.j.p.BitbucketPayloadProcessor#processWebhookPayload: Received commit hook notification for {"scm":"git","website":null,"uuid":"{c647e2e1-15a6-4d01-891c-b1b43282cae8}","links":{"self":{"href":"https://api.bitbucket.org/2.0/repositories/myorg/myservice"},"html":{"href":"https://bitbucket.org/myorg/myservice"},"avatar":{"href":"https://bytebucket.org/ravatar/%7Bc647e2e1-15a6-4d01-891c-b1b43282cae8%7D?ts=default"}},"project":{"links":{"self":{"href":"https://api.bitbucket.org/2.0/workspaces/myorg/projects/CP"},"html":{"href":"https://bitbucket.org/myorg/workspace/projects/CP"},"avatar":{"href":"https://bitbucket.org/account/user/myorg/projects/CP/avatar/32?ts=1614678995"}},"type":"project","name":"myorg Platform","key":"CP","uuid":"{09d0cc61-f823-47ec-b0e8-2edabb72cc63}"},"full_name":"myorg/myservice","owner":{"username":"myorg","display_name":"myorg","type":"team","uuid":"{664512eb-246b-41e4-9fb3-de8e2003c064}","links":{"self":{"href":"https://api.bitbucket.org/2.0/teams/%7B664512eb-246b-41e4-9fb3-de8e2003c064%7D"},"html":{"href":"https://bitbucket.org/%7B664512eb-246b-41e4-9fb3-de8e2003c064%7D/"},"avatar":{"href":"https://bitbucket.org/account/myorg/avatar/"}}},"workspace":{"slug":"myorg","type":"workspace","name":"myorg","links":{"self":{"href":"https://api.bitbucket.org/2.0/workspaces/myorg"},"html":{"href":"https://bitbucket.org/myorg/"},"avatar":{"href":"https://bitbucket.org/workspaces/myorg/avatar/?ts=1614788230"}},"uuid":"{664512eb-246b-41e4-9fb3-de8e2003c064}"},"type":"repository","is_private":true,"name":"myservice"}
      

      But the relevant job not started automatically 
       
      When I started to record the following logs

      com.cloudbees.jenkins.plugins.BitbucketHookReceiver
      com.cloudbees.jenkins.plugins.BitBucketTrigger
      com.cloudbees.jenkins.plugins.BitbucketJobProbe
      com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor
      com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource
      com.cloudbees.jenkins.plugins.bitbucket.hooks
      com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener
      

      I could see the following error log

      Considering candidate scmSourceOwner repositories » myorg » myapp
      Mar 07, 2021 6:26:22 PM FINER com.cloudbees.jenkins.plugins.BitbucketJobProbe
      Considering candidate scmSource com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource{id='com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator::https://bitbucket.org::myorg::myapp'}
      Mar 07, 2021 6:26:22 PM FINEST com.cloudbees.jenkins.plugins.BitbucketJobProbe
      SCMSource is [BitbucketSCMSource] which is not supported
      Mar 07, 2021 6:26:22 PM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbe
      SCM [repositories » myorg » myapp] doesn't match remote repo [https://bitbucket.org/myorg/myapp]
      Mar 07, 2021 6:26:22 PM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbe

      not working also for Multibranch Pipeline

      I couldn't find any solution here: https://issues.jenkins.io/browse/JENKINS-63848

        Attachments

          Activity

          Hide
          dordor dor s added a comment - - edited

          The code here: https://github.com/jenkinsci/bitbucket-plugin/blob/abf2a01527b000b701fc14263420c0eccd28db4b/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L69-L75

          is calling to match() method which is checking if this scm is instance of GitSCM or MercurialSCM but it's not. the scm is an instance of BitbucketSCMSource

          here :https://github.com/jenkinsci/bitbucket-plugin/blob/abf2a01527b000b701fc14263420c0eccd28db4b/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L116-L152

          What am I doing wrong? 

          The Bitbucket Team/Project not supports webhooks?  

          only Multibranch Pipeline support it?

          Show
          dordor dor s added a comment - - edited The code here: https://github.com/jenkinsci/bitbucket-plugin/blob/abf2a01527b000b701fc14263420c0eccd28db4b/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L69-L75 is calling to  match() method which is checking if this scm is instance of  GitSCM or  MercurialSCM but it's not. the scm is an instance of  BitbucketSCMSource here : https://github.com/jenkinsci/bitbucket-plugin/blob/abf2a01527b000b701fc14263420c0eccd28db4b/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L116-L152 What am I doing wrong?  The  Bitbucket Team/Project  not supports webhooks?   only Multibranch Pipeline support it?
          Hide
          dordor dor s added a comment -

          Hi Tzach Solomon it will be awesome if you can have a quick look

          Show
          dordor dor s added a comment - Hi Tzach Solomon it will be awesome if you can have a quick look
          Hide
          tzach_solomon Tzach Solomon added a comment -

          dor s as you found out, the error log prints that plugin does not support the BitbucketSCMSource. 

          I can't guarantee a solution soon since I do not have a way to reproduce this.

          If you are able, I suggest you fork the GitHub and submit a PR which I'll merge

           

          Show
          tzach_solomon Tzach Solomon added a comment - dor s  as you found out, the error log prints that plugin does not support the BitbucketSCMSource.  I can't guarantee a solution soon since I do not have a way to reproduce this. If you are able, I suggest you fork the GitHub and submit a PR which I'll merge  
          Hide
          tzach_solomon Tzach Solomon added a comment -
          Show
          tzach_solomon Tzach Solomon added a comment - dor s  maybe https://plugins.jenkins.io/bitbucket-push-and-pull-request/  plugin could help you? 
          Hide
          dordor dor s added a comment - - edited

          Actually I tested the plugin and I got a different isse: https://github.com/jenkinsci/bitbucket-push-and-pull-request-plugin/issues/169

          About of how to reproduce the issue is very easy:

          just install bitbucket plugin & create multi branch pipeline with Bitbucket as a source

          Show
          dordor dor s added a comment - - edited Actually I tested the plugin and I got a different isse: https://github.com/jenkinsci/bitbucket-push-and-pull-request-plugin/issues/169 About of how to reproduce the issue is very easy: just install bitbucket plugin & create  multi branch pipeline with Bitbucket as a source
          Hide
          tzach_solomon Tzach Solomon added a comment -

          dor s BitbucketSCMSource belongs to https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java so I can't really help here.
          I would suggest asking the plugin owner of bitbucket-branch-source-pluging

           

          I'm closing this one.
          If you need please re-open.

          Show
          tzach_solomon Tzach Solomon added a comment - dor s  BitbucketSCMSource belongs to https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java  so I can't really help here. I would suggest asking the plugin owner of bitbucket-branch-source-pluging   I'm closing this one. If you need please re-open.
          Hide
          dordor dor s added a comment - - edited

          Tzach Solomon as you suggested, I'm trying to check the plugin  https://plugins.jenkins.io/bitbucket-push-and-pull-request/  which currently not working for me either.

          But, also the https://plugins.jenkins.io/bitbucket/ plugin isn't working for me as expected .

          I'm just trying to understand if the https://plugins.jenkins.io/bitbucket/ plugin should trigger jobs by webhooks when the branch source is Bitbucket and not git or not?

           

          if yes, it's very easy to reproduce this issue

          just use the following:

          jenkins 2.263.2
          Bitbucket Plugin 1.1.27
          Bitbucket Pipeline for Blue Ocean 1.24.4
          Bitbucket Branch Source Plugin 2.9.7
          

          then create Bitbucket branch source (see pic above) and just trigger webhook

          I can see in the code that BitbucketSCMSource is not supported for webhooks because it supports only GitSCM and MercurialSCM. Is that by design? 

          code :https://github.com/jenkinsci/bitbucket-plugin/blob/abf2a01527b000b701fc14263420c0eccd28db4b/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L116-L152

           

          Note:  when I'm using Git Branch source instead of Bitbucket Branch source  it's working (see pic below) but without other functionally like PRs and Bitbucket post notifications. 

          Show
          dordor dor s added a comment - - edited Tzach Solomon  as you suggested, I'm trying to check the plugin   https://plugins.jenkins.io/bitbucket-push-and-pull-request/   which currently not working for me either. But, also the  https://plugins.jenkins.io/bitbucket/  plugin isn't working for me as expected . I'm just trying to understand if the  https://plugins.jenkins.io/bitbucket/  plugin should trigger jobs by webhooks when the branch source is Bitbucket and not git or not?   if yes, it's very easy to reproduce this issue just use the following: jenkins 2.263.2 Bitbucket Plugin 1.1.27 Bitbucket Pipeline for Blue Ocean 1.24.4 Bitbucket Branch Source Plugin 2.9.7 then create  Bitbucket  branch source (see pic above) and just trigger webhook I can see in the code that  BitbucketSCMSource  is not supported for webhooks because it supports only GitSCM and MercurialSCM . Is that by design?  code : https://github.com/jenkinsci/bitbucket-plugin/blob/abf2a01527b000b701fc14263420c0eccd28db4b/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L116-L152   Note :  when I'm using  Git  Branch source instead of Bitbucket Branch source  it's working (see pic below) but without other functionally like PRs and Bitbucket post notifications. 
          Hide
          tzach_solomon Tzach Solomon added a comment -

          dor s it's by design since bitbucket-plugin does not even have the class BitbucketSCMSource.
          I hope this answer is more clear.

          Show
          tzach_solomon Tzach Solomon added a comment - dor s  it's by design since bitbucket-plugin does not even have the class BitbucketSCMSource. I hope this answer is more clear.

            People

            Assignee:
            tzach_solomon Tzach Solomon
            Reporter:
            dordor dor s
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: