无法从jenkins连接到gitlab

yqyhoc1h  于 2023-03-07  发布在  Jenkins
关注(0)|答案(1)|浏览(407)

我试着建立从jenkins到gitlab的连接。
因此:
1.我创建了gitlab令牌:
/***需要点:我尝试了gitlab主机的所有可能选项:
https://gitlab.comhttps://gitlab.com/usernamehttps://gitlab.com/username/repository
但都不管用

1.我添加了gitlab API插件,gitlab插件,git插件,gitlab认证插件。
1.之后,我添加了gitlab令牌到Jankins凭据:

1.并在gitlab部分添加了这个标记:

在我按下"测试连接"后,我收到了错误。我收到了Jenkins的日志,并有以下错误堆栈跟踪:

2023-03-01 19:39:16.358+0000 [id=13]    WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving http://34.204.61.XXX:8080/manage/descriptorByName/com.dabsquared.gitlabjenkins.connection.GitLabConnection/testConnection
java.lang.IllegalArgumentException: RESTEASY003900: Unable to find a public constructor for provider class org.glassfish.jersey.jackson.internal.DefaultJacksonJaxbJsonProvider
        at org.jboss.resteasy.spi.ResteasyProviderFactory.createConstructorInjector(ResteasyProviderFactory.java:2844)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2833)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:1068)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1841)
Caused: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1846)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:3065)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:123)
        at org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:52)
        at org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:12)
        at org.glassfish.jersey.jackson.JacksonFeature.configure(JacksonFeature.java:107)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProviderInstance(ResteasyProviderFactory.java:2605)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProviderInstance(ResteasyProviderFactory.java:2233)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:3036)
        at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.register(ResteasyClientBuilder.java:617)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder.buildClient(ResteasyGitLabClientBuilder.java:141)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder.buildClient(ResteasyGitLabClientBuilder.java:92)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetect(AutodetectingGitLabClient.java:378)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetectOrDie(AutodetectingGitLabClient.java:368)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.delegate(AutodetectingGitLabClient.java:361)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient$GitLabOperation.execute(AutodetectingGitLabClient.java:397)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.execute(AutodetectingGitLabClient.java:391)
        at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.getCurrentUser(AutodetectingGitLabClient.java:306)
        at com.dabsquared.gitlabjenkins.connection.GitLabConnection$DescriptorImpl.doTestConnection(GitLabConnection.java:259)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
        at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
Caused: java.lang.reflect.InvocationTargetException
        at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:401)
        at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
        at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:78)
        at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
        at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
        at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
        at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:558)
        at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
        at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:289)
        at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:830)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
        at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:475)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:690)
        at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
        at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
        at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:157)
        at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
        at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
        at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:81)
        at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
        at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:160)
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
        at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:154)
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:94)
        at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:106)
        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:97)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:97)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)
        at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:63)
        at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
        at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:111)

stacktrace比我提供的要长,但是我不确定我必须在这里粘贴这么大的行。第一行有意义吗?

其他信息:

  • jenkins部署在Docker容器内的AWS示例上
  • EC2入站/出站规则已为"任何位置"打开端口:第22、80、80、443号决议
bxgwgixi

bxgwgixi1#

插件升级后我也遇到了同样的问题。
这个问题帮助我:尝试将Jersey API插件恢复为2.38版本。

相关问题