简体   繁体   English

无法通过Java插件hudson.plugins.git从邻居gogs容器中检出jenkins

[英]Cannot checkout in jenkins from neighbor gogs container via Java plugin hudson.plugins.git

Simple CICD using gogs/jenkins docker container running on an ubuntu host: 使用在Ubuntu主机上运行的gogs / jenkins docker容器的简单CICD:

When I try to fetch my git repo from the gogs container I get this error: 当我尝试从gogs容器中获取git repo时,出现以下错误:

git fetch --tags --progress http://gogs-repo:3000/repo.git   +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from http://gogs-repo:3000/repo.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:904)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1144)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1175)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress http://gogs-repo:3000/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: repository 'http://gogs-repo:3000/repo.git/' not found

However, when I log into the jenkins container it works from the command line: 但是,当我登录到jenkins容器时,它可以从命令行运行:

jenkins@2425782a55e8:/$ cd /tmp   
jenkins@2425782a55e8:/tmp$ git clone http://gogs-repo:3000/repo.git
    Cloning into 'dfscoco'...
    remote: Enumerating objects: 7336, done.
    remote: Counting objects: 100% (7336/7336), done.
    remote: Compressing objects: 100% (4493/4493), done.
    remote: Total 7336 (delta 2236), reused 7199 (delta 2123)
    Receiving objects: 100% (7336/7336), 10.77 MiB | 0 bytes/s, done.
    Resolving deltas: 100% (2236/2236), done.

Any ideas ?? 有任何想法吗 ?? Why cant the java code resolve the URL? 为什么Java代码无法解析URL?

So the answer is.... 所以答案是...
The proxy configuration for http used for the jenkins jvm is on the Manage plugins/Advanced Tab . 用于jenkins jvm的http的代理配置在Manage plugins / Advanced选项卡上

To access a server on a docker subnet it needs to be included in the field: 要访问Docker子网上的服务器,必须将其包含在字段中:

No Proxy Host 172.21.0.0/24 没有代理主机 172.21.0.0/24

https://wiki.jenkins.io/display/JENKINS/JenkinsBehindProxy https://wiki.jenkins.io/display/JENKINS/JenkinsBehindProxy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Hudson结账问题的Git插件 - Git plugin for Hudson checkout problem Jenkins作业失败,原因是:hudson.plugins.git.GitException:checkout -f返回状态码-1 - Jenkins job failing with Caused by: hudson.plugins.git.GitException: checkout -f returned status code -1 jenkins 管道中的 changeSet 错误(错误:java.io.NotSerializableException:hudson.plugins.git.GitChangeSetList) - Error with changeSet in jenkins pipeline (Error:java.io.NotSerializableException: hudson.plugins.git.GitChangeSetList) 无法从詹金斯的git插件连接到git服务器仓库 - cannot connect to git server repo from git plugin in jenkins 将本地GIT存储库添加到Gogs Docker容器 - Adding a Local GIT Repository to a Gogs Docker Container hudson无法从git存储库中获取 - hudson cannot fetch from git repository 詹金斯:hudson.plugins.git.GitException:命令“git fetch --tags --progress origin 返回状态代码 143: - Jenkins: hudson.plugins.git.GitException: Command "git fetch --tags --progress origin returned status code 143: Jenkins-Git-无法从Git存储库中检出 - Jenkins - Git - Failing to checkout from Git Repository Jenkins,无法使用多个 scm (git):无法结帐,错误 128 - Jenkins, cannot use multiple scm (git): cannot checkout, error 128 如何禁用 Jenkins 结帐和 git 插件 SSL 验证? - How to disable Jenkins checkout and git plugin SSL verify?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM