[JIRA] [bitbucket-plugin] (JENKINS-28877) bitbucket can send webhook without user specified

551 views
Skip to first unread message

kayakyakr@gmail.com (JIRA)

unread,
Jun 11, 2015, 10:08:05 PM6/11/15
to jenkinsc...@googlegroups.com
Charles DuBose created an issue
 
Jenkins / Bug JENKINS-28877
bitbucket can send webhook without user specified
Issue Type: Bug Bug
Assignee: Unassigned
Components: bitbucket-plugin
Created: 12/Jun/15 2:07 AM
Environment: jenkins 1.617, bitbucket-plugin 1.1.0
Labels: plugin
Priority: Blocker Blocker
Reporter: Charles DuBose

Trying to use the bitbucket hook and so far as I can tell, I guess that it is sending a JSON body without specifying a user. I wasn't able to retrieve the JSON that it was sending, but it seems like that field is not a guaranteed field.

Error while serving http://104.236.89.214/bitbucket-hook/
java.lang.reflect.InvocationTargetException
...
Caused by: net.sf.json.JSONException: JSONObject["user"] not found.
at net.sf.json.JSONObject.getString(JSONObject.java:2040)
at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.processPayload(BitbucketHookReceiver.java:104)
at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:59)

The offending line:
String user = payload.getString("user");

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

robin.southgate@gmail.com (JIRA)

unread,
Jun 18, 2015, 9:56:01 PM6/18/15
to jenkinsc...@googlegroups.com
Robin Southgate commented on Bug JENKINS-28877
 
Re: bitbucket can send webhook without user specified

Seems like bitbucket scheme is to now use 'actor'

tony.lopez1013@gmail.com (JIRA)

unread,
Jun 18, 2015, 10:36:05 PM6/18/15
to jenkinsc...@googlegroups.com

Agreed. Bitbucket changed their payload response, per this document.

tony.lopez1013@gmail.com (JIRA)

unread,
Jun 22, 2015, 9:57:01 AM6/22/15
to jenkinsc...@googlegroups.com
Tony Lopez updated an issue
 
Bitbucket Plugin unable to parse Bitbucket webhook response json
Change By: Tony Lopez
Summary: bitbucket can send Bitbucket Plugin unable to parse Bitbucket  webhook  without user specified  response json

lordkada@gmail.com (JIRA)

unread,
Jun 23, 2015, 7:06:01 AM6/23/15
to jenkinsc...@googlegroups.com
Carlo Alberto Degli Atti commented on Bug JENKINS-28877
 
Re: Bitbucket Plugin unable to parse Bitbucket webhook response json

I was playing a little bit around the problem and the bitbucket-plugin sources...

Since also the "repository" section of the payload has changed, it will fail also at row 105

        String url = payload.getString("canon_url") + repo.getString("absolute_url");

kevin.zusy@gmail.com (JIRA)

unread,
Jun 23, 2015, 3:59:01 PM6/23/15
to jenkinsc...@googlegroups.com

Hey all. I ran into the same issue and was able to get it working by making some modifications. Ended up using actor.username instead of user, links.html.href instead of canon_url + absolute_url, and then removed the check for scm since that's no longer included. See https://github.com/jenkinsci/bitbucket-plugin/pull/15 for more details

kevin.zusy@gmail.com (JIRA)

unread,
Jun 23, 2015, 4:13:01 PM6/23/15
to jenkinsc...@googlegroups.com
Kevin Zusy edited a comment on Bug JENKINS-28877
Hey all.  I ran into the same issue and was able to get it working by making some modifications.  Ended up using actor.username instead of user,  repository.  links.html.href instead of canon_url + absolute_url, and then removed the check for scm since that's no longer included.  See https://github.com/jenkinsci/bitbucket-plugin/pull/15 for more details

davytliverpool@hotmail.com (JIRA)

unread,
Jun 25, 2015, 9:12:01 AM6/25/15
to jenkinsc...@googlegroups.com

I am also getting an error 500 from within bitbucket. When I go to the JENKINS_URL/bitbucket-hook/ it gives me the following error:

javax.servlet.ServletException: net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of 
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)

lordkada@gmail.com (JIRA)

unread,
Jun 25, 2015, 10:03:05 AM6/25/15
to jenkinsc...@googlegroups.com

davytliverpool@hotmail.com (JIRA)

unread,
Jun 25, 2015, 12:51:02 PM6/25/15
to jenkinsc...@googlegroups.com

Hi Carlo,

The Jenkins instance isn't under https at this time, would that be the issue?

Thanks

lordkada@gmail.com (JIRA)

unread,
Jun 25, 2015, 1:21:02 PM6/25/15
to jenkinsc...@googlegroups.com

Dave Thomas no, you don't have to be under https... (but if you are, you absolutely need to have a valid certificate signed by a public authority... otherwise you won't receive any payload... )..

