Mac网络代理意外断开后Eclipse使用Git拉取或者提交代码报错

Mac网络开启代理后,Eclipse经常会出现无法使用Git拉取或提交代码,今天又遇到了,以往时间紧急全是重装Eclipse来恢复,今天彻底排查找到了处理方式。

解决方法:Eclipse -> Preferences -> General -> Netwrok Connectinos 如下图,选择Host中有数据的点击右侧的Clear


报错信息如下:

org.eclipse.jgit.api.errors.TransportException: git@xxx/xx.git: DefaultConnectFuture[git@xxx/xxx.x.x.x:22]: Failed (ConnectException) to execute: Connection refused
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:224)
    at org.eclipse.egit.core.op.FetchOperation.run(FetchOperation.java:134)
    at org.eclipse.egit.ui.internal.fetch.FetchOperationUI.execute(FetchOperationUI.java:111)
    at org.eclipse.egit.ui.internal.fetch.FetchOperationUI$1.performJob(FetchOperationUI.java:137)
    at org.eclipse.egit.ui.internal.jobs.RepositoryJob.run(RepositoryJob.java:59)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.jgit.errors.TransportException: git@xxx/xx.git: DefaultConnectFuture[git@xxx/xxx.x.x.x:22]: Failed (ConnectException) to execute: Connection refused
    at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:250)
    at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:1)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:107)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:281)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:153)
    at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:142)
    at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:94)
    at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1309)
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:213)
    ... 5 more
Caused by: org.apache.sshd.common.SshException: DefaultConnectFuture[git@xxx/xxx.x.x.x:22]: Failed (ConnectException) to execute: Connection refused
    at org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:131)
    at org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:185)
    at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:130)
    at org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:42)
    at org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:34)
    at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:191)
    at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:142)
    at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:99)
    at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:237)
    ... 13 more
Caused by: java.net.ConnectException: Connection refused
    at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method)
    at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:254)
    at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:200)
    at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:215)
    at java.base/sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:312)
    at java.base/java.lang.Thread.run(Thread.java:831)

2

评论

  1. 你写得非常清晰明了,让我很容易理解你的观点。

  2. qwqw

发表评论

电子邮件地址不会被公开。 必填项已用*标注

点击更换