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

java.lang.NullPointerException when using the bitbucket oauth plugin

    Details

    • Similar Issues:

      Description

      When trying to log in via the bitbucket oauth plugin jenkins throws this:

      java.lang.NullPointerException
      	at org.acegisecurity.providers.AbstractAuthenticationToken.equals(AbstractAuthenticationToken.java:107)
      	at jenkins.security.NonSerializableSecurityContext.equals(NonSerializableSecurityContext.java:62)
      	at org.eclipse.jetty.server.session.AbstractSession.setAttribute(AbstractSession.java:451)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.storeSecurityContextInSession(HttpSessionContextIntegrationFilter.java:408)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:264)
      	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:171)
      	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.headerComplete(AbstractHttpConnection.java:949)
      	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
      	at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)
      	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(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Does it probably not work with jenkins self signed certificates?

        Attachments

          Activity

          Hide
          alainv Alain Vandendorpe added a comment -

          I am encountering the exact same issue on Ubuntu 16.04 / Jenkins 2.7.1. Not a self-signed certificate.

          Show
          alainv Alain Vandendorpe added a comment - I am encountering the exact same issue on Ubuntu 16.04 / Jenkins 2.7.1. Not a self-signed certificate.
          Hide
          brianyoungblood Brian Youngblood added a comment - - edited

          Same issue here with Jenkins ver. 2.7.1 and plugin version 0.4 and 0.5. Jenkins is running with apache proxy pass to jenkins. Might be the issue and will try soon.

          EDIT 7/27/2016: I needed to put basic auth information in for the callback url on the bitbucket side. We have jenkins behind basic auth in addition to having this oauth working now. ie. our callback address is something like https://user:pass@sub.domain.com

          Show
          brianyoungblood Brian Youngblood added a comment - - edited Same issue here with Jenkins ver. 2.7.1 and plugin version 0.4 and 0.5. Jenkins is running with apache proxy pass to jenkins. Might be the issue and will try soon. EDIT 7/27/2016: I needed to put basic auth information in for the callback url on the bitbucket side. We have jenkins behind basic auth in addition to having this oauth working now. ie. our callback address is something like https://user:pass@sub.domain.com
          Hide
          jim_mchale Jim McHale added a comment -

          I'm seeing the exception on first login attempt, (a 2nd attempt works); and also when I hit logout I see the exception. 

          Its not every time, but quite often.

          Running Jenkins 2.85

          Bitbucket oauth 0.5

          Show
          jim_mchale Jim McHale added a comment - I'm seeing the exception on first login attempt, (a 2nd attempt works); and also when I hit logout I see the exception.  Its not every time, but quite often. Running Jenkins 2.85 Bitbucket oauth 0.5

            People

            • Assignee:
              Unassigned
              Reporter:
              despairblue Danny Arnold
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: