解决方案
配置要构建的分支时,删除通配符 *:*/master
只是master
此错误仅在 GIT SCM 与 JOB 相关时发生。
例如:我的日常工作是构建一个 Android 项目。
首先我认为这是一个 cron 问题,目前我使用 50 10 * * *,但我尝试过 H 10 * * * 没有任何成功。当时机成熟时,它总是构建作业(失败或成功)并将另一个作业排队......等等......
最后运行时间为 2015 年 5 月 22 日星期五上午 10:01:58 BRT;下次运行时间为 2015 年 5 月 23 日星期六上午 10:01:58 BRT。
即使是带有参数的构建,它每次都会排队另一个作业。
所以它永远停留在构建循环中。
配置:
控制台输出:
Started by an SCM change
Building in workspace .../jobs/PROJECT_NAME/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url ssh://GIT_ADDRESS/ # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -fdx # timeout=10
Fetching upstream changes from ssh://GIT_ADDRESS/
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress ssh://GIT_ADDRESS/ +refs/heads/master:refs/remotes/origin/master
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Multiple candidate revisions
Scheduling another build to catch up with PROJECT_NAME
Checking out Revision e6d726c2d31cb0d7e6fad4362ee85e6fac1712c6 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f e6d726c2d31cb0d7e6fad4362ee85e6fac1712c6
> git rev-list e6d726c2d31cb0d7e6fad4362ee85e6fac1712c6 # timeout=10
[Gradle] - Launching build.
[android] $ gradle clean build assemble
...
也许问题是这样的? > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Multiple candidate revisions
Scheduling another build to catch up with PROJECT_NAME
构建循环:
作业配置:
全局配置:
最佳答案
查看控制台日志的开头,包括您手动启动的作业和下一个自动排队的作业。
在控制台日志的开头,它给出了触发构建的原因,例如 09:46:05 Started by an SCM change
或 16:06:58 Started by user Slav
.请在问题中添加 的开头两个控制台日志。
编辑:
现在我们知道 Jenkins 检测到 SCM 更改触发器,我们可以进一步推测导致此行为的原因是某种 SCM 提交后 Hook ,或者另一个脚本激活向 Jenkins 发送请求。
如果未启用 SCM 轮询,则提交后 Hook 不应该工作,但没有其他意义,所以让我们调查一下这个途径。添加 /pollingLog/
到“由 SCM 更改”触发的内部版本号的内部版本 URL。有可能什么都找不到,但如果有,但让我们确定一下。
接下来,如果可能,将 Jenkins 绑定(bind)到不同的 IP 地址和/或端口。如果存在触发二次构建的“流氓”脚本,它们将无法适应更改的地址。
编辑 2:
中似乎有一个错误git client plugin 本身,它是 已在版本 1.6.2 中修复.请检查您的 git 插件的版本。
来源:https://issues.jenkins-ci.org/browse/JENKINS-10767和 https://issues.jenkins-ci.org/browse/JENKINS-20286
关于 Jenkins - 构建循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30403125/