christopher.esser@gmail.com (JIRA)

unread,
Jun 25, 2015, 1:55:02 PM6/25/15
to jenkinsc...@googlegroups.com

Dave,
I ran into the same issue. I fixed by making sure there is a '/' on the end of the webhook URL on the Bitbucket side.

scm_issue_link@java.net (JIRA)

unread,
Jun 26, 2015, 3:59:05 AM6/26/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: kzusy
Path:
src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java
http://jenkins-ci.org/commit/bitbucket-plugin/cddb97e71e5a73f0a8f7242f05739dc7a56ce248
Log:
JENKINS-28877

Updated the event payload json reference

scm_issue_link@java.net (JIRA)

unread,
Jun 26, 2015, 3:59:06 AM6/26/15
to jenkinsc...@googlegroups.com

david@kolobit.com (JIRA)

unread,
Jun 26, 2015, 6:09:02 PM6/26/15
to jenkinsc...@googlegroups.com

I am also seeing the same issue described here. However adding a trailing '/' on the webhook in bitbucket did not fix the issue for me.

davytliverpool@hotmail.com (JIRA)

unread,
Jun 30, 2015, 2:59:01 AM6/30/15
to jenkinsc...@googlegroups.com

Hi Christopher,

I did see about the trailing '/' however this had no effect, can you suggest anything else as this is an important part of our build process?

Thanks

davytliverpool@hotmail.com (JIRA)

unread,
Jul 2, 2015, 3:14:01 AM7/2/15
to jenkinsc...@googlegroups.com

Are there any updates on how I could resolve this?

lordkada@gmail.com (JIRA)

unread,
Jul 2, 2015, 3:41:07 AM7/2/15
to jenkinsc...@googlegroups.com

Hi Dave Thomas,
the only thing I can suggest is to debug a little bit what's happening... This is what I did:

  • to see what BitBucket was sending, I deployed a simple web app to show the content of the payload... (for instance I discovered the problem of the https auto-signed certificate...)
  • once I got that payload, I used it to send a POST to a local instance of Jenkins... (so I discovered myself that the expected payload was different than the real one)

Ciao,
CA

uded@java.net (JIRA)

unread,
Jul 2, 2015, 7:08:02 PM7/2/15
to jenkinsc...@googlegroups.com
uded commented on Bug JENKINS-28877

There is a great pull request to solve the issue - maybe someone can revert #15 and merge #17?

https://github.com/jenkinsci/bitbucket-plugin/pull/17

scm_issue_link@java.net (JIRA)

unread,
Jul 8, 2015, 5:36:03 AM7/8/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Tao
Path:
src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java
http://jenkins-ci.org/commit/bitbucket-plugin/dd074ce16701eb200747929c75615dbda29a251e
Log:
Revert "Merge pull request #15 from kzusy/JENKINS-28877"

This reverts the breaking change from #15 in favor of the backwards-
compatible change in #17.

fbelzunc@gmail.com (JIRA)

unread,
Jan 31, 2016, 9:24:02 AM1/31/16
to jenkinsc...@googlegroups.com

kevin.phillips@caris.com (JIRA)

unread,
Mar 17, 2016, 2:59:02 PM3/17/16
to jenkinsc...@googlegroups.com
Kevin Phillips commented on Bug JENKINS-28877
 
Re: Bitbucket Plugin unable to parse Bitbucket webhook response json

I see a pull request was made for this months ago, and the changes appear to have been integrated back in January, but from what I can tell there has been no release of this plugin since the fix was integrated. Given the fact it has been nearly 2 months since the fix has been made, shouldn't there be a new version of the plugin by now?

Unless there is some reason not to, I'd appreciate it if someone could push a new version to the Jenkins plugin server sooner rather than later. Without this fix the plugin simply does not work with any recent version of Bitbucket, making it effectively useless.

fbelzunc@gmail.com (JIRA)

unread,
Mar 18, 2016, 3:36:04 AM3/18/16
to jenkinsc...@googlegroups.com

Kevin Phillips As you can see on the repo bitbucket-1.1.5 was already released this January and it should be exposed on the Update Center - if you have problems you can installed manually from the Advanced tab in Manage Plugins - webhooks should work for this version.

Notice that If you don't see 1.1.5 might because as you can see here https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin it requires at least core 1.580.1 - maybe you are running a lower version.

fbelzunc@gmail.com (JIRA)

unread,
Mar 18, 2016, 3:37:02 AM3/18/16
to jenkinsc...@googlegroups.com

kevin.phillips@caris.com (JIRA)

unread,
Mar 18, 2016, 7:13:02 AM3/18/16
to jenkinsc...@googlegroups.com

I am running 1.596.3 of Jenkins core and have confirmed I have v1.1.5 of this plugin and this problem is still reproducible.

