我创建了一个管道,它应该在不同的Jenkinsserver上触发一个作业。我使用远程触发器插件,并且能够使用以下语句触发Job (目前这是我的管道中唯一的语句):
triggerRemoteJob enhancedLogging: true, job: 'myJob', maxConn: 1, remoteJenkinsName: 'MyJenkins'
但是,在Job被触发之后,管道尝试连接运行在localhost上的作业中的作业,这显然是失败的。
我试着禁用了一些选项,发现如果我禁用了blockBuildUntilComplete,它就可以工作了。
在启用了选项的情况下,我从日志中获得了以下内容:
############################################################################## ##################################
Parameterized Remote Trigger Configuration:
- job: myJob
- remoteJenkinsName: myJenkins
- parameters:
- blockBuildUntilComplete: true
- connectionRetryLimit: 5
################################################################################################################
Triggering non-parameterized remote job 'http://x.x.x.x:8080/job/myJob'
Using globally defined 'Credentials Authentication' as user 'myUser' (Credentials ID 'myCredentials')
Triggering remote job now.
CSRF protection is disabled on the remote server.
Remote job queue number: 47
Remote build started!
Remote build URL: http://localhost:8080/job/myJob /8/
Remote build number: 8
Blocking local job until remote job completes.
calling remote without locking...
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #1 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #2 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #3 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #4 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #5 out of 5
Max number of connection retries have been exeeded.
我更改了我的Jenkins-Server的名称和IP地址。
我必须在我的远程作业完成后执行一些步骤,这取决于它的结果。所以我必须等到这项工作完成。
有没有办法在没有block-option的情况下做到这一点,或者我必须做些什么才能让这个选项正常工作?
发布于 2019-04-29 15:41:50
我检查了插件的发布,我发现了3.0.8版本的一个改进,叫做“扩展POST超时和避免超时后重新发布”。我检查了这个变化,因为它看起来很好,就我们的问题而言,我更新了我们的插件(v3.0.7)到当前版本。现在错误不再出现。
https://stackoverflow.com/questions/55846561
复制相似问题