111应用部署失败 failed : The deploy is time out!

  • Choerodon平台版本:0.6.0

  • 运行环境:自主搭建

  • 问题描述:

2019-05-07 15:43:52.855 INFO 1 — [nio-8060-exec-4] i.c.devops.infra.common.util.FileUtil : 文件写入成功!
2019-05-07 15:43:53.169 INFO 1 — [nio-8060-exec-4] i.c.devops.infra.common.util.FileUtil : 文件写入成功!
2019-05-07 15:43:55.303 INFO 1 — [pool-6-thread-2] i.c.d.a.s.impl.DevopsGitServiceImpl : The gitOps Repository ssh url: ssh://git@gitlab.g-parts.cn:2289/operation-jpweb-gitops/jpweb-01.git
2019-05-07 15:43:55.305 INFO 1 — [pool-6-thread-2] i.c.d.a.s.impl.DevopsGitServiceImpl : Checkout error

org.eclipse.jgit.api.errors.RefNotFoundException: Ref master can not be resolved
at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:252)
at io.choerodon.devops.infra.common.util.GitUtil.checkout(GitUtil.java:184)
at io.choerodon.devops.infra.common.util.GitUtil.checkout(GitUtil.java:176)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl.handDevopsEnvGitRepository(DevopsGitServiceImpl.java:830)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl.fileResourceSync(DevopsGitServiceImpl.java:437)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl$$FastClassBySpringCGLIB$$3502622.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl$$EnhancerBySpringCGLIB$$cf3174e7.fileResourceSync()
at io.choerodon.devops.api.eventhandler.DevopsSagaHandler.gitops(DevopsSagaHandler.java:156)
at sun.reflect.GeneratedMethodAccessor2374.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
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)

2019-05-07 15:43:55.310 INFO 1 — [pool-6-thread-2] i.c.d.a.s.impl.DevopsGitServiceImpl : Pull error

org.eclipse.jgit.api.errors.TransportException: ssh://git@gitlab.g-parts.cn:2289/operation-jpweb-gitops/jpweb-01.git: Connection refused (Connection refused)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:224)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:287)
at io.choerodon.devops.infra.common.util.GitUtil.pullBySsh(GitUtil.java:209)
at io.choerodon.devops.infra.common.util.GitUtil.pullBySsh(GitUtil.java:198)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl.handDevopsEnvGitRepository(DevopsGitServiceImpl.java:831)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl.fileResourceSync(DevopsGitServiceImpl.java:437)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl$$FastClassBySpringCGLIB$$3502622.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at io.choerodon.devops.app.service.impl.DevopsGitServiceImpl$$EnhancerBySpringCGLIB$$cf3174e7.fileResourceSync()
at io.choerodon.devops.api.eventhandler.DevopsSagaHandler.gitops(DevopsSagaHandler.java:156)
at sun.reflect.GeneratedMethodAccessor2374.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
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)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@gitlab.g-parts.cn:2289/operation-jpweb-gitops/jpweb-01.git: Connection refused (Connection refused)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
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)
… 25 common frames omitted

点击部署时失败


请问这样的问题如何解决,麻烦给下思路

查看devops-service中的日志
显示 org.eclipse.jgit.errors.TransportException: ssh://git@gitlab.g-parts.cn:2289/operation-jpweb-gitops/jpweb-01.git: Connection refused (Connection refused)
git clone 时 被拒绝 请问 这个是什么原因呢

  1. 这个是程序中使用ssh的方式去clone gitlab库,然后连接被拒绝了, 可以去devops-service的容器中ping下 gitlab地址,看是否能够正常访问

root@devops-service-669b7b6b9d-tdm8p:/# ping gitlab.g-parts.cn
PING gitlab.g-parts.cn (192.168.2.53) 56(84) bytes of data.
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=1 ttl=63 time=0.173 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=2 ttl=63 time=0.183 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=3 ttl=63 time=0.162 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=4 ttl=63 time=0.208 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=5 ttl=63 time=0.182 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=6 ttl=63 time=0.236 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=7 ttl=63 time=0.226 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=8 ttl=63 time=0.172 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=9 ttl=63 time=0.174 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=10 ttl=63 time=0.181 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=11 ttl=63 time=0.172 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=12 ttl=63 time=0.186 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=13 ttl=63 time=0.170 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=14 ttl=63 time=0.163 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=15 ttl=63 time=0.193 ms
64 bytes from 192.168.2.53 (192.168.2.53): icmp_seq=16 ttl=63 time=0.540 ms

可以ping的通 但是 连接拒绝

root@devops-service-669b7b6b9d-tdm8p:/# git clone ssh://git@gitlab.g-parts.cn:2289/operation-jpweb/jpweb.git
Cloning into ‘jpweb’…
ssh: connect to host gitlab.g-parts.cn port 2289: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
root@devops-service-669b7b6b9d-tdm8p:/# git clone http://gitlab.g-parts.cn/operation-jpweb/jpweb.git
Cloning into ‘jpweb’…
Username for ‘http://gitlab.g-parts.cn’: root
Password for ‘http://root@gitlab.g-parts.cn’:
remote: Enumerating objects: 4325, done.
remote: Counting objects: 100% (4325/4325), done.
remote: Compressing objects: 100% (3189/3189), done.
remote: Total 4325 (delta 939), reused 4224 (delta 878)
Receiving objects: 100% (4325/4325), 41.33 MiB | 31.78 MiB/s, done.
Resolving deltas: 100% (939/939), done.
root@devops-service-669b7b6b9d-tdm8p:/#

git clone 时 用ssh 会被拒绝
gitc clone 时 用http 能正常拉取代码
麻烦问下 这个该如何解决?

1.检查下集群安全组是否正常开启

2.http://choerodon.io/zh/docs/installation-configuration/steps/install/parts/base/gitlab/ 看下是否正常开启了2289端口

有几点疑惑 修改Gitlab SSH Service
[root@master ~]# kubectl get svc -n c7n-system gitlab-ssh
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
gitlab-ssh ClusterIP 10.233.5.216 192.168.2.82 2289/TCP 20d
[root@master ~]#
我的EXTERNAL-IP 这个ip 是指向master 节点的IP吗 (master节点只有一个 )
还是指向部署gitlab所在主机的ip?
我这个用的是本地服务器

填写Gitlab域名指向的主机的内网IP