I took another look at the pull request, and I think my earlier assessment may have been incorrect. The last comment on this issue was left on January 31st which lead me to believe the fix hadn't been integrated until that date, which was after v1.1.5 had been released - but that isn't the case.

I will have to take a closer look at my local configuration, but it would appear the fix for this issue is not working as intended. In my case I'm using the latest version of Bitbucket Server (v4.4.1) in case that makes any difference. Perhaps I'm hitting a different problem, however the error message I am current seeing exactly matches the one included in the description above (ie: JSONObject["user"] not found)

fbelzunc@gmail.com (JIRA)

unread,
Mar 18, 2016, 7:40:01 AM3/18/16
to jenkinsc...@googlegroups.com

> I'm using the latest version of Bitbucket Server (v4.4.1) in case that makes any difference.

Ahhh! So you are running an on-premise solution. I don't have a BitBucket server and the test I do are through BitBucket as a Service - so BitBucket on the cloud. I guess that the json they might send could be different. I cannot help you here as I don't have a BitBucket server.

kevin.phillips@caris.com (JIRA)

unread,
Mar 18, 2016, 3:09:02 PM3/18/16
to jenkinsc...@googlegroups.com

Correct. However I believe they use the same application code for the cloud service that they provide for the on-premises version. Even if that is not the case you can actually download a free copy of the on-premises version from Atlassian's website for testing if necessary. It requires a free activation of course, but that's easy enough to get.

I have also confirmed that this is not a configuration problem on my end. I do have the latest version of the plugin. I restarted our Jenkins server just to be sure all of the components and plugins were up to date and installed correctly, and I am still getting this problem. Here is a more complete snippet from my Jenkins logs in case it helps (it looks like it has at least some of the package contents right there in the log):

Mar 18, 2016 1:14:48 PM com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPostServicePayload
INFO: Received commit hook notification for {"slug":"pytools","id":2,"name":"pytools","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"DOT","id":4,"name":"DevOps Tools","description":"Projects related to DevOps team","public":true,"type":"NORMAL"},"public":true}
Mar 18, 2016 1:14:48 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Error while serving http://builds.caris.priv/bitbucket-hook/
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
	at org.kohsuke.stapler.MetaClass$2.dispatch(MetaClass.java:165)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:391)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
	at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:85)
	at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:99)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:95)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.BasicHeaderProcessor.success(BasicHeaderProcessor.java:140)
	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:82)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:168)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:370)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: net.sf.json.JSONException: JSONObject["user"] not found.
	at net.sf.json.JSONObject.getString(JSONObject.java:2040)
	at com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor.processPostServicePayload(BitbucketPayloadProcessor.java:98)
	at com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor.processPayload(BitbucketPayloadProcessor.java:30)
	at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:54)
	... 81 more

christian.markus.eichenberger@sbb.ch (JIRA)

unread,
Mar 18, 2016, 8:42:02 PM3/18/16
to jenkinsc...@googlegroups.com

kevin.phillips@caris.com (JIRA)

unread,
Mar 21, 2016, 9:10:04 AM3/21/16
to jenkinsc...@googlegroups.com

I'm not very familiar with the internal workings of this plugin - is there sufficient information in my last comment to devise a fix for this? We are currently evaluating BitBucket on-premises and would really like see the integration with Jenkins working before finalizing our decision.

If there is any information I could provide to help expedite the fix, just let me know. Also, as I had mentioned previously, anyone is free to download and run the BitBucket on-premises version for evaluation and testing purposes so you should be able to try that if there are specifics you'd like to investigate.

fbelzunc@gmail.com (JIRA)

unread,
Mar 21, 2016, 10:22:01 AM3/21/16
to jenkinsc...@googlegroups.com

kevin.phillips@caris.com (JIRA)

unread,
Mar 21, 2016, 4:01:02 PM3/21/16
to jenkinsc...@googlegroups.com

Based on a quick review of the documentation for that plugin, I believe it may provide some of the functionality we are looking for - although maybe not everything. However, it appears that plugin only works with BitBucket cloud edition. I noticed several references to this within the literature. If you believe this to be incorrect do let me know and I will investigate further.

Also, I did a quick search through the Jenkins update center and I don't see mention of this plugin anywhere. If you believe it would work with on-premises versions of BitBucket I'd also need some info on where to find it and how to build/install it.

christian.markus.eichenberger@sbb.ch (JIRA)

unread,
Mar 25, 2016, 2:42:05 PM3/25/16
to jenkinsc...@googlegroups.com

kevin.phillips@caris.com (JIRA)

unread,
May 9, 2016, 3:23:02 PM5/9/16
to jenkinsc...@googlegroups.com

I finally got some time to build the plugin from source using your proposed changes and it appears to work for us. If we could get those changes integrated into an official release of the plugin sooner rather than later that would be awesome.

joe.maffia@gmail.com (JIRA)

