Process completed with exit code 1 – Meaning, Causes, and How to Fix

CI Execution

Quick Answer

When a CI pipeline shows “Process completed with exit code 1”, it means a command or script inside the workflow failed.

The exit code itself is not the real error. It only indicates that the process ended unsuccessfully.

To identify the real cause, you should inspect the earlier job logs where the failing command usually prints its error message.

What this error means

The message “Process completed with exit code 1” appears when a command finishes execution and returns a non-zero status code.

In most operating systems and CI environments:

  • Exit code 0 → command succeeded
  • Non-zero exit code → command failed

Exit code 1 is commonly used as a general failure signal. It indicates that something went wrong during execution but does not specify the exact problem.

Because of this, CI systems simply report the exit code rather than the underlying error message. When developers encounter this message in build logs, the real issue usually appears several lines above the exit code output.

Why this happens

Continuous integration systems rely on operating system exit codes to determine whether a step succeeds.

Every command executed inside a pipeline returns a numeric status when it finishes. If the value is not zero, the CI runner marks the step as failed and stops the workflow.

The system then prints:

Process completed with exit code 1

The CI system is only reporting the final status of the command. The real failure may have occurred earlier during:

  • a build process
  • dependency installation
  • test execution
  • script execution

Because of this behavior, developers usually need to examine earlier log output to understand the real cause of the failure.

Exit code reference table

CI logs may display different exit codes depending on the type of failure. The table below summarizes several common ones.

Exit Code Meaning Typical Cause
0 Success Command executed successfully
1 General failure Script error, build failure, test failure
2 Command misuse Invalid syntax or incorrect arguments
126 Permission issue Command exists but cannot execute
127 Command not found Missing executable in PATH
128 Fatal Git error Repository access or Git failure
137 Process killed Container memory limit or system signal
255 Unknown fatal error Script or runtime crash

Common scenarios

Several situations frequently trigger exit code 1 in CI pipelines.

  • a build process fails due to compilation errors
  • unit tests fail during automated testing
  • required dependencies are missing
  • scripts are executed in the wrong directory
  • environment variables are not configured correctly

How to fix

Since exit code 1 only indicates failure, the solution depends on the underlying error printed earlier in the logs.

Scenario A — Build or test step failed

Why this happens

A compiler, build tool, or test framework encountered an error and returned a failure status.

How to fix it

  1. Open the CI job logs.
  2. Scroll upward from the exit code message.
  3. Locate the command that produced the first error output.
  4. Fix the underlying issue in the source code or build configuration.

Verification

  • run the build locally if possible
  • re-run the CI workflow
  • confirm the pipeline step completes successfully

Scenario B — Missing dependencies

Why this happens

The CI environment may not include required packages or runtime versions.

How to fix it

npm install

or

pip install -r requirements.txt

You should also verify that the correct runtime version is installed.

Verification

  • review the dependency installation logs
  • confirm no missing package errors appear

Scenario C — Incorrect CI configuration

Why this happens

The pipeline configuration references commands or paths that do not exist inside the runner environment.

How to fix it

  • verify that scripts referenced in the workflow exist
  • ensure the working directory is correct
  • confirm required environment variables are defined

Verification

After correcting the configuration, run the workflow again and confirm the step executes the expected command.

Example logs

Example of a failing build command:

Running npm run build
ERROR in src/app.js
Module not found: Cannot find module 'axios'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
Process completed with exit code 1

Another example from failing tests:

FAIL src/auth.test.js
Expected status code 200
Received 500

Test Suites: 1 failed
Tests:       2 failed
Process completed with exit code 1

How to confirm the issue is resolved

After fixing the underlying issue, run the pipeline again and review the logs.

Expected behavior:

  • the CI job completes successfully
  • the workflow proceeds to the next stage
  • the process exits with status code 0

You should no longer see:

Process completed with exit code 1

FAQ

What does “Process completed with exit code 1” mean?

It means a command inside the CI workflow failed and returned a non-zero exit status.

Where can I find the real error?

The actual error usually appears earlier in the job logs above the exit code message.

Does exit code 1 always mean a build failed?

Not necessarily. It may also be triggered by failing tests, missing dependencies, or incorrect scripts.

How can I debug exit code 1 locally?

Run the same command locally that the CI pipeline executes. This often reveals the real error more clearly.

Related errors

滚动至顶部