Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@gitlab.xxxon.choerodon.io:32222/oxxxx.xxxxx.xx.git: Auth fail
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:160)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:137)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.(TransportGitSsh.java:274)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:169)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1236)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:213)
… 27 common frames omitted
Caused by: com.jcraft.jsch.JSchException: Auth fail
at com.jcraft.jsch.Session.connect(Session.java:519)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:117)
… 34 common frames omitted
你好,这个是平台的第一次创建环境吗?之前有创建成功的吗?
可能的原因:
- 在
devops-service
中配置的gitlab
ssh地址有问题 (这个配置SERVICES_GITLAB_SSHURL
);
不是,是升级完之后在某个项目下创建新环境,然后我换了一个用户创建就没问题了,感觉是当前用户的token有问题
这个跟用户应该没关系。你点环境的重试按钮也一直无法通过吗?
没法通过,感觉是我在猪池鱼的界面是用户a,但是我注销登录过用户b。导致我在登录用户a的情况下跳gitlab界面,点多次还是显示是用户b的状态,除非在gitlab界面手动注销一次再跳过来就是用户a。之前那种状况导致的创建环境,git pull认证失败
我换个项目新建环境也是报错:
i.c.asgard.saga.consumer.SagaConsumer : @SagaTask method code: devopsCreateEnv, id: 20995 invoke error
io.choerodon.core.exception.CommonException: error.environment.update
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl.baseUpdate(DevopsEnvironmentServiceImpl.java:1629)
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl.handleCreateEnvSaga(DevopsEnvironmentServiceImpl.java:845)
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl$$FastClassBySpringCGLIB$$2e44f241.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl$$EnhancerBySpringCGLIB$$d79b958a.handleCreateEnvSaga()
at io.choerodon.devops.app.eventhandler.DevopsSagaHandler.devopsCreateEnv(DevopsSagaHandler.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at io.choerodon.asgard.saga.consumer.SagaConsumer.invoke(SagaConsumer.java:84)
at io.choerodon.asgard.saga.consumer.SagaConsumer.lambda$null$0(SagaConsumer.java:56)
at io.choerodon.asgard.saga.consumer.SagaConsumer$$Lambda$1127/00000000C41B1270.get(Unknown Source)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2021-03-10 10:52:16.301 INFO 8 — [pool-7-thread-9] i.c.d.a.s.impl.DevopsGitServiceImpl : 发送gitops同步成功指令成功
2021-03-10 10:52:16.318 INFO 8 — [nio-8060-exec-4] i.c.d.a.w.g.AgentGitOpsMessageHandler : 找不到指令啊 git_ops_sync_failed
2021-03-10 10:52:16.843 INFO 8 — [ool-7-thread-10] i.c.d.a.eventhandler.DevopsSagaHandler : To set error status for environment with code: ytmzyjkd-prod-dmz
2021-03-10 10:52:19.417 ERROR 8 — [ool-7-thread-12] i.c.d.a.s.i.DevopsEnvironmentServiceImpl :
envName:DMZ生产环境,envType:user,
isActive:true,isConnected:null,isSynchro:true,isFailed:true
sagaCommit:3938,devopsCommit:3938,agentCommit:null,
2021-03-10 10:52:19.458 INFO 8 — [ool-7-thread-12] i.c.asgard.saga.consumer.SagaConsumer : @SagaTask method code: devopsCreateEnv, id: 20995 invoke error
io.choerodon.core.exception.CommonException: error.environment.update
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl.baseUpdate(DevopsEnvironmentServiceImpl.java:1629)
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl.handleCreateEnvSaga(DevopsEnvironmentServiceImpl.java:845)
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl$$FastClassBySpringCGLIB$$2e44f241.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)
at io.choerodon.devops.app.service.impl.DevopsEnvironmentServiceImpl$$EnhancerBySpringCGLIB$$d79b958a.handleCreateEnvSaga()
at io.choerodon.devops.app.eventhandler.DevopsSagaHandler.devopsCreateEnv(DevopsSagaHandler.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at io.choerodon.asgard.saga.consumer.SagaConsumer.invoke(SagaConsumer.java:84)
at io.choerodon.asgard.saga.consumer.SagaConsumer.lambda$null$0(SagaConsumer.java:56)
at io.choerodon.asgard.saga.consumer.SagaConsumer$$Lambda$1127/00000000C41B1270.get(Unknown Source)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
这个重试下事务实例就好了
去重试下大部分情况确实可以解决,造成这个的原因是什么呢
你这里是两个问题, 一个是创建环境直接失败,一个是创建后解析未通过:
- 第一个问题可能是并发带来的问题;
- 第二个问题是配置的问题或者gitlab不正常;
确实是出现两种情况,直接失败的情况下,我知道他会自动重试然后过渡到第二种情况,第二种情况下无论怎么重试都不行,换个用户可能基本就可以了,所以跟配置和gitlab没关系吧,我升级之前好像没出现过创建失败的情况
按照代码实现的层面来说,第二种情况不应该和用户有关,因为这里的git pull能通过和环境绑定的一对ssh key进行认证的,切换用户并不会更改环境的key。