WARNING: step_script could not run to completion because the timeout was exceeded

Problem to solve

WARNING: step_script could not run to completion because the timeout was exceeded. For more control over job and script timeouts

Describe your question in as much detail as possible:

I have a very long running job and I unable change the timeout from the default value of 60 minutes.

I have my project Settings > CI/CD > General pipelines > Timeout to 3 hours

Things I have tried

  • I’ve added the timeout: 7 hours to the job.
  • I’ve added the CI_JOB_TIMEOUT: 10800 variable to the job
  • Confirm CI_JOB_TIMEOUT value is 10800
.windows-job:
  image: ubuntu:jammy
  stage: build
  variables:
    CI_JOB_TIMEOUT: 10800     # https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
  before_script:
    - echo $CI_JOB_TIMEOUT
    - DEBIAN_FRONTEND=noninteractive apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install wget gpg lsb-release
    - wget --quiet --output-document - https://apt.releases.hashicorp.com/gpg | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/hashicorp-archive-keyring.gpg --import
    - chmod 644 /usr/share/keyrings/hashicorp-archive-keyring.gpg
    - |-
      cat << EOF | tee /etc/apt/sources.list.d/hashicorp.list
      deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main
      EOF
    - DEBIAN_FRONTEND=noninteractive apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install packer
    - packer plugins install github.com/hashicorp/vsphere
    - packer --version

.windows10-job:
  extends: .windows-job
  script:
    - time custom_build_scripts/build_vsphere_windows_10.sh
  timeout: 7 hours

windows10-manual:
  extends: .windows10-job
  variables:
    CI_JOB_TIMEOUT: 10800 # https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
  when: manual

Snippets from the output of the Build > Pipelines

Running with gitlab-runner 17.0.0 (44feccdf)
  on docker tyeA1suek, system ID: r_6yljWwoSuVo3

Preparing the "docker" executor
Using Docker executor with image ubuntu:jammy ...
Pulling docker image ubuntu:jammy ...
<snip>
$ echo $CI_JOB_TIMEOUT    # confirmation of the value
10800
<snip>
==> vsphere-iso: Waiting for WinRM to become available...
WARNING: step_script could not run to completion because the timeout was exceeded. For more control over job and script timeouts see: https://docs.gitlab.com/ee/ci/runners/configure_runners.html#set-script-and-after_script-timeouts
ERROR: Job failed: execution took longer than 1h0m0s seconds

Steps to reproduce

Use the above .gitlab-ci.yml and commit to a properly configured gitlab instance with properly configured runners.

Configuration

Versions

  • Self-managed
  • GitLab.com SaaS
  • Self-hosted Runners

Versions

System information
System:		
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	3.1.4p223
Gem Version:	3.5.7
Bundler Version:2.5.8
Rake Version:	13.0.6
Redis Version:	7.0.15
Sidekiq Version:7.1.6
Go Version:	unknown

GitLab information
Version:	16.11.1-ee
Revision:	5f640bd48cc
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	14.11
URL:		https://gitlab.xxx.real-time.com
HTTP Clone URL:	https://gitlab.xxx.real-time.com/some-group/some-project.git
SSH Clone URL:	git@gitlab.xxx.real-time.com:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers:

GitLab Shell
Version:	14.35.0
Repository storages:
- default: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
- default Version: 	16.11.1
- default Git Version: 	2.43.2
  • GitLab Runner, if self-hosted (Web /admin/runners or CLI gitlab-runner --version):
Version:      17.0.0
Git revision: 44feccdf
Git branch:   17-0-stable
GO version:   go1.21.9
Built:        2024-05-16T13:46:14+0000
OS/Arch:      linux/amd64