Gerrit - 复制到 github

2024-04-28

我通过配置 gerrit 复制

[remote "github"]
  url = [email protected] /cdn-cgi/l/email-protection:MYUSERNAME/${name}.git
  push = +refs/heads/*:refs/heads/*
  push = +refs/tags/*:refs/tags/*
  timeout = 5
  replicationDelay = 0
  authGroup = Administrators

只要 github 站点允许,我就可以使用 gerrit2 用户登录 github。 Github 位于已知主机中。 但是我收到以下错误:

[2013-06-04 20:04:54,472] ERROR com.googlesource.gerrit.plugins.replication.ReplicationQueue : Cannot replicate to [email protected] /cdn-cgi/l/email-protection:MYUSERNAME/All-Projects.git
org.eclipse.jgit.errors.TransportException: [email protected] /cdn-cgi/l/email-protection:MYUSERNAME/All-Projects.git: reject HostKey: github.com
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
    at com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:409)
    at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:357)
    at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:350)
    at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:298)
    at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:252)
    at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:207)
    at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:71)
    at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:186)
    at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:183)
    at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
    at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
    at com.google.gerrit.server.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
    at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:183)
    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:337)
    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: reject HostKey: github.com
    at com.jcraft.jsch.Session.checkHost(Session.java:712)
    at com.jcraft.jsch.Session.connect(Session.java:313)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    ... 25 more

ssh访问也有类似问题 和

url = ssh://[email protected] /cdn-cgi/l/email-protection:443/MYUSERNAME/${name}.git

[2013-06-04 21:22:06,072] ERROR com.googlesource.gerrit.plugins.replication.ReplicationQueue : Cannot replicate to ssh://[email protected] /cdn-cgi/l/email-protection:443/MYUSERNAME/All-Projects.git
org.eclipse.jgit.errors.TransportException: ssh://[email protected] /cdn-cgi/l/email-protection:443/MYUSERNAME/All-Projects.git: reject HostKey: ssh.github.com
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
    at com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:409)
    at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:357)
    at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:350)
    at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:298)
    at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:252)
    at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:207)
    at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:71)
    at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:186)
    at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:183)
    at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
    at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
    at com.google.gerrit.server.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
    at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:183)
    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:337)
    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: reject HostKey: ssh.github.com
    at com.jcraft.jsch.Session.checkHost(Session.java:712)
    at com.jcraft.jsch.Session.connect(Session.java:313)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    ... 25 more

以运行 Gerrit 的用户身份登录(通过 SSH)。

我建议你设置一个~/.ssh/config对于 Gerrit 用户来说:

Host github.com
    User git
    IdentityFile /path/to/the/private/key
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null

这会将您的 SSH 密钥设置为忽略有关(最初)未知主机的警告。

如果您可以通过以下方式连接ssh github.com, 我们快到了。然后尝试使用 SSH URL 克隆 Github 存储库。

然后让 Gerrit 再次尝试复制。

另外我建议删除authGroup设置从replication.config.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Gerrit - 复制到 github 的相关文章

随机推荐

  • STM32:从自定义引导加载程序跳转到应用程序时发生硬故障

    我正在开发带有自定义引导加载程序和应用程序的 STM32F401 MCU 编译器是GCC 5 2 1 没有运行优化 在以下跳转序列后的第一次中断后 我遇到了硬故障 引导加载程序 gt 应用程序 gt 引导加载程序 gt 应用程序 从引导加载
  • 数据编织转换

    我有 POST 方法的以下有效负载的输入 order Column X X Column Y Y Column Z Z Column W div 1 some text div 2 true div 3 2 mapper A
  • 配置 logback 以遵循 Java 配置,即 Logback 的纯 Java 配置

    我只是不喜欢 Logback 的 XML 或 Groovy 配置 更喜欢用 Java 进行配置 这也是因为我将在初始化后的不同时间在运行时更改配置 似乎对 Logback 进行 Java 配置的唯一方法是进行某种初始化劫持根追加器 http
  • Amazon ECS - 在 Docker 入口点上使用 IAM 角色时权限被拒绝

    我正在寻找一种将机密 证书注入 Amazon ECS 容器的方法 就我而言 它是一个简单的 nginx 容器 我一直在使用 AWS Parameter Store 关注这篇文章 https aws amazon com blogs comp
  • java中使用[:punct:]函数的正则表达式

    我在用 punct 替换 a 中特殊字符的函数 字符串例如 REPLACE REGEXP REPLACE 第 1 列 punct 作为输出 作为java中SQL字符串的一部分 但我想要特定的特殊字符 不被替换 你能建议最好的方法吗 Acc
  • Android Studio 1.0.1 APK META-INF/DEPENDENCIES 中复制的重复文件

    我安装了 Android Studio 版本 1 0 1 并尝试将我的项目从 eclipse 导入到它 它给了我以下错误 Error Execution failed for task app packageDebug Duplicate
  • Drupal 功能包括主题

    是否可以在 Drupal 功能中包含主题 如果是这样怎么办 不幸的是 目前还没有 功能基本上由可以通过各种事件挂钩干净地从 Drupal 导出或导入到 Drupal 的内容组成 主题是完全不同的动物 理论上 如果您想覆盖功能中的某些标记 例
  • 有没有办法覆盖 Google 路线服务缩放值?

    我使用下面的代码来获取两点之间的路线 directionsService route request function response status if status google maps DirectionsStatus OK di
  • MySQL“GROUP BY NULL”是做什么的?

    我正在维护一些遗留代码 其中有一个我不理解的 SQL 查询 我希望这里有人可以向我解释这样做的目的 查询如下所示 select from product performance where merchantid 2151277 and cl
  • scala、spring 和 scalate

    我有一个用 scala spring sitemesh 和 jspx jstl 编写的 Web 项目 问题出在 jspx 上 我一直遇到问题 它希望类型是 java 集合类型 所以我必须继续在 scala java 集合之间进行转换 有时我
  • 是否可以在 Mac Pro 上构建 Electron 应用程序?由于奇怪的 GPU 问题,似乎不是这样

    我尝试拉取并尝试为 Electron 应用程序构建两个不同的引导程序存储库 https github com pastahito electron react webpack https github com pastahito elect
  • 如何将 std::map 输出到二进制文件?

    我怎样才能输出一个std map到二进制文件 地图声明如下所示 map
  • “找不到符号”或“无法解析符号”错误是什么意思?

    请解释以下有关 找不到符号 无法解析符号 或 找不到符号 错误 Java 中 的信息 他们的意思是什么 哪些因素会导致它们 程序员如何修复它们 这个问题旨在对 Java 中的这些常见编译错误进行全面的问答 0 这些错误之间有什么区别吗 并不
  • 如何将我的 cordova 应用程序放入 Android Play 商店?

    如果有这方面的官方科尔多瓦文档 我找不到它 希望有一个链接 我跑了cordova run android部署到我的手机上 事情看起来不错 现在我准备好将其变成用户可以在 Android Play 商店下载的官方应用程序了吗 当我构建应用程序
  • python 函数中的任意数量的参数

    我想学习如何在 python 函数中传递任意数量的参数 所以我以递归方式编写了一个简单的 sum 函数 如下所示 def mySum args if len args 1 return args 0 else return args 1 m
  • Golang:获取切片的类型

    我正在使用 Reflect 包来获取任意数组的类型 但是得到 prog go 17 cannot use sample array1 type int as type interface in function argument proce
  • 带有矩形数组的 SDL_RenderCopy

    SDL RenderCopy 仅接受单个输入矩形和单个输出矩形 但是 如果我有很多想要填充的图像 我对 opengl 的了解告诉我 一次绘制所有图像的批量操作可能比每个精灵一次绘制调用要快得多 SDL FillRects 已经有一个计数参数
  • 在 SQL Server 中使用空间索引时出错

    我使用空间索引 当我尝试执行时WHERE陈述 WHERE T GEOMETRY STIntersects O GEOMETRY 1 AND T GEOMETRY STTouches O GEOMETRY 0 它工作正常 但是当我尝试使用 O
  • 如何在mathematica中自动加载用户定义的函数

    我有一堆在 mathematica 中经常使用的用户定义函数 我想知道是否可以将它们存储在单独的文件中 并且 mathematica 会在启动时加载它们并将它们视为内置函数 这样每当我创建新的 nb 文件时就不必重复定义 类似于 Matla
  • Gerrit - 复制到 github

    我通过配置 gerrit 复制 remote github url email protected cdn cgi l email protection MYUSERNAME name git push refs heads refs he