gerrit 到 github 复制:jsch 问题
尝试设置从 gerrit 到我的 github 存储库的复制。获取此堆栈跟踪:
[2011-09-20 00:11:58,470] com.google.gerrit.server.git.PushReplication 错误:无法复制到 [电子邮件受保护]:myuser/myrepo.git
org.eclipse.jgit.errors.TransportException:[电子邮件受保护]:myuser /myrepo.git:Session.connect:java.net.SocketTimeoutException:读取定时出
在 org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:138)
在 org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
在 org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection。(TransportGitSsh.java:248)
在 org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
在 com.google.gerrit.server.git.PushOp.listRemote(PushOp.java:358)
在 com.google.gerrit.server.git.PushOp.generateUpdates(PushOp.java:312)
在 com.google.gerrit.server.git.PushOp.pushVia(PushOp.java:258)
在 com.google.gerrit.server.git.PushOp.runImpl(PushOp.java:213)
在 com.google.gerrit.server.git.PushOp.run(PushOp.java:166)
在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
在 java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
在 java.util.concurrent.FutureTask.run(FutureTask.java:138)
在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
在 com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:324)
在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
在 java.lang.Thread.run(Thread.java:662)原因:com.jcraft.jsch.JSchException:Session.connect:java.net.SocketTimeoutException:读取超时
在 com.jcraft.jsch.Session.connect(Session.java:504)
在 org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:128)
我的配置文件如下:
replication.config:
[remote "github"]
url = [email protected]:myuser/${name}.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
timeout = 5
replicationDelay = 0
authGroup = Administrators
secure.config:
[database]
password = secret
[ssh]
file = /home/gerrit2/.ssh/config
.ssh/config:
Host github.com:
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey
我尝试运行
ssh -i etc/ssh_host_dsa_key [email protected]
ssh -i etc/ssh_host_rsa_key [email protected]
ssh -i ~/.ssh/id_rsa [email protected]
ssh -i ~/.ssh/id_dsa [email protected]
并能够“点击”github所以密钥导入正常,不确定问题是什么, 任何建议表示赞赏。
Trying to setup replication from gerrit to my github repo. Getting this stacktrace:
[2011-09-20 00:11:58,470] ERROR com.google.gerrit.server.git.PushReplication : Cannot replicate to [email protected]:myuser/myrepo.git
org.eclipse.jgit.errors.TransportException: [email protected]: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)
My config files are as follows:
replication.config:
[remote "github"]
url = [email protected]:myuser/${name}.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
timeout = 5
replicationDelay = 0
authGroup = Administrators
secure.config:
[database]
password = secret
[ssh]
file = /home/gerrit2/.ssh/config
.ssh/config:
Host github.com:
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey
I tried running
ssh -i etc/ssh_host_dsa_key [email protected]
ssh -i etc/ssh_host_rsa_key [email protected]
ssh -i ~/.ssh/id_rsa [email protected]
ssh -i ~/.ssh/id_dsa [email protected]
and was able to "hit" github so the keys are imported OK, not sure what the problem is,
any suggestions appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如异常的名称
SocketTimeoutException
所说(及其 文档详细信息):查看Gerrit的replication.config文档:
您的值是 5 秒,您可以尝试使用更大的值。
(该问题仅与 JSch 间接相关 - JSch 的
Session.connect(int)
将简单地获取超时参数并将其传递给它创建的 Socket。 href="https://github.com/ePaul/jsch-documentation/issues/2" rel="nofollow">提醒我我应该记录 JSch 的超时单位 - 秒或毫秒。)As the name of the exception
SocketTimeoutException
says (and its documentation details):Looking in the documentation of Gerrit's replication.config:
Your value is 5 seconds, you could try it with a larger value instead.
(The problem is only indirectly related to JSch - JSch's
Session.connect(int)
will simply take the timeout parameter and pass it on to the Socket it creates. That reminds me that I should document which unit this timeout is for JSch - seconds or milliseconds.)