gpt4 book ai didi

ssh - gerrit 到 github 复制 : jsch issues

转载 作者:行者123 更新时间:2023-12-02 14:10:21 24 4
gpt4 key购买 nike

尝试设置从 gerrit 到我的 github 存储库的复制。获取此堆栈跟踪:

[2011-09-20 00:11:58,470] ERROR com.google.gerrit.server.git.PushReplication : Cannot replicate to git@github.com:myuser/myrepo.git
org.eclipse.jgit.errors.TransportException: git@github.com:myuser/myrepo.git: Session.connect: java.net.SocketTimeoutException: Read timed out
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:138)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.(TransportGitSsh.java:248)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
at com.google.gerrit.server.git.PushOp.listRemote(PushOp.java:358)
at com.google.gerrit.server.git.PushOp.generateUpdates(PushOp.java:312)
at com.google.gerrit.server.git.PushOp.pushVia(PushOp.java:258)
at com.google.gerrit.server.git.PushOp.runImpl(PushOp.java:213)
at com.google.gerrit.server.git.PushOp.run(PushOp.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:324)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Caused by: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out
at com.jcraft.jsch.Session.connect(Session.java:504)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:128)



我的配置文件如下:

复制配置:
[remote "github"]
url = git@github.com:myuser/${name}.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
timeout = 5
replicationDelay = 0
authGroup = Administrators

安全配置:
[database]
password = secret
[ssh]
file = /home/gerrit2/.ssh/config

.ssh/配置:
Host github.com:
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey

我试着运行
ssh -i etc/ssh_host_dsa_key git@github.com
ssh -i etc/ssh_host_rsa_key git@github.com
ssh -i ~/.ssh/id_rsa git@github.com
ssh -i ~/.ssh/id_dsa git@github.com

并且能够“点击” github,因此可以导入 key ,不确定问题是什么,
任何建议表示赞赏。

最佳答案

作为异常的名称SocketTimeoutException说(及其 documentation details):

Signals that a timeout has occurred on a socket read or accept.



查看 documentation of Gerrit's replication.config :

remote.<name>.timeout

Number of seconds to wait for a network read or write to complete before giving up and declaring the remote side is not responding. If 0, there is no timeout, and the push client waits indefinitely.

A timeout should be large enough to mostly transfer the objects to the other side. 1 second may be too small for larger projects, especially over a WAN link, while 10-30 seconds is a much more reasonable timeout value.

Defaults to 0 seconds, wait indefinitely.



您的值是 5 秒,您可以尝试使用更大的值。

(问题仅与 JSch 间接相关 - JSch 的 Session.connect(int) 将简单地获取超时参数并将其传递给它创建的 Socket。我应该记录此超时的单位为 reminds me 的 JSch - 秒或毫秒。 )

关于ssh - gerrit 到 github 复制 : jsch issues,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7472381/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com