unread,
May 19, 2016, 4:49:03 AM5/19/16
to jenkinsc...@googlegroups.com

Saw this marked as "close" but do we have a final resolution?
Still seeing javax.servlet.ServletException: net.sf.json.JSONException: JSONObject["user"] not found. and I tried to build the plugin from source based on Christian Eichenberger but no luck...

Thanks for any suggestion.

joe.maffia@gmail.com (JIRA)

unread,
May 23, 2016, 8:08:01 AM5/23/16
to jenkinsc...@googlegroups.com

gitawego@gmail.com (JIRA)

unread,
Jul 25, 2016, 5:42:02 AM7/25/16
to jenkinsc...@googlegroups.com

just noticed in [develop branch](https://github.com/jenkinsci/bitbucket-plugin/tree/develop), it's fixed. but why not a new release, at least a hotfix for this issue...

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

frieder.rick@yahoo.de (JIRA)

unread,
Oct 5, 2016, 9:42:04 AM10/5/16
to jenkinsc...@googlegroups.com

I had success with a little change in the version from Christian Eichenberger .
Check: https://github.com/entfrickler/bitbucket-plugin/commit/eebf4b583fd7c1f75a88eb724f8e3f6ee44a3846

I had no luck with the actual develop branch.

I'm running
Bitbucket Server v4.3.2 with latest "Post-Receive WebHooks" Plugin
https://confluence.atlassian.com/bitbucketserver/post-service-webhook-for-bitbucket-server-776640367.html
Jenkins 2.7.4

But would be nice when the Bitbucket Server will be supported by the main plugin in the future. Is there another open ticket for this?

frieder.rick@yahoo.de (JIRA)

unread,
Oct 5, 2016, 9:59:03 AM10/5/16
to jenkinsc...@googlegroups.com
Frieder Rick reopened an issue
 

Bug is still present in Version 1.5.0

Change By: Frieder Rick
Resolution: Fixed
Status: Closed Reopened

bobthemagicman@gmail.com (JIRA)

unread,
Oct 11, 2016, 6:52:02 PM10/11/16
to jenkinsc...@googlegroups.com
Justen Britain updated an issue
Change By: Justen Britain
Environment: jenkins Jenkins 1.617, bitbucket-plugin 1.1.0
Jenkins 2.25, bitbucket-plugin 1.1.5

bobthemagicman@gmail.com (JIRA)

unread,
Oct 11, 2016, 6:59:08 PM10/11/16
to jenkinsc...@googlegroups.com
Justen Britain commented on Bug JENKINS-28877
 
Re: Bitbucket Plugin unable to parse Bitbucket webhook response json

I don't see a 1.5, do you mean 1.1.5? I can confirm the bug replicates in that version as well.

bobthemagicman@gmail.com (JIRA)

unread,
Oct 12, 2016, 4:45:03 PM10/12/16
to jenkinsc...@googlegroups.com
Justen Britain updated an issue
Change By: Justen Britain
Comment:
I don't see a 1.5, do you mean 1.1.5? I can confirm the bug replicates in that version as well.

bobthemagicman@gmail.com (JIRA)

unread,
Oct 12, 2016, 6:03:05 PM10/12/16
to jenkinsc...@googlegroups.com
Justen Britain updated an issue
Change By: Justen Britain
Attachment: bb-server-4.9.1_payload.txt

bobthemagicman@gmail.com (JIRA)

unread,
Oct 12, 2016, 6:39:01 PM10/12/16
to jenkinsc...@googlegroups.com
 
Re: Bitbucket Plugin unable to parse Bitbucket webhook response json

Frieder Rick I have cloned and built the develop branch of this project and tested with our Jenkins installation and the latest version of Bitbucket Server (formerly Stash), version 4.9.1. The problem that you and I are experiencing seems to be because Bitbucket Server is not explicitly supported in this way by this plugin (whether intentional or not). In fact, you will notice that in the code BitbucketHookReceiver.java there is a comment pointing to the Atlassian documentation for the webhooks. The URL provided results in a Page Not Found error with a suggestion to look at the documentation for Webhooks for Bitbucket Cloud (the latest branding for the hosted version of Bitbucket). It seems possible that at one time both "Stash" and the hosted Bitbucket may have been supported by the plugin. There are essentially three code paths available for the incoming payload, none of which are compatible with the payload that is being delivered by Bitbucket Server.

That being said, the requirements to get this to work for Bitbucket Server would require the introduction of an additional code path to detect that the payload is being delivered from Bitbucket Server. The links below are from the "develop" branch and have been in pull request since April 30 with the latest comments on Aug 11. So it is unlikely that we will see a fix to this "bug" in the near future.

I have attached the output from Bitbucket Server (modified to remove company information) and the links to the relevant code below:

Note: Please notice these links point to the develop branch

bb-server-4.9.1_payload.txt

I was only able to dedicate a couple hours to investigating this issue so please forgive any oversights that may have been made.

bobthemagicman@gmail.com (JIRA)

unread,
Oct 12, 2016, 6:41:05 PM10/12/16
to jenkinsc...@googlegroups.com
Justen Britain edited a comment on Bug JENKINS-28877
[~entfrickler] I have cloned and built the develop branch of this project and tested with our Jenkins installation and the latest version of Bitbucket Server (formerly Stash), version 4.9.1. The problem that you and I are experiencing seems to be because Bitbucket Server is not explicitly supported in this way by this plugin (whether intentional or not). In fact, you will notice that in the code [ BitbucketHookReceiver.java |https://github.com/jenkinsci/bitbucket-plugin/blob/develop/src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java#L65] there is a comment pointing to the Atlassian documentation for the webhooks. The URL provided results in a Page Not Found error with a suggestion to look at the documentation for Webhooks for Bitbucket Cloud (the latest branding for the hosted version of Bitbucket). It seems possible that at one time both "Stash" and the hosted Bitbucket may have been supported by the plugin. There are essentially three code paths available for the incoming payload, none of which are compatible with the payload that is being delivered by Bitbucket Server.

That being said, the requirements to get this to work for Bitbucket Server would require the introduction of an additional code path to detect that the payload is being delivered from Bitbucket Server. The links below are from the "develop" branch and have been in [pull request|https://github.com/jenkinsci/bitbucket-plugin/pull/30] since April 30 with the latest comments on Aug 11. So it is unlikely that we will see a fix to this "bug" in the near future.


I have attached the output from Bitbucket Server (modified to remove company information) and the links to the relevant code below:



I was only able to dedicate a couple hours to investigating this issue so please forgive any oversights that may have been made.

matthias.baldi@secanis.ch (JIRA)

unread,
Jan 5, 2017, 5:43:05 AM1/5/17
to jenkinsc...@googlegroups.com

The Problems are still existent in the Jenkins version 2.32.1 and the Bitbucket Plugin version 1.1.5.

But sometimes the webhook works...
Bitbucket gets every time a HTTP 200 response, but I think this is because of the ngnix reverse proxy.
When I send the same request manually (with the same HTTP headers and the same body) I get an 500 error from Jenkins with the same output - described in this issue.

javax.servlet.ServletException: net.sf.json.JSONException: JSONObject["user"] not found.

tomislav.pasalic@javelingroup.com (JIRA)

unread,
Feb 3, 2017, 1:20:02 PM2/3/17
to jenkinsc...@googlegroups.com

I have this issue as well. Using Jenkins 2.44 and bitbucket plugin 1.1.5.
Jenkins receives the payload:

{
	"slug":"XXX",
	"id":94,
	"name":"XXX",
	
"scmId":"git",
	"state":"AVAILABLE",
	"statusMessage":"Available",
	"forkable":true,
	"project"
:{
		"key":"XXX",
		"id":XX,
		"name":"XXX XXX",
		"public":false,
		"type":"NORMAL"
	},
	"public":false
}

And throws the same exception as in description of this ticket with important part being:

Caused by: net.sf.json.JSONException: JSONObject["user"] not found.

Any idea about when this will be fixed or a suggestion of what I may have misconfigured?

tomislav.pasalic@javelingroup.com (JIRA)

unread,
Feb 3, 2017, 1:33:06 PM2/3/17
to jenkinsc...@googlegroups.com
Tomislav Pasalic edited a comment on Bug JENKINS-28877
I have this issue as well. Using Jenkins 2.44 and bitbucket plugin 1.1.5.
Using on=premise Bitbucket server 4.11.1
Jenkins receives the payload:
{code}

{
"slug":"XXX",
"id":94,
"name":"XXX",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
  "key":"XXX",
  "id":XX,
  "name":"XXX XXX",
  "public":false,
  "type":"NORMAL"
},
"public":false
}
{code}


And throws the same exception as in description of this ticket with important part being:
{code}

Caused by: net.sf.json.JSONException: JSONObject["user"] not found.
{code}


Any idea about when this will be fixed or a suggestion of what I may have misconfigured?

tomislav.pasalic@javelingroup.com (JIRA)

unread,
Feb 3, 2017, 1:33:06 PM2/3/17
to jenkinsc...@googlegroups.com
Tomislav Pasalic edited a comment on Bug JENKINS-28877
I have this issue as well. Using Jenkins 2.44 and bitbucket plugin 1.1.5.
Using on = - premise Bitbucket server 4.11.1

mcneary70@gmail.com (JIRA)

unread,
Feb 24, 2017, 1:28:04 PM2/24/17
to jenkinsc...@googlegroups.com

First time trying to get this setup working today and am meeting the same issues described above. We are using Jenkins v2.32.2, BitBucket Plugin v1.1.15, and BitBucket Server v4.11.1.

mcneary70@gmail.com (JIRA)

unread,
Feb 27, 2017, 2:20:04 PM2/27/17
to jenkinsc...@googlegroups.com

I checked out the develop branch today in an attempt to get this working for my project. First thing I noticed is that the BitBucket payload structure seems to have changed a lot from what the code is expecting to parse. I was able to get it to run without the exception, but still would not trigger my Jenkins pipeline job.

frieder.rick@yahoo.de (JIRA)

unread,
Feb 28, 2017, 12:18:09 PM2/28/17
to jenkinsc...@googlegroups.com

frieder.rick@yahoo.de (JIRA)

unread,
Feb 28, 2017, 12:20:04 PM2/28/17
to jenkinsc...@googlegroups.com
Frieder Rick commented on Bug JENKINS-28877
 
Re: Bitbucket Plugin unable to parse Bitbucket webhook response json

Mike Neary you can use my fork from an older Version which is running fine with

Bitbucket Server v4.3.2 with latest "Post-Receive WebHooks" Plugin and Jenkins 2.32.2

https://github.com/entfrickler/bitbucket-plugin/tree/bb-server

This is my snapshot build I'm using right now: bitbucket.hpi

mcneary70@gmail.com (JIRA)

unread,
Feb 28, 2017, 2:01:09 PM2/28/17
to jenkinsc...@googlegroups.com

Frieder Bluemle thanks for that. I had already made several of the changes you have in your branch and was in the process of fixing the matching issue when you replied. I was able to get a freestyle Jenkins job to work using your fork, however I am still unable to trigger a pipelined job, which others also appear to be experiencing: https://issues.jenkins-ci.org/browse/JENKINS-38447

Thanks again!

mcneary70@gmail.com (JIRA)

unread,
Feb 28, 2017, 2:02:03 PM2/28/17
to jenkinsc...@googlegroups.com
Mike Neary edited a comment on Bug JENKINS-28877
[~ friederbluemle entfrickler ] thanks for that.  I had already made several of the changes you have in your branch and was in the process of fixing the matching issue when you replied.  I was able to get a freestyle Jenkins job to work using your fork, however I am still unable to trigger a pipelined job, which others also appear to be experiencing: https://issues.jenkins-ci.org/browse/JENKINS-38447

Thanks again!

dntsaygoodbye@gmail.com (JIRA)

unread,
Feb 12, 2018, 10:48:04 AM2/12/18
to jenkinsc...@googlegroups.com

The same problem 


net.sf.json.JSONException: JSONObject["user"] not found.

Jenkins ver. 2.60.3

Bitbucket Plugin 1.1.8

 

 

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

dntsaygoodbye@gmail.com (JIRA)

unread,
Feb 12, 2018, 3:07:04 PM2/12/18
to jenkinsc...@googlegroups.com
Alaiksei Savanchuk updated an issue
 
Change By: Alaiksei Savanchuk
Comment:
The same problem 
net.sf.json.JSONException: JSONObject["user"] not found.
Jenkins ver. 2.60.3

Bitbucket Plugin 1.1.8

 

 

frieder.rick@yahoo.de (JIRA)

unread,
Feb 15, 2018, 8:13:02 AM2/15/18
to jenkinsc...@googlegroups.com

imessvb@gmail.com (JIRA)

unread,
Mar 6, 2018, 10:13:03 PM3/6/18
to jenkinsc...@googlegroups.com
K C commented on Bug JENKINS-28877

We are using Bitbucket Server, Jenkins, and Bitbucket Plugin 1.1.8.

On Bitbucket, we set up Post Webhook (with ending slash in URL), and checked "Pull request created" event.

On Jenkins, project config, we set the Git clone url, and checked "Build when a change is pushed to BitBucket" and "Poll SCM".

When creating a new Poll Request on Bitbucket, from the com.cloudbees.jenkins.plugins logger on Jenkins, we see JSON data logged by com.cloudbees.jenkins.plugins.BitbucketHookReceiver, but the corresponding Jenkins project is not triggered. Occasionally, we see success messages from com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator, but we don't see any other logs.

Any idea why? Thank you.

frieder.rick@yahoo.de (JIRA)

unread,
Mar 7, 2018, 6:23:06 AM3/7/18
to jenkinsc...@googlegroups.com

Did you check "Repository events: On push"? In my case this is the only checked option and the build is also triggered when I merge a pull request on the Bitbucket webclient.

imessvb@gmail.com (JIRA)

unread,
Mar 7, 2018, 6:10:03 PM3/7/18
to jenkinsc...@googlegroups.com
K C commented on Bug JENKINS-28877

I just added the On Push event, then merged a pull request. While I saw more logs on Jenkins, it failed to match the git url:

https://<bitbucket-server>/~<username>/<reponame>.git<-->https://<bitbucket-server>/users/<username>/repos/<reponame>/browse

 

But what we are trying to do is trigger a build on Jenkins when someone creates, not merges, a pull request on Bitbucket.

Is this use case supported? Can it be supported?

Thank you

francisco.rodriguez@tomtom.com (JIRA)

unread,
Oct 8, 2018, 11:13:05 AM10/8/18
to jenkinsc...@googlegroups.com

K C, I have the same problem with "Approved" pull request event option.

As far as I can see here is where Jenkins Bitbucket Plugin fails:

https://github.com/jenkinsci/bitbucket-plugin/blob/ce068b7f2cbf5250aa6d54c3acdd455d45b56246/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java#L24

I have captured the request and repeated here as a curl:

curl -X POST \
  http://ttbsbld102.dev.ttw:8080/bitbucket-hook/ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Postman-Token: 3d72a314-48e1-45ff-832a-950d43a7435d' \
  -H 'X-Event-Key: pr:reviewer:approved' \
  -H 'X-Request-Id: 0d6f5c89-f29b-4c8a-9fc4-a6fd1846bafb' \
  -d '{"eventKey":"pr:reviewer:approved","date":"2018-10-08T14:29:51+0200","actor":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"pullRequest":{"id":2,"version":5,"title":"test edited online with Bitbucket","description":"abaöldflj","state":"OPEN","open":true,"closed":false,"createdDate":1538055333000,"updatedDate":1538999909000,"fromRef":{"id":"refs/heads/feature/checkitagain","displayId":"feature/checkitagain","latestCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","repository":{"slug":"bitbucket-test","id":1960,"name":"bitbucket-test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"DVSPRT","id":346,"name":"Development Support","description":"Everything related to development support, build system, development infrastructure. See https://confluence.tomtomgroup.com/x/bpB_K and https://tttjira.ttg.global:8441/browse/DVSPRT","public":false,"type":"NORMAL"},"public":false}},"toRef":{"id":"refs/heads/master","displayId":"master","latestCommit":"ad359c8a9ba1eaf0bd2adec3aa37492c63966afb","repository":{"slug":"bitbucket-test","id":1960,"name":"bitbucket-test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"DVSPRT","id":346,"name":"Development Support","description":"Everything related to development support, build system, development infrastructure. See https://confluence.tomtomgroup.com/x/bpB_K and https://tttjira.ttg.global:8441/browse/DVSPRT","public":false,"type":"NORMAL"},"public":false}},"locked":false,"author":{"user":{"name":"otherUserReplaced","emailAddress":"otherUserReplaced","id":11708,"displayName":"otherUserReplaced","active":true,"slug":"otherUserReplaced","type":"NORMAL"},"role":"AUTHOR","approved":false,"status":"UNAPPROVED"},"reviewers":[{"user":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"lastReviewedCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","role":"REVIEWER","approved":true,"status":"APPROVED"}],"participants":[]},"participant":{"user":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"lastReviewedCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","role":"REVIEWER","approved":true,"status":"APPROVED"},"previousStatus":"UNAPPROVED"}'

And has the same response that Bitbucket receive:

net.sf.json.JSONException: JSONObject["user"] not found.
	at net.sf.json.JSONObject.getString(JSONObject.java:2040)
	at com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor.processPostServicePayload(BitbucketPayloadProcessor.java:128)
	at com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor.processPayload(BitbucketPayloadProcessor.java:37)
	at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:54)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
	at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:26)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864)
	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:243)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
	at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
	at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:114)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:92)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.plugins.locale.LocaleFilter.doFilter(LocaleFilter.java:42)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:64)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused: javax.servlet.ServletException
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:784)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864)
	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:243)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
	at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
	at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:114)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:92)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.plugins.locale.LocaleFilter.doFilter(LocaleFilter.java:42)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:64)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

So I have created another ticket in order to know if it can be solved.

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

francisco.rodriguez@tomtom.com (JIRA)

unread,
Oct 8, 2018, 11:26:05 AM10/8/18
to jenkinsc...@googlegroups.com
[~kcuser], I have the same problem with "Approved" pull request event option.


As far as I can see here is where Jenkins Bitbucket Plugin fails:

[https://github.com/jenkinsci/bitbucket-plugin/blob/ce068b7f2cbf5250aa6d54c3acdd455d45b56246/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java#L24]

I have captured the request and repeated here as a curl:


{code}

curl -X POST \
  http://ttbsbld102.dev.ttw:8080/bitbucket-hook/ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Postman-Token: 3d72a314-48e1-45ff-832a-950d43a7435d' \
  -H 'X-Event-Key: pr:reviewer:approved' \
  -H 'X-Request-Id: 0d6f5c89-f29b-4c8a-9fc4-a6fd1846bafb' \
  -d '{"eventKey":"pr:reviewer:approved","date":"2018-10-08T14:29:51+0200","actor":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"pullRequest":{"id":2,"version":5,"title":"test edited online with Bitbucket","description":"abaöldflj","state":"OPEN","open":true,"closed":false,"createdDate":1538055333000,"updatedDate":1538999909000,"fromRef":{"id":"refs/heads/feature/checkitagain","displayId":"feature/checkitagain","latestCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","repository":{"slug":"bitbucket-test","id":1960,"name":"bitbucket-test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"DVSPRT","id":346,"name":"Development Support","description":"Everything related to development support, build system, development infrastructure. See https://confluence.tomtomgroup.com/x/bpB_K and https://tttjira.ttg.global:8441/browse/DVSPRT","public":false,"type":"NORMAL"},"public":false}},"toRef":{"id":"refs/heads/master","displayId":"master","latestCommit":"ad359c8a9ba1eaf0bd2adec3aa37492c63966afb","repository":{"slug":"bitbucket-test","id":1960,"name":"bitbucket-test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"DVSPRT","id":346,"name":"Development Support","description":"Everything related to development support, build system, development infrastructure. See https://confluence.tomtomgroup.com/x/bpB_K and https://tttjira.ttg.global:8441/browse/DVSPRT","public":false,"type":"NORMAL"},"public":false}},"locked":false,"author":{"user":{"name":"otherUserReplaced","emailAddress":"otherUserReplaced","id":11708,"displayName":"otherUserReplaced","active":true,"slug":"otherUserReplaced","type":"NORMAL"},"role":"AUTHOR","approved":false,"status":"UNAPPROVED"},"reviewers":[{"user":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"lastReviewedCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","role":"REVIEWER","approved":true,"status":"APPROVED"}],"participants":[]},"participant":{"user":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"lastReviewedCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","role":"REVIEWER","approved":true,"status":"APPROVED"},"previousStatus":"UNAPPROVED"}'
{code}


And has the same response that Bitbucket receive:


{code:java}
{code}


So I have created another ticket in order to know if it can be solved.

Edit: JENKINS-53946, here is the issue.

francisco.rodriguez@tomtom.com (JIRA)

unread,
Oct 8, 2018, 11:27:07 AM10/8/18
to jenkinsc...@googlegroups.com
[~kcuser], I have the same problem with "Approved" pull request event option.

As far as I can see here is where Jenkins Bitbucket Plugin fails:

[https://github.com/jenkinsci/bitbucket-plugin/blob/ce068b7f2cbf5250aa6d54c3acdd455d45b56246/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java#L24]

I have captured the request and repeated here as a curl:


{code}
curl -X POST \
  http:// ttbsbld102.dev.ttw:8080 URL /bitbucket-hook/ \

francisco.rodriguez@tomtom.com (JIRA)

unread,
Oct 8, 2018, 11:29:27 AM10/8/18
to jenkinsc...@googlegroups.com
[~kcuser], I have the same problem with "Approved" pull request event option.

As far as I can see here is where Jenkins Bitbucket Plugin fails:

[https://github.com/jenkinsci/bitbucket-plugin/blob/ce068b7f2cbf5250aa6d54c3acdd455d45b56246/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java#L24]

I have captured the request and repeated here as a curl:


{code}
curl -X POST \
Everything related to development support, build system, development infrastructure. See https://confluence.tomtomgroup.com/x/bpB_K and https://tttjira.ttg.global:8441/browse/DVSPRT ","public":false,"type":"NORMAL"},"public":false}},"toRef":{"id":"refs/heads/master","displayId":"master","latestCommit":"ad359c8a9ba1eaf0bd2adec3aa37492c63966afb","repository":{"slug":"bitbucket-test","id":1960,"name":"bitbucket-test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"DVSPRT","id":346,"name":"Development Support","description":" Everything related to development support, build system, development infrastructure. See https://confluence.tomtomgroup.com/x/bpB_K and https://tttjira.ttg.global:8441/browse/DVSPRT ","public":false,"type":"NORMAL"},"public":false}},"locked":false,"author":{"user":{"name":"otherUserReplaced","emailAddress":"otherUserReplaced","id":11708,"displayName":"otherUserReplaced","active":true,"slug":"otherUserReplaced","type":"NORMAL"},"role":"AUTHOR","approved":false,"status":"UNAPPROVED"},"reviewers":[{"user":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"lastReviewedCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","role":"REVIEWER","approved":true,"status":"APPROVED"}],"participants":[]},"participant":{"user":{"name":"authorUserReplaced","emailAddress":"authorReplaced","id":13761,"displayName":"authorReplaced","active":true,"slug":"authorUserReplaced","type":"NORMAL"},"lastReviewedCommit":"d5b55683288bc89c23609f3087a02b6daf7eef06","role":"REVIEWER","approved":true,"status":"APPROVED"},"previousStatus":"UNAPPROVED"}'
Reply all
Reply to author
Forward
0 new messages