Jenkins拉取源码报code 128错误解决

本文地址:https://blog.csdn.net/t163361/article/details/128797243
公司用Jenkins作为自动打包工具。最近打包突然报128错误,具体错误如下:

2023-01-28 13:52:21.639+0000 [id=26]	SEVERE	n.u.l.h.p.g.GitParameterDefinition#generateContents: [ BatchBuild ]  Unexpected error!
hudson.plugins.git.GitException: Command "git.exe ls-remote -h -- https://gitee.com/***/*********.git" returned status code 128:
stdout: 
stderr: remote: [31m[session-75457484] You have been blocked by an enterprise administrator and can not access enterprise resources[0m
fatal: unable to access 'https://gitee.com/***/**********.git/': The requested URL returned error: 403

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2639)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2079)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1979)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1970)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:3570)

在网上各种找原因都不对,换账号密码不行,创建私人令牌也无法选择。
后来尝试用sourcetree拉取代码,发现报的一样的错误。然后继续查,发现sourcetree里面拉取账号配的是前段时间离职的一个同事的账号密码,然后修改了后,sourcetree拉取正常了。
这时候进Jenkins里面拉取也正常了。
看来是Jenkins里面虽然配了账号密码,但不知为什么依然用的是git缓存的账号密码。
具体原因也懒得查了。

猜你喜欢

转载自blog.csdn.net/t163361/article/details/128797243