【问题标题】:Jenkins Pipeline fails when triggering a remote job with option "Block Build Until Complete" is enabled启用“块构建直到完成”选项触发远程作业时,Jenkins Pipeline 失败
【发布时间】:2019-04-29 15:41:49
【问题描述】:

我创建了一个管道,它应该在不同的 Jenkinsserver 上触发作业。 我使用远程触发插件,并且可以使用以下语句触发作业(目前这是我管道中唯一的语句):

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 地址。

远程工作完成后,我必须执行一些步骤,具体取决于其结果。所以我必须等到工作完成。

有没有办法在没有阻止选项的情况下执行此操作,或者我必须做什么才能使该选项起作用?

【问题讨论】:

    标签: jenkins groovy jenkins-plugins


    【解决方案1】:

    我检查了插件的发布,发现 3.0.8 版有一个改进,称为“延长 POST 超时并避免超时后重新发布” 我查看了更改,因为它在我们的问题方面看起来不错我将我们的插件(v3.0.7)更新到当前版本。 现在错误不再出现。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多