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

FinishLogin throws: Illegal character in query at index 89

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: github-oauth-plugin
    • Labels:
      None
    • Environment:
      jenkins 2.150.1
      github-oauth-plugin 0.31
      openjdk version "1.8.0_191"
    • Similar Issues:

      Description

      I login using my git credentials and when I get redirect back to my jenkins server it throws an error:

      java.net.URISyntaxException: Illegal character in query at index 89: https://github.com/login/oauth/access_token?client_id=ce1924515def5c76245d&client_secret=\{AQAAABAAAAAwkmNjAgFf7A65AKARYLRCIalS2emHy8D8tGNAM8TM7XI5ue+HH/sH/Os4gmOId4DlDRS1Hhd8FjapnIYez07yWg==}&code=4ac763e5f4023c8e12b6
      at java.net.URI$Parser.fail(URI.java:2848)

       

      Full Stack Trace

      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: Feb 11, 2019 3:32:27 PM hudson.util.Secret toString
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: WARNING: Use of toString() on hudson.util.Secret from java.lang.String.valueOf(String.java:2994). Prefer getPlainText() or getEncryptedValue() depending your needs. see https://jenkins.io/redirect/hudson.util.Secret/
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: Feb 11, 2019 3:32:27 PM org.eclipse.jetty.server.handler.ContextHandler$Context log
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: WARNING: Error while serving https://deployment-setup.icelandairlabs.com/securityRealm/finishLogin
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: java.lang.reflect.InvocationTargetException
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:537)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.MetaClass$2.doDispatch(MetaClass.java:221)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:243)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:105)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.Server.handle(Server.java:503)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.lang.Thread.run(Thread.java:748)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: Caused by: java.lang.IllegalArgumentException: Illegal character in query at index 89: https://github.com/login/oauth/access_token?client_id=ce1924515def5c76245d&client_secret=\{AQAAABAAAAAwkmNjAgFf7A65AKARYLRCIalS2emHy8D8tGNAM8TM7XI5ue+HH/sH/Os4gmOId4DlDRS1Hhd8FjapnIYez07yWg==}&code=4ac763e5f4023c8e12b6
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI.create(URI.java:852)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.apache.http.client.methods.HttpPost.<init>(HttpPost.java:73)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.jenkinsci.plugins.GithubSecurityRealm.getAccessToken(GithubSecurityRealm.java:421)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.jenkinsci.plugins.GithubSecurityRealm.doFinishLogin(GithubSecurityRealm.java:370)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: ... 85 more
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: Caused by: java.net.URISyntaxException: Illegal character in query at index 89: https://github.com/login/oauth/access_token?client_id=ce1924515def5c76245d&client_secret=\{AQAAABAAAAAwkmNjAgFf7A65AKARYLRCIalS2emHy8D8tGNAM8TM7XI5ue+HH/sH/Os4gmOId4DlDRS1Hhd8FjapnIYez07yWg==}&code=4ac763e5f4023c8e12b6
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI$Parser.fail(URI.java:2848)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI$Parser.checkChars(URI.java:3021)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI$Parser.parseHierarchical(URI.java:3111)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI$Parser.parse(URI.java:3053)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI.<init>(URI.java:588)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: at java.net.URI.create(URI.java:850)
      Feb 11 15:32:27 ip-10-252-132-29 java[9117]: ... 90 more

        Attachments

          Activity

          Hide
          davideagle Davíð Jóhannsson added a comment -

          To me this looks like it could be that Client Key is not being decrypted https://github.com/login/oauth/access_token?client_id=ce1924515def5c76245d&client_secret=\

          {AQAAABAAAAAwkmNjAgFf7A65AKARYLRCIalS2emHy8D8tGNAM8TM7XI5ue+HH/sH/Os4gmOId4DlDRS1Hhd8FjapnIYez07yWg==}

          &code=4ac763e5f4023c8e12b6

          Show
          davideagle Davíð Jóhannsson added a comment - To me this looks like it could be that Client Key is not being decrypted https://github.com/login/oauth/access_token?client_id=ce1924515def5c76245d&client_secret=\ {AQAAABAAAAAwkmNjAgFf7A65AKARYLRCIalS2emHy8D8tGNAM8TM7XI5ue+HH/sH/Os4gmOId4DlDRS1Hhd8FjapnIYez07yWg==} &code=4ac763e5f4023c8e12b6
          Hide
          davideagle Davíð Jóhannsson added a comment -

          I had to re-apply the client secret in plain text into .jenkins/config.xml:org.jenkinsci.plugins.GithubSecurityRealm

          Show
          davideagle Davíð Jóhannsson added a comment - I had to re-apply the client secret in plain text into .jenkins/config.xml:org.jenkinsci.plugins.GithubSecurityRealm

            People

            Assignee:
            sag47 Sam Gleske
            Reporter:
            davideagle Davíð Jóhannsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: