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

Bitbucket Plugin unable to parse Bitbucket webhook response json

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: bitbucket-plugin
    • Labels:
    • Environment:
      Jenkins 1.617, bitbucket-plugin 1.1.0
      Jenkins 2.25, bitbucket-plugin 1.1.5
    • Similar Issues:

      Description

      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");

        Attachments

          Activity

          kayakyakr Charles DuBose created issue -
          Hide
          rsouthgate Robin Southgate added a comment -

          Seems like bitbucket scheme is to now use 'actor'

          Show
          rsouthgate Robin Southgate added a comment - Seems like bitbucket scheme is to now use 'actor'
          Hide
          tonylopez1013 Tony Lopez added a comment -

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

          Show
          tonylopez1013 Tony Lopez added a comment - Agreed. Bitbucket changed their payload response, per this document .
          tonylopez1013 Tony Lopez made changes -
          Field Original Value New Value
          Summary bitbucket can send webhook without user specified Bitbucket Plugin unable to parse Bitbucket webhook response json
          Hide
          lordkada Carlo Alberto Degli Atti added a comment -

          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");
          
          Show
          lordkada Carlo Alberto Degli Atti added a comment - 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" );
          Hide
          kzusy Kevin Zusy added a comment - - edited

          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

          Show
          kzusy Kevin Zusy added a comment - - edited 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
          Hide
          anix Dave Thomas added a comment -

          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)
          
          Show
          anix Dave Thomas added a comment - 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)
          Hide
          lordkada Carlo Alberto Degli Atti added a comment -

          Hey Dave,
          is your Jenkins under https?

          Show
          lordkada Carlo Alberto Degli Atti added a comment - Hey Dave, is your Jenkins under https?
          Hide
          anix Dave Thomas added a comment -

          Hi Carlo,

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

          Thanks

          Show
          anix Dave Thomas added a comment - Hi Carlo, The Jenkins instance isn't under https at this time, would that be the issue? Thanks
          Hide
          lordkada Carlo Alberto Degli Atti added a comment -

          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... )..

          Show
          lordkada Carlo Alberto Degli Atti added a comment - 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... )..
          Hide
          esserc Christopher Esser added a comment -

          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.

          Show
          esserc Christopher Esser added a comment - 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.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          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

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - 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
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

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

          JENKINS-28877

          Compare: https://github.com/jenkinsci/bitbucket-plugin/compare/3f54f85234e1...4eaeec7714bb

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: fbelzunc Path: src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java http://jenkins-ci.org/commit/bitbucket-plugin/4eaeec7714bbb7411fd7a0cf650911f3551da27a Log: Merge pull request #15 from kzusy/ JENKINS-28877 JENKINS-28877 Compare: https://github.com/jenkinsci/bitbucket-plugin/compare/3f54f85234e1...4eaeec7714bb
          Hide
          dkatz David Katz added a comment -

          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.

          Show
          dkatz David Katz added a comment - 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.
          Hide
          anix Dave Thomas added a comment -

          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

          Show
          anix Dave Thomas added a comment - 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
          Hide
          anix Dave Thomas added a comment -

          Are there any updates on how I could resolve this?

          Show
          anix Dave Thomas added a comment - Are there any updates on how I could resolve this?
          Hide
          lordkada Carlo Alberto Degli Atti added a comment -

          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

          Show
          lordkada Carlo Alberto Degli Atti added a comment - 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
          Hide
          uded uded added a comment -

          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

          Show
          uded uded added a comment - 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
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          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.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - 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.
          Show
          fbelzunc Félix Belzunce Arcos added a comment - Fixed by https://github.com/jenkinsci/bitbucket-plugin/commit/995031fb59c69c14dca87b03e824431456d5fdf3
          fbelzunc Félix Belzunce Arcos made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Hide
          leedega Kevin Phillips added a comment -

          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.

          Show
          leedega Kevin Phillips added a comment - 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.
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          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.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - 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.
          Show
          fbelzunc Félix Belzunce Arcos added a comment - https://updates.jenkins-ci.org/download/plugins/bitbucket/
          Hide
          leedega Kevin Phillips added a comment -

          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)

          Show
          leedega Kevin Phillips added a comment - 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)
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          > 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.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - > 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.
          Hide
          leedega Kevin Phillips added a comment -

          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
          
          Show
          leedega Kevin Phillips added a comment - 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
          Show
          eichench Christian Eichenberger added a comment - Payload seems indeed different: compare [1] and [2] [1] https://github.com/jenkinsci/bitbucket-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java [2] https://confluence.atlassian.com/bitbucketserver/post-service-webhook-for-bitbucket-server-776640367.html
          Hide
          leedega Kevin Phillips added a comment -

          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.

          Show
          leedega Kevin Phillips added a comment - 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.
          Show
          fbelzunc Félix Belzunce Arcos added a comment - Kevin Phillips This plugin was Open Sourced by my employer some days ago. https://release-notes.cloudbees.com/product/CloudBees+Bitbucket+Branch+Source+Plugin https://documentation.cloudbees.com/docs/cje-user-guide/bitbucket.html Is it not what you are looking for?
          Hide
          leedega Kevin Phillips added a comment -

          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.

          Show
          leedega Kevin Phillips added a comment - 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.
          Hide
          eichench Christian Eichenberger added a comment -

          I've started support for Bitbucket Server (on-premises version): [1]
          Current status [2] is tested on a sample project but not more than that. Any feedback and contributions welcome!

          [1] https://github.com/jenkinsci/bitbucket-plugin/compare/master...SchweizerischeBundesbahnen:support-for-bitbucketserver?expand=1
          [2] https://github.com/SchweizerischeBundesbahnen/bitbucket-plugin/commit/9ab04242bad1682d18729c71ecf3eb125bdacda5

          Show
          eichench Christian Eichenberger added a comment - I've started support for Bitbucket Server (on-premises version): [1] Current status [2] is tested on a sample project but not more than that. Any feedback and contributions welcome! [1] https://github.com/jenkinsci/bitbucket-plugin/compare/master...SchweizerischeBundesbahnen:support-for-bitbucketserver?expand=1 [2] https://github.com/SchweizerischeBundesbahnen/bitbucket-plugin/commit/9ab04242bad1682d18729c71ecf3eb125bdacda5
          Hide
          leedega Kevin Phillips added a comment -

          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.

          Show
          leedega Kevin Phillips added a comment - 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.
          Hide
          joemaffia Joe Maffia added a comment -

          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.

          Show
          joemaffia Joe Maffia added a comment - 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.
          Hide
          joemaffia Joe Maffia added a comment -

          Félix Belzunce Arcos any help on this? saw you close the tkt.

          Thanks

          Show
          joemaffia Joe Maffia added a comment - Félix Belzunce Arcos any help on this? saw you close the tkt. Thanks
          Hide
          gitawego hongbo lu added a comment -

          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...

          Show
          gitawego hongbo lu added a comment - 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...
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 163741 ] JNJira + In-Review [ 208877 ]
          Hide
          entfrickler Frieder Rick added a comment -

          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?

          Show
          entfrickler Frieder Rick added a comment - 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?
          Hide
          entfrickler Frieder Rick added a comment -

          Bug is still present in Version 1.5.0

          Show
          entfrickler Frieder Rick added a comment - Bug is still present in Version 1.5.0
          entfrickler Frieder Rick made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          bobthemagicman Justen Britain made changes -
          Environment jenkins 1.617, bitbucket-plugin 1.1.0 Jenkins 1.617, bitbucket-plugin 1.1.0
          Jenkins 2.25, bitbucket-plugin 1.1.5
          bobthemagicman Justen Britain made changes -
          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 Justen Britain made changes -
          Attachment bb-server-4.9.1_payload.txt [ 34349 ]
          Hide
          bobthemagicman Justen Britain added a comment - - edited

          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.

          Show
          bobthemagicman Justen Britain added a comment - - edited 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 https://github.com/jenkinsci/bitbucket-plugin/blob/develop/src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java#L81 https://github.com/jenkinsci/bitbucket-plugin/blob/develop/src/main/java/com/cloudbees/jenkins/plugins/payload/BitbucketPayload.java#L51 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.
          Hide
          matthiasb Matthias Baldi added a comment -

          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.

          Show
          matthiasb Matthias Baldi added a comment - 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.
          Hide
          tomislav_pasalic Tomislav Pasalic added a comment - - edited

          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:

          {
          	"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?

          Show
          tomislav_pasalic Tomislav Pasalic added a comment - - edited 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: { "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?
          Hide
          racermike Mike Neary added a comment -

          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.

          Show
          racermike Mike Neary added a comment - 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.
          Hide
          racermike Mike Neary added a comment -

          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.

          Show
          racermike Mike Neary added a comment - 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.
          entfrickler Frieder Rick made changes -
          Attachment bitbucket.hpi [ 36186 ]
          Hide
          entfrickler Frieder Rick added a comment -

          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

          Show
          entfrickler Frieder Rick added a comment - 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
          Hide
          racermike Mike Neary added a comment - - edited

          Frieder Rick 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!

          Show
          racermike Mike Neary added a comment - - edited Frieder Rick 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!
          Hide
          ericselkpc Eric Selk added a comment -

          Any recommendations for fixing this issue for those that do not know how to install a Jenkins plugin from source code, or any plugin that is not listed in the available plugins list from the Jenkins UI?  Does the author plan on updating the official plugin to support the new payload format?

           

          I'm new here, and to Jenkins, so please go easy on me

          Show
          ericselkpc Eric Selk added a comment - Any recommendations for fixing this issue for those that do not know how to install a Jenkins plugin from source code, or any plugin that is not listed in the available plugins list from the Jenkins UI?  Does the author plan on updating the official plugin to support the new payload format?   I'm new here, and to Jenkins, so please go easy on me
          hjen Jennifer Hofmeister made changes -
          Assignee Jennifer Hofmeister [ hjen ]
          hjen Jennifer Hofmeister made changes -
          Assignee Jennifer Hofmeister [ hjen ]
          Hide
          hjen Jennifer Hofmeister added a comment -

          Ugh, so sorry - I accidentally clicked on the "assign to me" link, and now I had to unassign it and didn't know whose name was there before. I'd hate to see this issue lose the little momentum it had...

          Show
          hjen Jennifer Hofmeister added a comment - Ugh, so sorry - I accidentally clicked on the "assign to me" link, and now I had to unassign it and didn't know whose name was there before. I'd hate to see this issue lose the little momentum it had...
          Hide
          ericselkpc Eric Selk added a comment -

          Jennifer Hofmeister according to the history tab it was not assigned to anyone when you changed it to yourself, so no worries.

          Show
          ericselkpc Eric Selk added a comment - Jennifer Hofmeister according to the history tab it was not assigned to anyone when you changed it to yourself, so no worries.
          Hide
          ericselkpc Eric Selk added a comment -

          In case it helps others with this error.  In my case the issue was a proxy server not forwarding the HTTP headers.  The plugin code looks for 2 HTTP headers that the new version of Bitbucket sends.  If the headers are present, the plugin should not look for payload.user, because it should correctly parse the new format.  If the headers are missing, the plugin assumes the old format, and will fail to parse the new format.

           

          code here: https://github.com/jenkinsci/bitbucket-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java

           

          Inside processPayload.  It looks for user-agent and x-event-key.

          Show
          ericselkpc Eric Selk added a comment - In case it helps others with this error.  In my case the issue was a proxy server not forwarding the HTTP headers.  The plugin code looks for 2 HTTP headers that the new version of Bitbucket sends.  If the headers are present, the plugin should not look for payload.user, because it should correctly parse the new format.  If the headers are missing, the plugin assumes the old format, and will fail to parse the new format.   code here: https://github.com/jenkinsci/bitbucket-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java   Inside processPayload.  It looks for user-agent and x-event-key.
          Hide
          agravelray Alexandre G.Raymond added a comment -

          As per Eric Selk comment, I checked the value sent by Bitbucket Server 5.5.0 (last stable version at the time of this comment) and it seems it sends "Atlassian HttpClient 0.23.5 / Bitbucket-5.5.0 (5005000) / Default" as the User Agent, so it cannot be parsed as a "new-style" webhook because of this line : https://github.com/jenkinsci/bitbucket-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java#L23

          Moreover, it sends a X-Event-Key value of "repo:refs_changed", while the plugin expects "repo:push". The value I see is indeed what is documented on Bitbucket's documentation : https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html

          Show
          agravelray Alexandre G.Raymond added a comment - As per Eric Selk comment, I checked the value sent by Bitbucket Server 5.5.0 (last stable version at the time of this comment) and it seems it sends "Atlassian HttpClient 0.23.5 / Bitbucket-5.5.0 (5005000) / Default" as the User Agent, so it cannot be parsed as a "new-style" webhook because of this line : https://github.com/jenkinsci/bitbucket-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java#L23 Moreover, it sends a X-Event-Key value of "repo:refs_changed", while the plugin expects "repo:push". The value I see is indeed what is documented on Bitbucket's documentation : https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          Notice that this plugin ONLY works for Bitbucket CLOUD - it does not work for Bitbucket Server. People using Bitbucket server should be using the Bitbucket-multibranch plugin.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - Notice that this plugin ONLY works for Bitbucket CLOUD - it does not work for Bitbucket Server. People using Bitbucket server should be using the Bitbucket-multibranch plugin.
          Hide
          allan_burdajewicz Allan BURDAJEWICZ added a comment -

          Alexandre G.Raymond Noticed that this is a new webhook feature since Bitbucket Server 5.4.0 https://confluence.atlassian.com/bitbucketserver054/managing-webhooks-in-bitbucket-server-939508605.html. As far as I know, the Bitbucket plugin has support to integrate with an add-on also documented here

          Show
          allan_burdajewicz Allan BURDAJEWICZ added a comment - Alexandre G.Raymond Noticed that this is a new webhook feature since Bitbucket Server 5.4.0 https://confluence.atlassian.com/bitbucketserver054/managing-webhooks-in-bitbucket-server-939508605.html . As far as I know, the Bitbucket plugin has support to integrate with an add-on also documented here
          Hide
          joel_scha Joël Schaerer added a comment -

          Similar issue here:

          <a href="https://jenkins.io/redirect/users-mailing-list">The users list</a> might be also useful in understanding what has happened.</p><h2>Stack trace</h2><pre style="margin:2em; clear:both">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) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)

          It looks like the payload format has changed since the laste Bitbucket server upgrade, because there is no "user" in the payload.

          Félix Belzunce Arcos why do you say only BB cloud is supported? It doesn't say so on the plugin page, and I've been using it successfully with server for years now.

          Show
          joel_scha Joël Schaerer added a comment - Similar issue here: <a href= "https: //jenkins.io/redirect/users-mailing-list" >The users list</a> might be also useful in understanding what has happened.</p><h2>Stack trace</h2><pre style= "margin:2em; clear:both" >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) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) It looks like the payload format has changed since the laste Bitbucket server upgrade, because there is no "user" in the payload. Félix Belzunce Arcos why do you say only BB cloud is supported? It doesn't say so on the plugin page, and I've been using it successfully with server for years now.
          Hide
          ashisharma888 Ashish Sharma added a comment -

          Hi All, I am facing same issue net.sf.json.JSONException: JSONObject["user"] not found

          Bitbucket Server v5.4.1

          jenkins 2.19

          Bitbucket plugin 1.1.6

          Frieder Rick, Will hpi shared by you work here, if we offline install into jenkins?

          Please if anyone has any inputs, share the same. I am not too sure about how to go about changing source code of plugin or how to take code from github directly? There is such a long thread of comments, if someone can point out to comments/links which still work, would highly appreciate the same.

          Show
          ashisharma888 Ashish Sharma added a comment - Hi All, I am facing same issue net.sf.json.JSONException: JSONObject ["user"]  not found Bitbucket Server v5.4.1 jenkins 2.19 Bitbucket plugin 1.1.6 Frieder Rick , Will hpi shared by you work here, if we offline install into jenkins? Please if anyone has any inputs, share the same. I am not too sure about how to go about changing source code of plugin or how to take code from github directly? There is such a long thread of comments, if someone can point out to comments/links which still work, would highly appreciate the same.
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          > why do you say only BB cloud is supported? It doesn't say so on the plugin page, and I've been using it successfully with server for years now.

          Joël Schaerer Maybe it worked for some versions, but it was never tested against Bitbucket on-premise solution. You should be using bitbucket multibranch job type. I have been maintaining this plugin a bit and I know the previous maintainer and I can tell you this plugin was not developed to work under Bitbucket server.

          I added a note in the plugin saying:

          This plugin has not been intended to work against Bitbucket server. For Bitbucket server, please, use Bitbucket multibranch jobs.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - > why do you say only BB cloud is supported? It doesn't say so on the plugin page, and I've been using it successfully with server for years now. Joël Schaerer Maybe it worked for some versions, but it was never tested against Bitbucket on-premise solution. You should be using bitbucket multibranch job type. I have been maintaining this plugin a bit and I know the previous maintainer and I can tell you this plugin was not developed to work under Bitbucket server. I added a note in the plugin saying: This plugin has not been intended to work against Bitbucket server. For Bitbucket server, please, use Bitbucket multibranch jobs.
          Hide
          joel_scha Joël Schaerer added a comment -
          Show
          joel_scha Joël Schaerer added a comment - Thanks Félix Belzunce Arcos
          Hide
          ashisharma888 Ashish Sharma added a comment -

          Félix Belzunce Arcos From your reply it seems i will also have to use bitbucket multibranch job type using plugin provided by cloudbees  as mentioned here https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-BitBucket-Server-

          I just wanted to check if you have any working experience with this? Will it work for freestyle project as well as we are not using pipeline, and on a regular push to Bitbucket branch (not through pull request)

          Thanks.

          Show
          ashisharma888 Ashish Sharma added a comment - Félix Belzunce Arcos From your reply it seems i will also have to use bitbucket multibranch job type using plugin provided by cloudbees  as mentioned here https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-BitBucket-Server- I just wanted to check if you have any working experience with this? Will it work for freestyle project as well as we are not using pipeline, and on a regular push to Bitbucket branch (not through pull request) Thanks.
          baizar Alvaro Arbaizar made changes -
          Attachment error.html [ 40476 ]
          Hide
          baizar Alvaro Arbaizar added a comment -

          Hi guys,

           

          We are having the same problem trying to configure webhooks from Bitbucket. The versions that we are using:

          Bitbucket Plugin 1.1.6
          Jenkins ver. 2.73.3
          Atlassian Bitbucket v5.5.0

           

          We have attached the error file, it can be helpful to search a solution.

          error.html

           

          This issue, is a blocker for us to continue using Jenkins as deployment tool.

          Regards

          Show
          baizar Alvaro Arbaizar added a comment - Hi guys,   We are having the same problem trying to configure webhooks from Bitbucket. The versions that we are using: Bitbucket Plugin 1.1.6 Jenkins ver. 2.73.3 Atlassian Bitbucket v5.5.0   We have attached the error file, it can be helpful to search a solution. error.html   This issue, is a blocker for us to continue using Jenkins as deployment tool. Regards
          Hide
          heatzone87 Pim Jansen added a comment -

          According to the Bitbucket webhook API the user tag should be there so it seems they changed their API since the field is now called `actor`.

          https://developer.atlassian.com/bitbucket/api/2/reference/resource/hook_events

          Show
          heatzone87 Pim Jansen added a comment - According to the Bitbucket webhook API the user tag should be there so it seems they changed their API since the field is now called `actor`. https://developer.atlassian.com/bitbucket/api/2/reference/resource/hook_events
          fbelzunc Félix Belzunce Arcos made changes -
          Assignee Félix Belzunce Arcos [ fbelzunc ]
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          I will review this on Monday and if it is as easy as it seems to be, I will fix it.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - I will review this on Monday and if it is as easy as it seems to be, I will fix it.
          fbelzunc Félix Belzunce Arcos made changes -
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          I just did https://github.com/jenkinsci/bitbucket-plugin/pull/53, which generates the SNAPSHOT below.

          Can someone try to install this on a real environment under Manage Jenkins -> Manage Plugins [Advanced tab] -> Upload plugin?

          Please, ensure that this plugin is enabled in BitBucket side. Once you confirm this is fine, I will release and merge.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - I just did https://github.com/jenkinsci/bitbucket-plugin/pull/53 , which generates the SNAPSHOT below. https://jenkins.ci.cloudbees.com/job/plugins/job/bitbucket-plugin/148/org.jenkins-ci.plugins$bitbucket/artifact/org.jenkins-ci.plugins/bitbucket/1.1.7-SNAPSHOT/bitbucket-1.1.7-SNAPSHOT.hpi Can someone try to install this on a real environment under Manage Jenkins -> Manage Plugins [Advanced tab] -> Upload plugin? Please, ensure that this plugin is enabled in BitBucket side. Once you confirm this is fine, I will release and merge.
          heatzone87 Pim Jansen made changes -
          Comment [ [~fbelzunc] but same happens on Bitbucket Cloud right? So the issue is more on the receiving plugin side i believe? ]
          Hide
          entfrickler Frieder Rick added a comment - - edited

          Hi Félix Belzunce Arcos, I just tried your snapshot and had no success.

          My environment:
          Atlassian Bitbucket v5.0.1
          Jenkins ver. 2.73.3

          Before I used the snapshot which I posted here in the comments. What I can guess from the logs it seems to me that the branch is not recognized.

          //log Message from 1.1.7-SNAPSHOT
          Dez 04, 2017 6:07:08 PM INFORMATION com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPostServicePayload
          Received commit hook notification for {"slug":"xx-projectName","id":47,"name":"xx-projectName","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"IN","id":103,"name":"Internet","description":"https://xxxx.local/display/IN/Bereich+Internet","public":false,"type":"NORMAL"},"public":false}
          

          The Log Message from my last commit I did with my own modified version has also details about the branch I commited to:

          //log Message from my own Build
          Dez 04, 2017 6:07:08 PM FEIN com.cloudbees.jenkins.plugins.BitbucketHookReceiver
          Received commit hook notification : {"repository":{"slug":"xx-projectName","id":47,"name":"xx-projectName","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"IN","id":103,"name":"Internet","description":"https://confluence.xxx.local/display/IN/Bereich+Internet","public":false,"type":"NORMAL"},"public":false},"refChanges":[{"refId":"refs/heads/feature/ZAT-110","fromHash":"a4365a6f51175703c246ba71021908dbb02ad8db","toHash":"8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af","type":"UPDATE"}],"changesets":{"size":1,"limit":100,"isLastPage":true,"values":[{"fromCommit":{"id":"a4365a6f51175703c246ba71021908dbb02ad8db","displayId":"a4365a6f511"},"toCommit":{"id":"8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af","displayId":"8464aa9f0e2","author":{"name":"Frieder Rick","emailAddress":"frieder.rick@xxxx.de"},"authorTimestamp":1512407220000,"committer":{"name":"Frieder Rick","emailAddress":"frieder.rick@xxxx.de"},"committerTimestamp":1512407220000,"message":"TMP commit delete me...","parents":[{"id":"a4365a6f51175703c246ba71021908dbb02ad8db","displayId":"a4365a6f511"}]},"changes":{"size":1,"limit":100,"isLastPage":true,"values":[{"contentId":"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391","fromContentId":"0000000000000000000000000000000000000000","path":{"components":["yyy"],"parent":"","name":"yyy","toString":"yyy"},"executable":false,"percentUnchanged":-1,"type":"ADD","nodeType":"FILE","links":{"self":[{"href":"https://git.xxx.local/projects/IN/repos/xx-projectName/commits/8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af#yyy"}]}}],"start":0},"links":{"self":[{"href":"https://git.xxx.local/projects/IN/repos/xx-projectName/commits/8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af#yyy"}]}}],"start":0}} Dez 04, 2017 6:07:08 PM INFORMATION com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPayload Processing old POST service payload

          Right now I have no debugging environment set up to give you more detailed Information. Tell me if you need more infos and I will debug into this by time.

          Show
          entfrickler Frieder Rick added a comment - - edited Hi Félix Belzunce Arcos , I just tried your snapshot and had no success. My environment: Atlassian Bitbucket v5.0.1 Jenkins ver. 2.73.3 Before I used the snapshot which I posted here in the comments. What I can guess from the logs it seems to me that the branch is not recognized. //log Message from 1.1.7-SNAPSHOT Dez 04, 2017 6:07:08 PM INFORMATION com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPostServicePayload Received commit hook notification for { "slug" : "xx-projectName" , "id" :47, "name" : "xx-projectName" , "scmId" : "git" , "state" : "AVAILABLE" , "statusMessage" : "Available" , "forkable" : true , "project" :{ "key" : "IN" , "id" :103, "name" : "Internet" , "description" : "https: //xxxx.local/display/IN/Bereich+Internet" , " public " : false , "type" : "NORMAL" }, " public " : false } The Log Message from my last commit I did with my own modified version has also details about the branch I commited to: //log Message from my own Build Dez 04, 2017 6:07:08 PM FEIN com.cloudbees.jenkins.plugins.BitbucketHookReceiver Received commit hook notification : { "repository" :{ "slug" : "xx-projectName" , "id" :47, "name" : "xx-projectName" , "scmId" : "git" , "state" : "AVAILABLE" , "statusMessage" : "Available" , "forkable" : true , "project" :{ "key" : "IN" , "id" :103, "name" : "Internet" , "description" : "https: //confluence.xxx.local/display/IN/Bereich+Internet" , " public " : false , "type" : "NORMAL" }, " public " : false }, "refChanges" :[{ "refId" : "refs/heads/feature/ZAT-110" , "fromHash" : "a4365a6f51175703c246ba71021908dbb02ad8db" , "toHash" : "8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af" , "type" : "UPDATE" }], "changesets" :{ "size" :1, "limit" :100, "isLastPage" : true , "values" :[{ "fromCommit" :{ "id" : "a4365a6f51175703c246ba71021908dbb02ad8db" , "displayId" : "a4365a6f511" }, "toCommit" :{ "id" : "8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af" , "displayId" : "8464aa9f0e2" , "author" :{ "name" : "Frieder Rick" , "emailAddress" : "frieder.rick@xxxx.de" }, "authorTimestamp" :1512407220000, "committer" :{ "name" : "Frieder Rick" , "emailAddress" : "frieder.rick@xxxx.de" }, "committerTimestamp" :1512407220000, "message" : "TMP commit delete me..." , "parents" :[{ "id" : "a4365a6f51175703c246ba71021908dbb02ad8db" , "displayId" : "a4365a6f511" }]}, "changes" :{ "size" :1, "limit" :100, "isLastPage" : true , "values" :[{ "contentId" : "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391" , "fromContentId" : "0000000000000000000000000000000000000000" , "path" :{ "components" :[ "yyy" ], "parent" : ""," name ":" yyy "," toString ":" yyy "}," executable ": false ," percentUnchanged ":-1," type ":" ADD "," nodeType ":" FILE "," links ":{" self ":[{" href ":" https://git.xxx.local/projects/IN/repos/xx-projectName/commits/8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af#yyy "}]}}]," start ":0}," links ":{" self ":[{" href ":" https://git.xxx.local/projects/IN/repos/xx-projectName/commits/8464aa9f0e2bfa36d39b7e3cc1d160b82565c1af#yyy "}]}}]," start":0}} Dez 04, 2017 6:07:08 PM INFORMATION com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPayload Processing old POST service payload Right now I have no debugging environment set up to give you more detailed Information. Tell me if you need more infos and I will debug into this by time.
          fbelzunc Félix Belzunce Arcos made changes -
          fbelzunc Félix Belzunce Arcos made changes -
          fbelzunc Félix Belzunce Arcos made changes -
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          Frieder Rick

          Please, try the following:

          1. Install the following plugin in the BitBucket server: https://marketplace.atlassian.com/plugins/nl.topicus.bitbucket.bitbucket-webhooks/server/overview
          2. At repo level, delete the webhook

          3. Create a Post-WebHook, which is different from WebHook and enable on push.

          Now, the webhook should work with the same version of the BitBucket plugin I provided yesterday.

          https://jenkins.ci.cloudbees.com/job/plugins/job/bitbucket-plugin/148/org.jenkins-ci.plugins$bitbucket/artifact/org.jenkins-ci.plugins/bitbucket/1.1.7-SNAPSHOT/bitbucket-1.1.7-SNAPSHOT.hpi

          Frieder Rick Would you mind to try and ack this is fine?

          Show
          fbelzunc Félix Belzunce Arcos added a comment - Frieder Rick Please, try the following: 1. Install the following plugin in the BitBucket server: https://marketplace.atlassian.com/plugins/nl.topicus.bitbucket.bitbucket-webhooks/server/overview 2. At repo level, delete the webhook 3. Create a Post-WebHook, which is different from WebHook and enable on push. Now, the webhook should work with the same version of the BitBucket plugin I provided yesterday. https://jenkins.ci.cloudbees.com/job/plugins/job/bitbucket-plugin/148/org.jenkins-ci.plugins$bitbucket/artifact/org.jenkins-ci.plugins/bitbucket/1.1.7-SNAPSHOT/bitbucket-1.1.7-SNAPSHOT.hpi Frieder Rick Would you mind to try and ack this is fine?
          Hide
          entfrickler Frieder Rick added a comment - - edited

          Félix Belzunce Arcos

          Ok, I tried it with the other Plugin you recommended and I had success with a little change in your code.

          In my case the URIs which where compared are:
          Repo URI in Jenkins: ssh://git@git.xxx.local:2222/in/za-telematik.git
          Repo URI you build from the Payload URI: https://git.xxx.local/scm/in/za-telematik

          In this case GitStatus.looselyMatches(urIish, url) return false.

          So there is a scm/ too much in the URI you build. I modified your code by removing the "scm/" + at line 65 in the BitbucketPayloadProcessor.java and it is working as expected.

          I don't know if this behavior is the same for all Bitbucket servers. But in my case its fine!

          Show
          entfrickler Frieder Rick added a comment - - edited Félix Belzunce Arcos Ok, I tried it with the other Plugin you recommended and I had success with a little change in your code. In my case the URIs which where compared are: Repo URI in Jenkins: ssh://git@git.xxx.local:2222/in/za-telematik.git Repo URI you build from the Payload URI: https://git.xxx.local/scm/in/za-telematik In this case GitStatus.looselyMatches(urIish, url) return false. So there is a scm/ too much in the URI you build. I modified your code by removing the "scm/" + at line 65 in the BitbucketPayloadProcessor.java and it is working as expected. I don't know if this behavior is the same for all Bitbucket servers. But in my case its fine!
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          Perfect.

          I will manage the ssh case as well.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - Perfect. I will manage the ssh case as well.
          Hide
          entfrickler Frieder Rick added a comment -

          I just checked the Bitbucket Server and the HTTPS address is with the leading scm/
          In my case https://frick@git.xxx.local/scm/in/za-telematik.git
          So with HTTPS your changes seems to be ok.

          Show
          entfrickler Frieder Rick added a comment - I just checked the Bitbucket Server and the HTTPS address is with the leading scm/ In my case https://frick@git.xxx.local/scm/in/za-telematik.git So with HTTPS your changes seems to be ok.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Felix Belzunce Arcos
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java
          src/test/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessorTest.java
          http://jenkins-ci.org/commit/bitbucket-plugin/5701ae36d396220737a9742022d5593b9774f162
          Log:
          [FIXED JENKINS-28877] Adding BitBucket server webhook (#53)

          JENKINS-28877 Adding BitBucket server webhook

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Felix Belzunce Arcos Path: src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java src/test/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessorTest.java http://jenkins-ci.org/commit/bitbucket-plugin/5701ae36d396220737a9742022d5593b9774f162 Log: [FIXED JENKINS-28877] Adding BitBucket server webhook (#53) JENKINS-28877 Adding BitBucket server webhook
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          heatzone87 Pim Jansen added a comment -

          Goodwork Félix Belzunce Arcos. Will you also publish a new version of the plugin so we can kick it off in our development pipeline with a stable version instead of a snapshot?

          Show
          heatzone87 Pim Jansen added a comment - Goodwork Félix Belzunce Arcos . Will you also publish a new version of the plugin so we can kick it off in our development pipeline with a stable version instead of a snapshot?
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          I am documenting in the wiki how to integrate the plugin with bitbucket server. I already did a new release.

          1.1.7 should be available in a few hours in the Update Center.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - I am documenting in the wiki how to integrate the plugin with bitbucket server. I already did a new release. 1.1.7 should be available in a few hours in the Update Center.
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          Documentation is already created:

          Enjoy it: https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

          Show
          fbelzunc Félix Belzunce Arcos added a comment - Documentation is already created: Enjoy it: https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin
          Hide
          entfrickler Frieder Rick added a comment -

          Félix Belzunce Arcos

          Your final Version is not working with ssh. Your check is on the URI from the payload. But ssh used inside Jenkins you have to check the URI from the job.

          I made a pull request which I tested positive with both, https and ssh:
          https://github.com/jenkinsci/bitbucket-plugin/pull/55

          I'm not sure if this is the best solution and maybe the test should be improved.
          Can you review my changes and merge them when you think this is ok.

          Show
          entfrickler Frieder Rick added a comment - Félix Belzunce Arcos Your final Version is not working with ssh. Your check is on the URI from the payload. But ssh used inside Jenkins you have to check the URI from the job. I made a pull request which I tested positive with both, https and ssh: https://github.com/jenkinsci/bitbucket-plugin/pull/55 I'm not sure if this is the best solution and maybe the test should be improved. Can you review my changes and merge them when you think this is ok.
          entfrickler Frieder Rick made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          fbelzunc Félix Belzunce Arcos added a comment -

          Frieder Rick You are totally right.

          Show
          fbelzunc Félix Belzunce Arcos added a comment - Frieder Rick You are totally right.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Frieder Rick
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java
          src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java
          src/test/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessorTest.java
          http://jenkins-ci.org/commit/bitbucket-plugin/362bf39dcaa310940e093306acffc2df095ef30a
          Log:
          JENKINS-28877 remove /scm before GitStatus.looselyMatches to match ssh and https URI in Bitbucket Server

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Frieder Rick Path: src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java src/test/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessorTest.java http://jenkins-ci.org/commit/bitbucket-plugin/362bf39dcaa310940e093306acffc2df095ef30a Log: JENKINS-28877 remove /scm before GitStatus.looselyMatches to match ssh and https URI in Bitbucket Server
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Felix Belzunce Arcos
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java
          src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java
          src/test/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessorTest.java
          http://jenkins-ci.org/commit/bitbucket-plugin/031673033c4616bdb2930feb204795b288c9fb14
          Log:
          Merge pull request #55 from entfrickler/sshgit

          [FIXED JENKINS-28877] remove /scm before GitStatus.looselyMatches to match …

          Compare: https://github.com/jenkinsci/bitbucket-plugin/compare/1d6566934d59...031673033c46

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Felix Belzunce Arcos Path: src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java src/main/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessor.java src/test/java/com/cloudbees/jenkins/plugins/BitbucketPayloadProcessorTest.java http://jenkins-ci.org/commit/bitbucket-plugin/031673033c4616bdb2930feb204795b288c9fb14 Log: Merge pull request #55 from entfrickler/sshgit [FIXED JENKINS-28877] remove /scm before GitStatus.looselyMatches to match … Compare: https://github.com/jenkinsci/bitbucket-plugin/compare/1d6566934d59...031673033c46
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          patrick_dennstedt Patrick Dennstedt added a comment - - edited

          The same situation after pull request events in webhook. Push event forks fine.

          Caused: java.lang.reflect.InvocationTargetException
          
          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)
          
          Show
          patrick_dennstedt Patrick Dennstedt added a comment - - edited The same situation after pull request events in webhook. Push event forks fine. Caused: java.lang.reflect.InvocationTargetException 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)
          asavanchuk Alaiksei Savanchuk made changes -
          Comment [ The same problem 
          net.sf.json.JSONException: JSONObject["user"] not found.
          Jenkins ver. 2.60.3

          Bitbucket Plugin 1.1.8

           

            ]
          Hide
          entfrickler Frieder Rick added a comment -

          Pull request are working for me.

          Are you sure you are using the Post Webhooks There are different Hooks. Check out this comment for more Information: https://issues.jenkins-ci.org/browse/JENKINS-28877?focusedCommentId=321766&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-321766

          Show
          entfrickler Frieder Rick added a comment - Pull request are working for me. Are you sure you are using the Post Webhooks There are different Hooks. Check out this comment for more Information: https://issues.jenkins-ci.org/browse/JENKINS-28877?focusedCommentId=321766&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-321766
          Hide
          kcuser K C added a comment -

          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.

          Show
          kcuser K C added a comment - 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.
          Hide
          entfrickler Frieder Rick added a comment -

          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.

          Show
          entfrickler Frieder Rick added a comment - 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.
          Hide
          kcuser K C added a comment -

          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

          Show
          kcuser K C added a comment - 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
          Hide
          farv Francisco A. R. Vivas added a comment - - edited

          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://URL/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":"","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":"","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.

          Edit: JENKINS-53946, here is the issue.

          Show
          farv Francisco A. R. Vivas added a comment - - edited 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: //URL/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" : ""," 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 ":" "," 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. Edit: JENKINS-53946 , here is the issue.

            People

            • Assignee:
              fbelzunc Félix Belzunce Arcos
              Reporter:
              kayakyakr Charles DuBose
            • Votes:
              24 Vote for this issue
              Watchers:
              43 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: