Upgrading to new codecov uploader in circleci


I’m upgrading the orb in circleci to use v3.1.1 which uses the new codecov uploader. It looks like the upload works but the build is marked as a failure because codecov seems to be returning an exit code of 4. Mainly I want to know where the exit code is coming from and what it means.

Commit SHAs

Private repository


Private repository

CI/CD or Build URL



v3.1.1 circleci orb

Codecov Output

#!/bin/bash -eo pipefail
chmod +x $filename
[[ -n “test-results/junit/.json" ]] && args+=( "-f test-results/junit/.json” )
[[ -n “-v” ]] && args+=( “-v” )
curl -H “Accept: application/json” “https://uploader.codecov.io/${os}/latest” | grep -o ‘“version”:“v[0-9._]+”’ | head -1
-Q “codecov-circleci-orb-3.1.0”
-F “client”

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 642 100 642 0 0 23777 0 --:–:-- --:–:-- --:–:-- 23777

Exited with code exit status 4
CircleCI received exit code 4

Expected Results


Actual Results


Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Som more information. I removed the circleci orb and just downloaded codecov, verified the signature and ran codecov explicitly. It is definitely codecov that is generating the non-zero exit code.

Can anyone tell me why codecov is exiting with a status code of 4?

I hit the same thing. The only thing I could think of was it was running on a Ubuntu VM. I had to run it under a docker container (node:slim) to get it to work.

So Docker with node:slim = works
Docker with alpine = works
Ubuntu VM: exit status 4, no other debug info

I figured out the issue. If NODE_OPTIONS is set as an environment variable to --max-old-space-size=4096 (or any value (we use 8192 so webpack doesn’t run out of memory)) the pkg library that codecov uses will fail to run the app and call process.exit(4). I filed a bug here: codecov exits with status code 4 if NODE_OPTIONS is set · Issue #475 · codecov/uploader · GitHub

Just invoke unset NODE_OPTIONS before running codecov and it should work.

1 Like