[JIRA] (JENKINS-55000) Missing scope for bitbucket hooks registration

2 views
Skip to first unread message

riccardo.piccoli@softonic.com (JIRA)

unread,
Dec 4, 2018, 4:48:02 AM12/4/18
to jenkinsc...@googlegroups.com
Riccardo Piccoli created an issue
 
Jenkins / Bug JENKINS-55000
Missing scope for bitbucket hooks registration
Issue Type: Bug Bug
Assignee: Unassigned
Components: bitbucket-branch-source-plugin
Created: 2018-12-04 09:47
Environment: Jenkins 2.138.3
org.jenkins-ci.plugins:cloudbees-bitbucket-branch-source:2.2.15
Priority: Major Major
Reporter: Riccardo Piccoli

Recently, this plugin has stopped working and it returns the error:


Dec 04, 2018 9:33:02 AM com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1 doRun
WARNING: Could not register hooks for Softonic Development/catalog-etl
java.io.IOException: I/O error when parsing response from URL: https://api.bitbucket.org/2.0/repositories/softonic-development/catalog-etl/hooks?page=1&pagelen=50
 at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getWebHooks(BitbucketCloudApiClient.java:586)
 at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHooks(WebhookAutoRegisterListener.java:136)
 at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.access$000(WebhookAutoRegisterListener.java:57)
 at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1.doRun(WebhookAutoRegisterListener.java:103)
 at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)
Caused by: com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 403: Forbidden.
{"type": "error", "error": \{"message": "Your credentials lack one or more required privilege scopes.", "detail": {"granted": ["pullrequest", "repository:write"], "required": ["webhook"]}}}
 at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:798)
 at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:810)
 at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getWebHooks(BitbucketCloudApiClient.java:572)
 ... 9 more

 

It seems like something on Bitbucket's side changes. Is there any way we could fix this?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

riccardo.piccoli@softonic.com (JIRA)

unread,
Dec 4, 2018, 9:25:02 AM12/4/18
to jenkinsc...@googlegroups.com
Riccardo Piccoli updated an issue
Change By: Riccardo Piccoli
Recently, this plugin has stopped working and it returns the error:

{code :java }

Dec 04, 2018 9:33:02 AM com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1 doRun
WARNING: Could not register hooks for Softonic Development/catalog-etl
java.io.IOException: I/O error when parsing response from URL: https://api.bitbucket.org/2.0/repositories/softonic-development/catalog-etl/hooks?page=1&pagelen=50
at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getWebHooks(BitbucketCloudApiClient.java:586)
at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHooks(WebhookAutoRegisterListener.java:136)
at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.access$000(WebhookAutoRegisterListener.java:57)
at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1.doRun(WebhookAutoRegisterListener.java:103)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 403: Forbidden.
{"type": "error", "error": \{"message": "Your credentials lack one or more required privilege scopes.", "detail": {"granted": ["pullrequest", "repository:write"], "required": ["webhook"]}}}
at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:798)
at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:810)
at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getWebHooks(BitbucketCloudApiClient.java:572)
... 9 more

{code}

 

It seems like something on Bitbucket's side
changes changed and broke the plugin (at least the part that sets up the webhooks) . Is there any way we could fix this?

nfalco79@hotmail.com (JIRA)

unread,
Sep 26, 2019, 3:06:05 PM9/26/19
to jenkinsc...@googlegroups.com
Nikolas Falco commented on Bug JENKINS-55000
 
Re: Missing scope for bitbucket hooks registration

I got the same issue on update instead in your case seems to be during creation of not existing webhook. Since the response say 403 check that you tecnical user has admin permission on catalog-etl repository. If not tecnically you can not create hook on bitbucket cloud

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages