You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Jenkins 2.387.2后,SCM加载Jenkinsfile的流水线报Git目录错误

Jenkins升级至2.387.2后Git SCM加载Jenkinsfile失败问题

升级Jenkins到2.387.2版本后,所有通过Git SCM加载Jenkinsfile的流水线均出现如下错误:

hudson.plugins.git.GitException: Command "git config remote.origin.url git@github.com:jenkinsci/pipeline-examples.git" returned status code 128:
15:33:37  stdout: 
15:33:37  stderr: fatal: not in a git directory
15:33:37  
15:33:37    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2732)
15:33:37    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2658)
15:33:37    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2654)
15:33:37    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1979)
15:33:37    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1991)
15:33:37    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1599)
15:33:37    at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:161)
15:33:37    at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:393)
15:33:37    at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)
15:33:37    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:118)
15:33:37    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
15:33:37    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:312)
15:33:37    at hudson.model.ResourceController.execute(ResourceController.java:101)

关键信息

  • 异常触发条件:仅通过Git SCM加载Jenkinsfile时报错,直接在任务内编写流水线代码时Git操作完全正常
  • 插件版本:Git client plugin (git-client) 4.2.0,Git plugin (git) 5.0.2
  • 运行环境:Kubernetes集群,Agent以Pod形式运行
  • 复现情况:新建流水线任务也能复现该问题

更新记录

更新1

测试同版本(2.387.2)的全新Jenkins实例,运行相同任务可正常执行,说明问题仅存在于现有Jenkins实例中。

更新2(临时解决方案)

该问题表现与jenkinsci/helm-charts仓库的Issue #728类似,将Jenkins基础镜像从Debian版本的jenkins/jenkins:lts-jdk11切换为CentOS版本的jenkins/jenkins:lts-centos7-jdk11后问题解决。目前暂未明确两类镜像在EFS文件系统下表现差异的具体原因。


内容的提问来源于stack exchange,提问作者Krishnom

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 18:33:08