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

This plugin breaks Jenkins CI component of Gitlab

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: gitlab-oauth-plugin
    • Labels:
      None
    • Environment:
      gitlab enterprise and jenkins ci integration for gitlab
    • Similar Issues:

      Description

      This plugin breaks Jenkins CI component of GitLab. Since accounts are now responsibility of GitLab when the gitlab's jenkins CI integration tries to login with a regular password, triggering a 401 Unauthorized error message. This extension fails since it redirects directly to the GitLab OAuth2 mechanism. Jenkins CI integration is needed for push event notification to avoid polling. Other extensions that directly login in Jenkins may also suffer from this issue.

      Here is the full error output:

      Test failed. <!DOCTYPE html><html><head resURL="/static/9c57be6d" data-rooturl="" data-resurl="/static/9c57be6d"> <title>Jenkins [Jenkins]</title><link rel="stylesheet" href="/static/9c57be6d/css/layout-common.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/css/style.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/css/color.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/css/responsive-grid.css" type="text/css" /><link rel="shortcut icon" href="/static/9c57be6d/favicon.ico" type="image/vnd.microsoft.icon" /><link color="black" rel="mask-icon" href="/images/mask-icon.svg" /><script>var isRunAsTest=false; var rootURL=""; var resURL="/static/9c57be6d";</script><script src="/static/9c57be6d/scripts/prototype.js" type="text/javascript"></script><script src="/static/9c57be6d/scripts/behavior.js" type="text/javascript"></script><script src='/adjuncts/9c57be6d/org/kohsuke/stapler/bind.js' type='text/javascript'></script><script src="/static/9c57be6d/scripts/yui/yahoo/yahoo-min.js"></script><script src="/static/9c57be6d/scripts/yui/dom/dom-min.js"></script><script src="/static/9c57be6d/scripts/yui/event/event-min.js"></script><script src="/static/9c57be6d/scripts/yui/animation/animation-min.js"></script><script src="/static/9c57be6d/scripts/yui/dragdrop/dragdrop-min.js"></script><script src="/static/9c57be6d/scripts/yui/container/container-min.js"></script><script src="/static/9c57be6d/scripts/yui/connection/connection-min.js"></script><script src="/static/9c57be6d/scripts/yui/datasource/datasource-min.js"></script><script src="/static/9c57be6d/scripts/yui/autocomplete/autocomplete-min.js"></script><script src="/static/9c57be6d/scripts/yui/menu/menu-min.js"></script><script src="/static/9c57be6d/scripts/yui/element/element-min.js"></script><script src="/static/9c57be6d/scripts/yui/button/button-min.js"></script><script src="/static/9c57be6d/scripts/yui/storage/storage-min.js"></script><script src="/static/9c57be6d/scripts/hudson-behavior.js" type="text/javascript"></script><script src="/static/9c57be6d/scripts/sortable.js" type="text/javascript"></script><script>crumb.init("Jenkins-Crumb", "584b98a1203423388c17737be2182e7d");</script><link rel="stylesheet" href="/static/9c57be6d/scripts/yui/container/assets/container.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/scripts/yui/assets/skins/sam/skin.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/scripts/yui/container/assets/skins/sam/container.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/scripts/yui/button/assets/skins/sam/button.css" type="text/css" /><link rel="stylesheet" href="/static/9c57be6d/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" /><meta name="ROBOTS" content="INDEX,NOFOLLOW" /><meta name="viewport" content="width=device-width, initial-scale=1" /><script src="/adjuncts/9c57be6d/org/kohsuke/stapler/jquery/jquery.full.js" type="text/javascript"></script><script>var Q=jQuery.noConflict()</script><link rel="stylesheet" href="" type="text/css" /><script src="" type="text/javascript"></script><script src="/static/9c57be6d/jsbundles/page-init.js" type="text/javascript"></script></head><body data-model-type="hudson.model.Hudson" id="jenkins" class="yui-skin-sam two-column jenkins-2.73.1" data-version="2.73.1"><a href="#skip2content" class="skiplink">Skip to content</a><div id="page-head"><div id="header"><div class="logo"><a id="jenkins-home-link" href="/"><img src="/static/9c57be6d/images/headshot.png" alt="title" id="jenkins-head-icon" /><img src="/static/9c57be6d/images/title.png" alt="title" width="139" id="jenkins-name-icon" height="34" /></a></div><div class="login"> <a href="/securityRealm/commenceLogin?from=%2Fproject%2Flibsodium"><b>log in</b></a></div><div class="searchbox hidden-xs"><form method="get" name="search" action="/search/" style="position:relative;" class="no-json"><div id="search-box-minWidth"></div><div id="search-box-sizer"></div><div id="searchform"><input name="q" placeholder="search" id="search-box" class="has-default-text" /> <a href="https://jenkins.io/redirect/search-box"><img src="/static/9c57be6d/images/16x16/help.png" style="width: 16px; height: 16px; " class="icon-help icon-sm" /></a><div id="search-box-completion"></div><script>createSearchBox("/search/");</script></div></form></div></div><div id="breadcrumbBar"><tr id="top-nav"><td id="left-top-nav" colspan="2"><link rel='stylesheet' href='/adjuncts/9c57be6d/lib/layout/breadcrumbs.css' type='text/css' /><script src='/adjuncts/9c57be6d/lib/layout/breadcrumbs.js' type='text/javascript'></script><div class="top-sticker noedge"><div class="top-sticker-inner"><div id="right-top-nav"></div><ul id="breadcrumbs"><li class="item"><a href="/" class="model-link inside">Jenkins</a></li><li href="/" class="children"></li></ul><div id="breadcrumb-menu-target"></div></div></div></td></tr></div></div><div id="page-body" class="clear"><div id="side-panel"><div class="task"><a href="https://jenkins.io/" class="task-icon-link"><img src="/static/9c57be6d/images/24x24/next.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-next icon-md" /></a> <a href="https://jenkins.io/" class="task-link">Jenkins project</a></div><div class="task"><a href="https://jenkins.io/redirect/report-an-issue" class="task-icon-link"><img src="/static/9c57be6d/images/24x24/gear2.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-gear2 icon-md" /></a> <a href="https://jenkins.io/redirect/report-an-issue" class="task-link">Bug tracker</a></div><div class="task"><a href="https://jenkins.io/redirect/mailing-lists" class="task-icon-link"><img src="/static/9c57be6d/images/24x24/search.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-search icon-md" /></a> <a href="https://jenkins.io/redirect/mailing-lists" class="task-link">Mailing Lists</a></div><div class="task"><a href="https://twitter.com/jenkinsci" class="task-icon-link"><img src="/static/9c57be6d/images/24x24/user.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-user icon-md" /></a> <a href="https://twitter.com/jenkinsci" class="task-link">Twitter: @jenkinsci</a></div></div><div id="main-panel"><a name="skip2content"></a><h1 style="text-align: center"><img src="/static/9c57be6d/images/rage.png" width="154" height="179" /><span style="font-size:50px"> Oops!</span></h1><div id="error-description"><p>A problem occurred while processing the request. Please check <a href="https://jenkins.io/redirect/issue-tracker">our bug tracker</a> to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. <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">java.io.IOException: Server returned HTTP response code: 401 for URL: https://xxx/api/v3/user at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) at org.gitlab.api.http.GitlabHTTPRequestor.parse(GitlabHTTPRequestor.java:327) at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:144) Caused: org.gitlab.api.GitlabAPIException: {"message":"401 Unauthorized"} at org.gitlab.api.http.GitlabHTTPRequestor.handleAPIError(GitlabHTTPRequestor.java:369) at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:146) at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:116) at org.gitlab.api.GitlabAPI.getUser(GitlabAPI.java:137) at org.jenkinsci.plugins.GitLabAuthenticationToken.&lt;init>(GitLabAuthenticationToken.java:103) at org.jenkinsci.plugins.GitLabSecurityRealm$1.authenticate(GitLabSecurityRealm.java:442) Caused: java.lang.RuntimeException at org.jenkinsci.plugins.GitLabSecurityRealm$1.authenticate(GitLabSecurityRealm.java:446) at jenkins.security.BasicHeaderRealPasswordAuthenticator.authenticate(BasicHeaderRealPasswordAuthenticator.java:56) at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:78) 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.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:564) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128) at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199) at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) </pre></div></div></div><footer><div class="container-fluid"><div class="row"><div class="col-md-6" id="footer"></div><div class="col-md-18"><span class="page_generated">Page generated: Sep 25, 2017 11:32:06 AM UTC</span><span class="rest_api"><a href="api/">REST API</a></span><span class="jenkins_ver"><a href="https://jenkins.io/">Jenkins ver. 2.73.1</a></span></div></div></div></footer></body></html>
      Save anyway
      

        Attachments

          Activity

          Hide
          pwilcock Peter Wilcock added a comment -

          I believe you can resolve this by logging in with the user's API key rather than the password. 

          Show
          pwilcock Peter Wilcock added a comment - I believe you can resolve this by logging in with the user's API key rather than the password. 
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Mohamed EL Habib
          Path:
          src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java
          src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java
          http://jenkins-ci.org/commit/gitlab-oauth-plugin/529f5b30b051923b44ae2b493c314c881778bb96
          Log:
          JENKINS-47097 added support to login using gitlab private token

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mohamed EL Habib Path: src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java http://jenkins-ci.org/commit/gitlab-oauth-plugin/529f5b30b051923b44ae2b493c314c881778bb96 Log: JENKINS-47097 added support to login using gitlab private token

            People

            • Assignee:
              elhabib_med Mohamed El Habib
              Reporter:
              pdefreitas Pedro Freitas
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: