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

Bitbucket webhook fails inside Open Liberty servlet container, does not extend ServletRequestWrapper

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • bitbucket-plugin
    • None
    • Open Liberty web server, Jenkins 2.490

      I found out that Bitbucket webhook doesn't work. Console shows:

        RequestWrapper objects must extend ServletRequestWrapper or HttpServletRequestWrapper
      at com.ibm.wsspi.webcontainer.util.ServletUtil.unwrapRequest(ServletUtil.java:91)
      at com.ibm.wsspi.webcontainer.util.ServletUtil.unwrapRequest(ServletUtil.java:63)
      at com.ibm.wsspi.webcontainer.util.ServletUtil.unwrapRequest(ServletUtil.java:58)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:191)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93)
      at io.jenkins.servlet.FilterChainWrapper$2.doFilter(FilterChainWrapper.java:53)
      at PluginClassLoader for bitbucket//com.cloudbees.jenkins.plugins.BitbucketCrumbExclusion.process(BitbucketCrumbExclusion.java:21)
      at hudson.security.csrf.CrumbExclusion.process(CrumbExclusion.java:49)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:128)

        1. config.xml
          2 kB
        2. old-plugins.txt
          4 kB
        3. old-run-jenkins.sh
          0.9 kB
        4. plugins.txt
          4 kB
        5. run-jenkins.sh
          0.9 kB

          [JENKINS-75054] Bitbucket webhook fails inside Open Liberty servlet container, does not extend ServletRequestWrapper

          Mark Waite added a comment -

          Please provide enough details so that others can duplicate the issue. "How to report an issue" lists the information that is needed and provides a script that generates the plugin list. That information will make it faster and easier for others to investigate the issue.

          Mark Waite added a comment - Please provide enough details so that others can duplicate the issue. "How to report an issue" lists the information that is needed and provides a script that generates the plugin list. That information will make it faster and easier for others to investigate the issue.

          Sérgio added a comment -

          Thanks for your reply. But our Jenkins service has already been reverted to v2.474 successfully. I really don't want to update it again to get more information just to revert it again afterwards.
          It seems to me that we already have enough information. Bitbucket plugin was last updated 4 months ago, before 2.475, and it must be updated to be compatible with JavaEE 9.
          Duplicate the issue: install Bitbucket plugin in an updated Jenkins installation and enable Bitbucket webhook. When the webhook is called, that error occurs.

          Sérgio added a comment - Thanks for your reply. But our Jenkins service has already been reverted to v2.474 successfully. I really don't want to update it again to get more information just to revert it again afterwards. It seems to me that we already have enough information. Bitbucket plugin was last updated 4 months ago, before 2.475, and it must be updated to be compatible with JavaEE 9. Duplicate the issue: install Bitbucket plugin in an updated Jenkins installation and enable Bitbucket webhook. When the webhook is called, that error occurs.

          Mark Waite added a comment - - edited

          I think that you're assuming that the com.ibm.wsspi.webcontainer.util elements in the stack trace are irrelevant. I'm assuming the other direction, that the issue may be specific to your use of a level 2 servlet container. instead of the level 1 servlet container that is run by most users.

          Mark Waite added a comment - - edited I think that you're assuming that the com.ibm.wsspi.webcontainer.util elements in the stack trace are irrelevant. I'm assuming the other direction, that the issue may be specific to your use of a level 2 servlet container . instead of the level 1 servlet container that is run by most users.

          Mark Waite added a comment - - edited

          I can't duplicate the issue with the servlet container provided with Jenkins. Steps that I took to attempt to duplicate the issue:

          Confirm webhook works with 2.474 and most recent compatible plugins

          1. Add bitbucket and git plugin to the plugin list from community.jenkins.io, update them for 2.474, and save as old-plugins.txt
          2. Create old-run-jenkins.sh shell script that downloads Jenkins 2.474 and downloads plugins as defined in old-plugins.txt
          3. Run old-run-jenkins.sh shell script and complete the setup wizard by defining a user and installing no additional plugins
          4. Define a job that clones my private tasks repository from Bitbucket using a repository access token that I created for this test. Job is config.xml
          5. Run the job to confirm that repository clone works
          6. Configure a smee.io webhook relay so that Bitbucket cloud webhooks can reach inside my firewall (details omitted)
          7. Push a change to my Bitbucket tasks repository and confirm that the Jenkins job is run with the Bitbucket webhook as the cause
          8. Stop the old-run-jenkins.sh shell script

          Upgrade to 2.479.2 and confirm webhook works with latest plugins

          1. Create a plugins.txt file with the plugins updated for Jenkins 2.479.2
          2. Create a run-jenkins.sh shell script that downloads Jenkins 2.479.2 and the plugins defined in plugins.txt
          3. Run the run-jenkins.sh shell script from the same directory that was previously used for 2.474
          4. Run the existing job to confirm it still works
          5. Push a change to my Bitbucket tasks repository and confirm that the Jenkins job is run with the Bitbucket webhook as the cause

          I think the issue is somehow connected to your use of the Open Liberty servlet container.

          Mark Waite added a comment - - edited I can't duplicate the issue with the servlet container provided with Jenkins. Steps that I took to attempt to duplicate the issue: Confirm webhook works with 2.474 and most recent compatible plugins Add bitbucket and git plugin to the plugin list from community.jenkins.io , update them for 2.474, and save as old-plugins.txt Create old-run-jenkins.sh shell script that downloads Jenkins 2.474 and downloads plugins as defined in old-plugins.txt Run old-run-jenkins.sh shell script and complete the setup wizard by defining a user and installing no additional plugins Define a job that clones my private tasks repository from Bitbucket using a repository access token that I created for this test. Job is config.xml Run the job to confirm that repository clone works Configure a smee.io webhook relay so that Bitbucket cloud webhooks can reach inside my firewall (details omitted) Push a change to my Bitbucket tasks repository and confirm that the Jenkins job is run with the Bitbucket webhook as the cause Stop the old-run-jenkins.sh shell script Upgrade to 2.479.2 and confirm webhook works with latest plugins Create a plugins.txt file with the plugins updated for Jenkins 2.479.2 Create a run-jenkins.sh shell script that downloads Jenkins 2.479.2 and the plugins defined in plugins.txt Run the run-jenkins.sh shell script from the same directory that was previously used for 2.474 Run the existing job to confirm it still works Push a change to my Bitbucket tasks repository and confirm that the Jenkins job is run with the Bitbucket webhook as the cause I think the issue is somehow connected to your use of the Open Liberty servlet container.

          Sérgio added a comment -

          Thanks for the feedback. I supposed the plugin needed an update to be run in a JavaEE 9 container. You confirmed that it's already running fine in Jenkins' default container.
          Here, it's working in 2.474, but not in newer versions. Hence, I need to find out the cause which seems to be specific to Open Liberty web container.
          This message is weird. Maybe there's something with the classloader:
          "RequestWrapper objects must extend ServletRequestWrapper or HttpServletRequestWrapper"
          I'll keep you informed.

          Sérgio added a comment - Thanks for the feedback. I supposed the plugin needed an update to be run in a JavaEE 9 container. You confirmed that it's already running fine in Jenkins' default container. Here, it's working in 2.474, but not in newer versions. Hence, I need to find out the cause which seems to be specific to Open Liberty web container. This message is weird. Maybe there's something with the classloader: "RequestWrapper objects must extend ServletRequestWrapper or HttpServletRequestWrapper" I'll keep you informed.

            Unassigned Unassigned
            barulheira Sérgio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: