GitLab:ジョブが詰まった・時間切れで落とされた
ジョブが長いあいだ進まないと、GitLab はそのジョブを落とし、失敗の理由を記録します。しきい値はジョブの状態で決まります(GitLab の説明「ジョブのトラブルシューティング」・2026年10月28日に確認)。ジョブはその理由の文を添えて失敗します。たとえば:
The job was stuck in pending state with no matching runners available. Check your runner tags or configuration The job was running but showed no activity for an extended period. Check your job script or try again The running job exceeded the maximum execution time set for the job
どのしきい値で、どの理由になるか
- 待ち(合うランナーあり):24時間で落とされ、
stuck_pending_with_matching_runnersになります。文は「The job was stuck in pending state with matching runners available. Check your job configuration or try again」(合うランナーがあるのに待ちのまま詰まった。ジョブの設定を見るか、やり直す)。 - 待ち(合うランナーなし):1時間で落とされ、
stuck_pending_no_matching_runnersになります。文は「The job was stuck in pending state with no matching runners available. Check your runner tags or configuration」(合うランナーが無く待ちのまま詰まった。ランナーのタグか設定を見る)。 - 実行中(更新なし):更新の無いまま30分で落とされ、
no_updates_runningになります。文は「The job was running but showed no activity for an extended period. Check your job script or try again」(実行中のまま長く動きが無かった。ジョブのスクリプトを見るか、やり直す)。 - 取り消し中(更新なし):更新の無いまま30分で落とされ、
no_updates_cancelingになります。文は「The job was canceling but showed no activity for an extended period. Try again」(取り消し中のまま長く動きが無かった。やり直す)。 - 実行中(時間の上限を超えた):設定した時間の上限+15分で落とされ、
server_timeout_runningになります。文は「The running job exceeded the maximum execution time set for the job」(実行中のジョブが、ジョブに設定した最大の実行時間を超えた)。 - 取り消し中(時間の上限を超えた):設定した時間の上限+15分で落とされ、
server_timeout_cancelingになります。文は「The canceling job exceeded the maximum execution time set for the job」(取り消し中のジョブが、最大の実行時間を超えた)。
文は GitLab のソース(app/presenters/commit_status_presenter.rb・2026年10月28日に読んだもの)のとおりです。古いジョブや、19.0 より前の GitLab では、これらが置き換えた理由が出ることがあります。stuck_or_timeout_failure「There has been a timeout failure or the job got stuck. Check your timeout limits or try again」(時間切れか、ジョブが詰まった。時間の上限を見るか、やり直す)は、GitLab 19.0 以降は過去の記録のためだけに残っています。job_execution_timeout「The script exceeded the maximum execution time set for the job」(スクリプトが最大の実行時間を超えた)は、GitLab 19.1 で再実行の値としては非推奨になりました(retry:when)。待たずにすぐ失敗したジョブは、これらで落とされたのではありません。
ジョブが落ちた理由をジョブの横で見るなら:JetBrains IDE のプラグイン Pipelines and Jobs Inbox for GitLab CI は、失敗したジョブの横に状態・動いた時間・GitLab が返す失敗の文を出し、ジョブのログを IDE の下のコンソールで開きます。
どの時間の上限が効くか
- プロジェクト:プロジェクトの Settings > CI/CD で General pipelines を開き、Timeout に分か、
2 hoursのような書き方で入れます。10分以上・1か月未満で、既定は60分です。超えたジョブは失敗になります(ジョブの時間の上限)。 - ランナー:ランナーには最大のジョブの時間を持たせられ、プロジェクトの上限より短いときに使われます。ランナーが30分・プロジェクトが2時間なら、ジョブは30分で時間切れです。Maximum job timeout に秒で入れ(600 以上)、API なら
PUT /runners/:idのmaximum_timeoutです。GitLab.com の GitLab が用意するインスタンスのランナーは上書きできず、プロジェクトの上限が効きます(最大のジョブの時間)。 - ジョブ:
timeoutのキーワードで1つのジョブの上限を決めます。プロジェクトの上限より長くできますが、ランナーの上限より長くはできず、defaultには書けません(timeout)。 - 出力が無い:プロジェクトの設定のページは、1時間出力の無いジョブは上限にかかわらず落とされると付け加え、進み具合を出し続けるスクリプトを勧めています。
直すところ
- 合うランナーが無い:ジョブの
tagsとランナーのタグを見比べます。ランナーはジョブのタグを全部持っている必要があります。タグ付きのジョブだけを動かすランナーはタグの無いジョブを待たせたままにし、タグの無いランナー(タグの無いジョブを動かす設定)はタグ付きのジョブを待たせたままにします(ランナーのタグの使い方)。GitLab は、ランナーが満たさないことのある条件に保護(protected)も挙げています。保護されたランナーは、保護されたブランチか保護されたタグのジョブしか動かしません。 - 合うランナーがあるのに待ちのまま:文のとおり、ジョブの設定を見るか、やり直します。
- 実行中に動きが無い:スクリプトが止まったか、ランナーの接続が切れたかです(GitLab の
retry:whenの説明)。長い段は進み具合を出すようにし、ランナーを確かめます。 - 時間の上限を超えた:ランナーの上限の範囲で、プロジェクトの Timeout かジョブの
timeoutを上げるか、ジョブを短くします。 - この失敗だけ再実行する:
retry:whenとretry:max(0・1・2)で、挙げた失敗の理由のときだけジョブをやり直せます。
test:
script: rspec
timeout: 2h
retry:
max: 2
when:
- stuck_pending_no_matching_runners
- no_updates_running
- server_timeout_running
ほかの失敗の理由と文
失敗したジョブの画面には、失敗の理由ごとの文が出ます(スクリプトそのものが失敗した script_failure のときは出ません)。同じソースにある残りの理由(failure_reason)と文は次のとおりです。(retry)と付けたのは retry:when に書ける値です。いくつかは、文の後に How do I fix it?(直し方)のリンクが付きます(GitLab の commit_status_presenter.rb と retry:when・2026年11月3日に読んだもの)。
- ランナー:
runner_system_failure(retry)「There has been a runner system failure, please try again」(ランナーのシステムが失敗した。やり直す)。runner_configuration_error(retry)「There has been a configuration error. Check your job configuration or contact your runner administrator.」(設定の誤り。ジョブの設定を見るか、ランナーの管理者に連絡する)。イメージやタグの誤り、合わない pull policy、ランナーの設定の誤りなどです。runner_external_dependency_failure(retry)「The runner could not reach an external dependency. Please try again.」(ランナーが外の依存先に届かなかった。やり直す)。ネットワークや DNS のせいでイメージのレジストリに届かないときなどです。runner_interrupted(retry)「The runner process was interrupted before this job could finish. The job is safe to retry.」(ジョブが終わる前にランナーのプロセスが止まった。やり直して大丈夫)。再起動、シャットダウン、ホストの回収などです。GitLab 19.1 からは、それまでrunner_system_failureだった失敗の一部が、この2つになります。runner_unsupported(retry)「No runners support the requirements to run this job.」(このジョブの条件に対応するランナーが無い)。no_matching_runner「No matching runner available」(合うランナーが無い)。ip_restriction_failure「This job could not be executed because group IP address restrictions are enabled, and the runner's IP address is not in the allowed range.」(グループの IP アドレスの制限が有効で、ランナーの IP アドレスが許された範囲に無いので実行できなかった)。 - GitLab の側:
unknown_failure(retry)「There is an unknown failure, please try again」(原因の分からない失敗。やり直す)。api_failure(retry)「There has been an API failure, please try again」(API の失敗。やり直す)。scheduler_failure(retry)「The scheduler failed to assign job to the runner, please try again or contact system administrator」(スケジューラーがジョブをランナーに割り当てられなかった。やり直すか、管理者に連絡する)。data_integrity_failure(retry)「There has been an unknown job problem, please contact your system administrator with the job ID to review the logs」(ジョブに原因の分からない問題が起きた。ジョブの ID を添えて、管理者にログを見てもらう)。job_router_failure「The Job Router failed to run this job.」(Job Router がこのジョブを実行できなかった)。後ろに、記録された詳細か「Please contact your administrator.」(管理者に連絡してください)が続きます。 - スクリプトの前:
missing_dependency_failure「There has been a missing dependency failure」(依存先が無くて失敗した)。ジョブの画面では、代わりに「This job could not start because it could not retrieve the needed artifacts.」(必要なアーティファクトを取れなかったので、ジョブを始められなかった)と出ます。ジョブの名前が分かるときは「...artifacts: build, test」のように続き、dependencies とよくある原因へのリンクが付きます(GitLab の build_details_entity.rb)。unmet_prerequisites(retry)「The job failed to complete prerequisite tasks」(前提の作業を終えられなかった)。stale_schedule(retry)「Delayed job could not be executed by some reason, please try again」(遅らせたジョブを、何かの理由で実行できなかった。やり直す)。archived_failure(retry)「The job is archived and cannot be run」(ジョブがアーカイブされていて実行できない)。rules_parse_failure「This job could not be executed because its rules could not be evaluated. Check the rules keyword in the CI/CD configuration for this job.」(rules を評価できなかったので実行できなかった。このジョブの rules を見る)。後ろに詳細が続きます。environment_creation_failure「This job could not be executed because it would create an environment with an invalid parameter.」(正しくないパラメーターの環境を作ることになるので実行できなかった)。pipeline_variables_file_missing「This job could not be executed because the pipeline variables file is missing from storage. Run a new pipeline.」(パイプラインの変数のファイルがストレージに無いので実行できなかった。新しいパイプラインを走らせる)。job_token_expired「The CI job token has expired. The job may have exceeded the maximum time limit.」(CI のジョブトークンの期限が切れた。ジョブが時間の上限を超えたのかもしれない)。 - トリガーのジョブ:
invalid_bridge_trigger「This job could not be executed because downstream pipeline trigger definition is invalid」(下流のパイプラインのトリガーの定義が正しくない)。downstream_project_trigger_resolved_to_empty「This job could not be executed because the trigger:project value resolved to a blank value. Check that the variables or inputs used in trigger:project are set.」(trigger:project の値が空になった。trigger:project で使う変数や inputs が設定されているか見る)。downstream_bridge_project_not_found「This job could not be executed because downstream bridge project could not be found」(下流のプロジェクトが見つからない)。insufficient_bridge_permissions「This job could not be executed because of insufficient permissions to create a downstream pipeline」(下流のパイプラインを作る権限が足りない)。upstream_bridge_project_not_found「This job could not be executed because upstream bridge project could not be found.」(上流のプロジェクトが見つからない)。insufficient_upstream_permissions「This job could not be executed because of insufficient permissions to track the upstream project.」(上流のプロジェクトを追う権限が足りない)。pipeline_loop_detected「This job could not be executed because it would create infinitely looping pipelines」(パイプラインが果てしなく回り続けることになる)。bridge_pipeline_is_child_pipeline「This job belongs to a child pipeline and cannot create further child pipelines」(子パイプラインのジョブなので、さらに子パイプラインを作れない)。reached_max_descendant_pipelines_depth「You reached the maximum depth of child pipelines」(子パイプラインの深さの上限に届いた)。reached_max_pipeline_hierarchy_size「The downstream pipeline tree is too large」(下流のパイプラインの木が大きすぎる)。reached_downstream_pipeline_trigger_rate_limit「Too many downstream pipelines triggered in the last minute. Try again later.」(直前の1分で下流のパイプラインを起こしすぎた。後でやり直す)。downstream_pipeline_creation_failed「The downstream pipeline could not be created」(下流のパイプラインを作れなかった)。 - プロジェクト・ユーザー・上限:
ci_quota_exceeded「No more compute minutes available」(コンピューティング時間が残っていない)。trace_size_exceeded「The job log size limit was reached」(ジョブのログの大きさの上限に届いた)。builds_disabled「The CI/CD is disabled for this project」(このプロジェクトでは CI/CD が無効)。project_deleted「The job belongs to a deleted project」(消されたプロジェクトのジョブ)。user_blocked「The user who created this job is blocked」(このジョブを作ったユーザーがブロックされている)。 - シークレットと ID トークン:
secrets_provider_not_found「The secrets provider can not be found. Check your CI/CD variables and try again.」(シークレットの提供元が見つからない。CI/CD の変数を見てやり直す)。secrets_manager_access_denied「This job failed to retrieve secrets because it does not have access to GitLab Secrets Manager.」(GitLab Secrets Manager を使えないので、シークレットを取れなかった)。secrets_manager_source_not_accessible「This job failed to retrieve secrets because a secret source group is not the project group or one of its parent groups.」(シークレットの元のグループが、プロジェクトのグループでもその親でもないので取れなかった)。id_token_burned_project_path「ID token issuance is disabled in CI because a project path in the `sub` claim was previously used by a different project.」(`sub` クレームにあるプロジェクトのパスが、前に別のプロジェクトで使われていたので、CI での ID トークンの発行が止められている)。続けて、ci_id_token_sub_claim_componentsをパスに合う ID の要素(project_id・job_project_id・source_project_id)から始め、クラウド側の信頼のポリシーもそれに合わせるよう書いてあります。 - デプロイ:
forward_deployment_failure「The deployment job is older than the previously succeeded deployment job, and therefore cannot be run」(前に成功したデプロイのジョブより古いので実行できない)。deployment_rejected「This deployment job was rejected.」(このデプロイのジョブは却下された)。保護された環境と、古いデプロイのジョブは GitLab の「You are not authorized to run this manual job」へ。 - GitLab Duo のフロー:
duo_workflow_not_allowed「Duo Agent Platform cannot run on this runner. Duo jobs run only on instance-wide or top-level group runners, and some flows only on GitLab-hosted runners. Be sure to remove the gitlab--duo tag from this runner to avoid it picking these jobs.」(このランナーでは Duo Agent Platform を動かせない。Duo のジョブが動くのはインスタンス全体かトップレベルのグループのランナーだけで、GitLab のホストするランナーでしか動かないフローもある。このジョブを拾わないよう、このランナーから gitlab--duo のタグを外すこと)。gitlab--duoのタグのあるランナーがフローのジョブを拾うので、タグはインスタンスのランナーか、トップレベルのグループのランナーだけに付け、Docker のイメージを動かせる executor にします(docker・docker-autoscaler・kubernetes。shellは使えません)。GitLab Self-Managed では、機能フラグduo_runner_restrictionsを切ると、プロジェクトとサブグループのランナーも拾えます。duo_workflow_connection_failure「The Duo Workflow job failed because the runner could not connect to the Duo Agent Platform. Check your network configuration and try again.」(ランナーが Duo Agent Platform につなげなかったので、ジョブが失敗した。ネットワークの設定を見て、もう一度試すこと)。GitLab Self-Managed では、ランナーから Agent Platform への外向きの接続を許してください(GitLab の commit_status_presenter.rb・フローの実行の文書・トラブルシューティングの文書)。
IntelliJ IDEA で GitLab のジョブを見るなら
Lesstep の Pipelines and Jobs Inbox for GitLab CI は、JetBrains IDE(2024.1 以降)のプラグインです。GitLab のプロジェクトのパイプラインを、ジョブを段ごとに並べて一覧にします。失敗したジョブの横には、状態・ジョブが動いた時間・GitLab が返す失敗の文(上のような文。スクリプトが失敗しただけのときは GitLab は文を返しません)を出し、ジョブのログを IDE の下のコンソールで開きます。見るのは無料、再実行・取り消し・実行は Pro(月 US$1.50・30日間の無料試用つき)です。画面は日本語です。
GITLAB は GitLab Inc. の商標、IntelliJ IDEA は JetBrains s.r.o. の商標です。このページは GitLab Inc.・JetBrains のいずれとも提携しておらず、承認も受けていません。
ほかに:GitLab のジョブのログが見えない・空 · GitLab 18.0 のあとの「This job does not have a trace.」 · GitLab のパイプラインやジョブの断り(400・403・409・429) · GitLab のパイプラインがジョブ0件で失敗 · GitLab のジョブがリソース待ちで進まない · GitLab の「Insufficient permissions to set pipeline variables」 · GitLab の 404「Group Not Found」 · GitLab の「insufficient_scope」 · JetBrains の IDE で GitLab のパイプラインを見る · English