GitLab: "Job's log exceeded limit of 4194304 bytes"
The line in the job log is a size cap on the log, not a failure of the script. GitLab Runner has an output_limit setting, "Maximum build log size in kilobytes", with a default of 4096 (4 MB). Jobs that exceed the runner limit "continue to run, but the log is truncated when it hits the limit" (GitLab: CI/CD limits and GitLab Runner advanced configuration, checked November 22, 2026).
Job's log exceeded limit of 4194304 bytes.
Where 4194304 comes from
The runner setting is in kilobytes and its default is 4096. 4096 KB is 4096 x 1024 = 4194304 bytes, the number in the message. A runner whose output_limit was changed has a different limit, so a different number is expected there. The GitLab documentation does not print the message itself; it appears in public issues, for example a GitLab issue titled "Job's log exceeded limit of 4194304 byte", whose reporter asks how to increase the size, and a GitLab Runner issue that shows the line as Job's log exceeded limit of 4194304 bytes. in a job log. Neither issue page contains an answer.
To see why a job failed, right next to the job: 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.
Two different limits
- The runner limit (4 MB by default): the job keeps running and the log is cut off.
- The GitLab limit (100 MB by default): "The job log file size limit in GitLab is 100 megabytes by default. Any job that exceeds the limit is marked as failed, and dropped by the runner." (GitLab: CI/CD limits, under Maximum file size for job logs.)
A job that shows the 4194304 line and still ends green was cut off at 4 MB, so the lines after the cut are missing from the log.
Raise the runner limit
This needs access to the runner, so it does not apply to a runner someone else manages. In the config.toml of the runner, set output_limit in the [[runners]] section, in kilobytes. The file is at /etc/gitlab-runner/ when the runner runs as root on a *nix system, at ~/.gitlab-runner/ when it runs as non-root on *nix, and in the current directory on other systems (GitLab: advanced configuration).
[[runners]] name = "RUNNER_NAME" output_limit = 16384
16384 is an example value (16 MB), not a recommendation. On Kubernetes, the Runner issue above shows a reporter trying the environment variable RUNNER_OUTPUT_LIMIT with 512000 and reporting that the setting was still not applied after a redeploy; the issue page shows no resolution, so check the effect in a job log after any change.
Keep the output instead of the log
When the runner cannot be changed, write the long output to a file in the job and keep the file as a job artifact. artifacts:paths takes paths relative to the project directory, and artifacts:when accepts on_success (the default), on_failure and always, which uploads artifacts "except when jobs time out" (GitLab: CI/CD YAML syntax reference).
job:
script:
- ./run-tests.sh > test-output.log 2>&1
artifacts:
when: always
paths:
- test-output.log
Here ./run-tests.sh stands for the command that prints too much. Note that > test-output.log 2>&1 hides the output from the job log, and the job fails only if the command exits with a non-zero code.
GitLab jobs in IntelliJ IDEA
Pipelines and Jobs Inbox for GitLab CI, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of your GitLab projects with their jobs by stage. Next to a failed job it shows the status, how long the job ran and the message GitLab gives for the failure, such as the ones above (GitLab gives none for a script that failed), and it opens the log of a job in a console viewer at the bottom of the IDE. 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 "This job does not have a trace." after 18.0 · GitLab artifacts: no files to upload · GitLab needed artifacts · GitLab pipeline or job refused (400, 403, 409, 429) · GitLab pipeline plugins for IntelliJ IDEA, compared · 日本語