Pipeline流水线通过git拉取Jenkinsfile报错 error: RPC failed; result=22, HTTP code = 404

news/2024/9/17 6:35:13 标签: git, rpc, http, jenkins, pipeline, 共享库
http://www.w3.org/2000/svg" style="display: none;">

gitJenkinsfile_error_RPC_failed_result22_HTTP_code__404_0">Pipeline流水线通过git拉取Jenkinsfile报错 error: RPC failed; result=22, HTTP code = 404

在学习共享库时使用通过git拉取jenkinsfile时,报错在排查gitlab服务状态,网络通讯,防火墙规则以及Jenkins凭据均可以正常使用,最后发现的时在URL填写中缺少 .git 结尾所导致的,在了解后得知在 GitLab 或 GitHub 中,通常使用仓库 URL 来拉取代码,例如:

http">http://12.12.1.171/root/pipeline.git

这个 URL 后缀的 .git 对 Git 来说是必要的,尤其是当服务器需要识别它是一个 Git 仓库时。这有以下几个原因:

  1. 服务器路径解析:带 .git 后缀的 URL 通常用于指示服务器该路径是一个 Git 仓库。如果缺少 .git,服务器可能无法正确处理这个请求,从而导致 404 错误,因为它可能将其解释为常规网页请求,而不是一个仓库拉取请求。
  2. 标准规范:虽然在某些情况下,Git 服务器可能会容忍省略 .git,但为了兼容性和确保正确性,建议始终使用 .git 后缀。

所以,少写 .git 后缀会导致 Jenkins 或其他 Git 客户端在尝试从服务器获取仓库时找不到该路径,从而报错。在 Repository URL 字段中补充 .git 来解决这个问题。

Started by user jenkins管理员
hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune origin +refs/heads/master:refs/remotes/origin/master" returned status code 128:
stdout: 
stderr: error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly

	at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2846)
	at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)
	at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
	at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:406)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMFileSyst
	em.of(SCMFileSystem.java:219)
	at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:126)
	at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:73)
	at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:446)
Finished: FAILURE

https://i-blog.csdnimg.cn/direct/2f169eeb999c45199c3c6bed91c40403.png" alt="在这里插入图片描述" /> https://i-blog.csdnimg.cn/direct/57b24f450c7e420b9473d42d7c329e62.png" alt="在这里插入图片描述" />

https://i-blog.csdnimg.cn/direct/128b6126ba49403fbe5cd4d0cbc51ba0.png" alt="在这里插入图片描述" />


http://www.niftyadmin.cn/n/5646109.html

相关文章

easyExcel-读取Excel

1、简单读取&#xff0c;没有合并单元格 2、复杂读取&#xff0c;合并单元格-方法一 1、简单读取&#xff0c;没有合并单元格 1.1、引入pom文件 <dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.…

RPC框架-protobuf-rpc-pro

protobuf-rpc-pro 是一个基于 Protocol Buffers 的 RPC 框架&#xff0c;旨在通过使用 Google 的 Protocol Buffers&#xff08;Protobuf&#xff09;序列化格式实现高效、轻量的远程过程调用&#xff08;RPC&#xff09;。它主要用于 Java 生态系统&#xff0c;提供了简洁的 A…

Popup源码分析 -- ant-design-vue系列

Popup源码分析 – ant-design-vue系列 1 极简代码 直接返回两个组件&#xff1a;Mask 和 PopupInner&#xff0c;后者在上一篇已经分析过了。下面我们先看一下 Mask的源码。 setup(props, { slots }) {return () > {if (!props.visible) return null;return (<div cla…

使用shell脚本安装mysql8,进行主从备份配置

思路 在3台主机上安装mysql进行主从备份配置 使用rpm包yum安装mysql 首先&#xff0c;我们要准备好安装文件&#xff0c;首先下载rpm包 wget -P "/opt/" https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm 然后执行安装&#xff08;默认已配置…

如何使用 PHP 函数与其他 Web 服务交互?

在 PHP 中&#xff0c;我们可以使用 cURL 或者 file_get_contents 函数与其他 Web 服务进行交互。 使用 cURL 函数 cURL 是一个库&#xff0c;它允许你使用各种类型的协议来发送数据&#xff0c;并从服务器获取数据。 $curl curl_init(‘http://example.com/api’); curl_s…

【机器人工具箱Robotics Toolbox开发笔记(十)】机器人微分运动学

​机器人正运动学专注于探究如何精确地标定与定位末端执行器,其核心在于构建并解析末端执行器在基坐标系下的精确位姿描述。当机器人系统启动并执行运动任务时,各个关节内置的编码器将实时捕捉并监控细微的运动变化。具体而言,若在当前已知的位姿基础上,对末端执行器施加一…

Python基础编程日常练习1|Python一对一私教制定题

你好&#xff0c;我是悦创。 部分问题需要研究&#xff0c;下节课会先把不会的讲解一下。 数字金字塔 要求&#xff1a;使用for循环打印一个金字塔形状的数字图案。数字从1开始逐行增加&#xff0c;直到第n行时包含n个数字&#xff0c;最后一行从左到右从1增加到n。示例输出&a…

Spring源码(3)Aware接口、初始化和销毁方法、@Scope、@Primary

1、目标 本文的主要目标是学习Spring源码中Aware接口、初始化和销毁方法、Scope注解、Primary注解的使用 2、Aware接口 Component public class MyBeanAware implements BeanNameAware, ApplicationContextAware {Overridepublic void setBeanName(String name) {System.out…