Jenkins管道-sh-git push随机失败-错误:脚本返回了退出代码128

时间:2020-10-06 08:30:33

标签: jenkins jenkins-pipeline sh

环境:
ENVJenkins运算符
詹金斯2.249.1
管道

失败


[master cc6be50] New customer test60
    
1 file changed, 32 insertions
    
create mode 100644 deployment/test60.yaml

+ git push origin
[Pipeline] }
[Pipeline] // stage[Pipeline] }
[Pipeline] // withEnv[Pipeline] }
[Pipeline] // withCredentials[Pipeline] }
[Pipeline] // node[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 128
    
Finished: FAILURE

相同的代码成功运行:

+ git commit -m New customer test49

[master 9c0b093] New customer test49

1 file changed, 32 insertions

create mode 100644 deployment/test49.yaml
    
+ git push origin

To https://github.com/****/xxxxxxxxx.git 770e517..9c0b093 master -> master

请立即进行一些操作,我无法找出问题所在。

  1. 我正在将Jenkins的凭据存储到结帐代码中。
  2. 在阶段'''多命令中使用sh ''' 3.这曾经在旧版本的Jenkins中起作用,最近jenkins操作员重新启动并拉出了最新版本的Jenkins 2.249.1
  3. 我主要在与“ git push”或与“ git”相关的cmds中看到问题

“ git ls-remote”失败。

+ git ls-remote --heads origin test47
    [Pipeline] }[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv[Pipeline] }
[Pipeline] // withCredentials[Pipeline] }
[Pipeline] // node[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 128

Finished: FAILURE

我以前的工作代码基于创建新分支并推送到具有随机故障的repo,因此更改了直接推送到master的逻辑。

Another failure while deleting the remote branch

Branch name test58 already exists, deleting it
+ git push -d origin test58
[Pipeline] }[Pipeline] // stage[Pipeline] }
[Pipeline] // withEnv[Pipeline] }
[Pipeline] // withCredentials[Pipeline] }
[Pipeline] // withEnv[Pipeline] }
[Pipeline] // node[Pipeline] }
[Pipeline] // podTemplate[Pipeline]
End of Pipeline
ERROR: script returned exit code 128
Finished: FAILURE

CMD失败

+ git ls-remote --heads origin test81
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 128
Finished: FAILURE

相同的CMD成功

wc=$(git ls-remote --heads origin $BR |wc |awk '{print$1}')
+ git ls-remote --heads origin test81 
75dfaff2153dec5730066e716c37ad67a46d733a refs/heads/test81 
+ git ls-remote --heads origin test81 
+ wc + awk {print$1} 
+ wc=1 
+ echo Value of wc is $wc Value of wc is $wc 
+ [ 1 -ne 0 ] 
+ echo Branch name test81 already exists, deleting it Branch name test81 already exists, deleting it 
+ git config push.default simple 
+ git push -d origin test81 
To https://github.com/****/svc_workflowexecutor.git 
- [deleted] test81

随机故障。

问题随机发生在不同的地方(我推送到大约10个不同的存储库),我们还看到API速率限制超出问题。

问题仍然没有解决,将使您保持最新状态。

1 个答案:

答案 0 :(得分:0)

我也注意到了这种现象,并切换到ssh repo url。当我不需要进行更改时,我会使用https