cicd runtime_error ai_generated true

org.jenkinsci.plugins.workflow.steps.FlowInterruptedException: The pipeline timed out after 60 minutes

ID: cicd/jenkins-pipeline-timeout

Also available as: JSON · Markdown · 中文
90%Fix Rate
88%Confidence
1Evidence
2023-08-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
Jenkins 2.346+ active
Pipeline: Declarative 1.8.5+ active
Pipeline: Groovy 2.9+ active

Root Cause

A Jenkins pipeline stage or the entire pipeline exceeded the configured timeout limit, causing the build to be aborted.

generic

中文

Jenkins 流水线阶段或整个流水线超过了配置的超时限制,导致构建被中止。

Official Documentation

https://www.jenkins.io/doc/book/pipeline/syntax/#options

Workarounds

  1. 90% success Increase the timeout in the Jenkinsfile by modifying the `options` block: `options { timeout(time: 120, unit: 'MINUTES') }` for the entire pipeline, or add `timeout(time: 30, unit: 'MINUTES')` to a specific stage.
    Increase the timeout in the Jenkinsfile by modifying the `options` block: `options { timeout(time: 120, unit: 'MINUTES') }` for the entire pipeline, or add `timeout(time: 30, unit: 'MINUTES')` to a specific stage.
  2. 70% success Optimize the pipeline to reduce execution time by parallelizing stages with `parallel` directive: `stage('Build and Test') { parallel { stage('Build') { ... } stage('Test') { ... } } }`
    Optimize the pipeline to reduce execution time by parallelizing stages with `parallel` directive: `stage('Build and Test') { parallel { stage('Build') { ... } stage('Test') { ... } } }`

中文步骤

  1. Increase the timeout in the Jenkinsfile by modifying the `options` block: `options { timeout(time: 120, unit: 'MINUTES') }` for the entire pipeline, or add `timeout(time: 30, unit: 'MINUTES')` to a specific stage.
  2. Optimize the pipeline to reduce execution time by parallelizing stages with `parallel` directive: `stage('Build and Test') { parallel { stage('Build') { ... } stage('Test') { ... } } }`

Dead Ends

Common approaches that don't work:

  1. Removing the timeout option entirely from the Jenkinsfile 30% fail

    Without a timeout, the pipeline can run indefinitely, consuming resources and potentially blocking the executor queue.

  2. Setting the timeout to a very high value (e.g., 9999 minutes) to avoid the error 50% fail

    This masks the underlying issue (e.g., a stuck step or resource contention) and can lead to resource exhaustion.