GitLab: get_sources fails with an HTTP/2 error
Sometimes a job fails in its get_sources step with a cURL error from git fetch. GitLab's workaround is to make Git and libcurl use HTTP/1.1 (GitLab docs: job troubleshooting, checked November 19, 2026). The log shows:
++ git -c 'http.userAgent=gitlab-runner <version>' fetch origin +<sha>:refs/pipelines/<id> ... error: RPC failed; curl 16 HTTP/2 send again with decreased length fatal: ...
Fix, per job
Set Git's HTTP version in a pre_get_sources_script hook of the job:
job_name:
hooks:
pre_get_sources_script:
- git config --global http.version "HTTP/1.1"
To see the failed job and its log in the IDE: Pipelines and Jobs Inbox for GitLab CI, a plugin for JetBrains IDEs, shows next to a failed job its status, how long it ran and the message GitLab gives for the failure, and opens the job's log in a console viewer at the bottom of the IDE.
Fix, on the runner
Add Git configuration environment variables to the runner's config.toml, so every job of that runner gets them:
[[runners]] ... environment = [ "GIT_CONFIG_COUNT=1", "GIT_CONFIG_KEY_0=http.version", "GIT_CONFIG_VALUE_0=HTTP/1.1" ]
Retry the job after the change. The hook fixes one job and needs no access to the runner; the config.toml change covers every job of that runner.
GitLab pipelines in IntelliJ IDEA
Pipelines and Jobs Inbox for GitLab CI, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a failed job with its status, how long it ran and the message GitLab gives for the failure, and opens the job's log in a console viewer at the bottom of the IDE, searchable, following a running job as it writes. You can retry the job from the IDE (Pro). Reading is free; retrying, cancelling and running are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab job dropped as stuck or over its timeout · GitLab job log refused or empty · GitLab "Failed to pull image" (job token allowlist) · GitLab pipeline or job refused (400, 403, 409, 429)