• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • openstack-cloud-plugin
    • None

      Hi,

      When I tried to test the connection to the Openstack cloud, it failed and I got the following errors:

      Cannot connect to specified cloud, please check the identity and credentials: Unauthorized
      AuthenticationException{message=Unauthorized, status=401}
      	at org.openstack4j.core.transport.HttpExceptionHandler.mapException(HttpExceptionHandler.java:36)
      	at org.openstack4j.core.transport.HttpExceptionHandler.mapException(HttpExceptionHandler.java:23)
      	at org.openstack4j.openstack.internal.OSAuthenticator.authenticateV2(OSAuthenticator.java:125)
      	at org.openstack4j.openstack.internal.OSAuthenticator.invoke(OSAuthenticator.java:52)
      	at org.openstack4j.openstack.client.OSClientBuilder$ClientV2.authenticate(OSClientBuilder.java:117)
      	at org.openstack4j.openstack.client.OSClientBuilder$ClientV2.authenticate(OSClientBuilder.java:79)
      	at jenkins.plugins.openstack.compute.internal.Openstack.<init>(Openstack.java:130)
      	at jenkins.plugins.openstack.compute.internal.Openstack.<init>(Openstack.java:101)
      	at jenkins.plugins.openstack.compute.internal.Openstack$Factory.getOpenstack(Openstack.java:648)
      	at jenkins.plugins.openstack.compute.internal.Openstack$FactoryEP.get(Openstack.java:617)
      	at jenkins.plugins.openstack.compute.JCloudsCloud$DescriptorImpl.doTestConnection(JCloudsCloud.java:509)
      	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.MetaClass$1.doDispatch(MetaClass.java:129)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	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:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:138)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	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:92)
      	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:1652)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:499)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      	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)
      

      The user identity is in the format of TENANT_NAME:USER_NAME.

       

      Does anybody have the same issues and know how to resolve it?

       

      Thanks,

      Armin

       

       

          [JENKINS-46502] Test connection to Openstack cloud fails

          Are you sure about the region? I presume you have double checked the rest... Have you tried some other kind of client to verify your credentials?

          Oliver Gondža added a comment - Are you sure about the region? I presume you have double checked the rest... Have you tried some other kind of client to verify your credentials?

          Yes, I double checked it with openstack CLI.

          Armin Morattab added a comment - Yes, I double checked it with openstack CLI.

          olivergondza do you have any idea how can I fix this issue?

           

          My Jenkins server is running on a VM at 192.168.0.107, and I get access to the Jenkins dashboard through 192.168.0.108:8080. When I test the cloud connection it fails and it gives the above mentioned errors. How ever I checked the credentials using Openstack CLI and it works.

          Should I set the Openstack environment variables or the test connection will do that automaticly?

          Armin Morattab added a comment - olivergondza do you have any idea how can I fix this issue?   My Jenkins server is running on a VM at 192.168.0.107, and I get access to the Jenkins dashboard through 192.168.0.108:8080. When I test the cloud connection it fails and it gives the above mentioned errors. How ever I checked the credentials using Openstack CLI and it works. Should I set the Openstack environment variables or the test connection will do that automaticly?

          Can you compare the wire log captured by tcpdump or similar tool and see if the cli tools and Jenkins interact with the OS differently. I do not recall any similar report.

          Should I set the Openstack environment variables or the test connection will do that automaticly?

          The variables are only used by the CLI client.

          Oliver Gondža added a comment - Can you compare the wire log captured by tcpdump or similar tool and see if the cli tools and Jenkins interact with the OS differently. I do not recall any similar report. Should I set the Openstack environment variables or the test connection will do that automaticly? The variables are only used by the CLI client.

          Roland Asmann added a comment -

          I have the same problem when using Identity V3. I noticed however that from the CLI I have 2 different domains: 1 for project and 1 for user. Since these are different on my setup, could it be that the plugin is trying to send the same value for both?

          Should I open a new Issue for this or can I leave it on this one?

          Roland Asmann added a comment - I have the same problem when using Identity V3. I noticed however that from the CLI I have 2 different domains: 1 for project and 1 for user. Since these are different on my setup, could it be that the plugin is trying to send the same value for both? Should I open a new Issue for this or can I leave it on this one?

          malice00, that is a plausible explanation. There are multiple people that has come across this https://github.com/jenkinsci/openstack-cloud-plugin/pull/165

          arminmor, can you confirm this is the same situation?

          Oliver Gondža added a comment - malice00 , that is a plausible explanation. There are multiple people that has come across this https://github.com/jenkinsci/openstack-cloud-plugin/pull/165 arminmor , can you confirm this is the same situation?

          Roland Asmann added a comment -

          olivergondza, from what I read, arminmor is using V2, so this is probably not his problem....

          As for the pull request, I built my own version of the plugin using that code and it does solve my problems... Hope it can get merged and released soon...

          Roland Asmann added a comment - olivergondza , from what I read, arminmor is using V2, so this is probably not his problem.... As for the pull request, I built my own version of the plugin using that code and it does solve my problems... Hope it can get merged and released soon...

            olivergondza Oliver Gondža
            arminmor Armin Morattab
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: