# Upgrading to new codecov uploader in circleci

**URL:** <https://community.codecov.com/t/upgrading-to-new-codecov-uploader-in-circleci/3305>\
**Category:** Support\
**Created:** [October 27, 2021, 3:55pm UTC](https://community.codecov.com/t/upgrading-to-new-codecov-uploader-in-circleci/3305 "2021-10-27T15:55:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gclements-chwy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gclements-chwy/32/2171_2.png) [@gclements-chwy](https://community.codecov.com/u/gclements-chwy)\
**Post date:** [October 27, 2021, 3:55pm UTC](https://community.codecov.com/t/upgrading-to-new-codecov-uploader-in-circleci/3305/1 "2021-10-27T15:55:55Z")

</div>

### Description

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.

 ![Screen Shot 2021-10-27 at 11.43.41 AM](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/e/e6204a3228de596f10f8115887bf84c3ed5ba65d.png)

### Commit SHAs

Private repository

### Repository

Private repository

### CI/CD or Build URL

circleci

### Uploader

v3.1.1 circleci orb

### Codecov Output

#!/bin/bash -eo pipefail  
chmod +x $filename  
args=()  
[[-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](https://uploader.codecov.io/$%7Bos%7D/latest)” | grep -o ‘"version":"v[0-9.\_]+"’ | head -1  
./$filename   
-Q “codecov-circleci-orb-3.1.0”   
-t “${CODECOV\_TOKEN}”   
-n “${CIRCLE\_BUILD\_NUM}”   
-F “client”   
${args[@]}

% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
100 642 100 642 0 0 23777 0 --:–:-- --:–:-- --:–:-- 23777  
“version”:“v0.1.8”

Exited with code exit status 4  
CircleCI received exit code 4

### Expected Results

Success

### Actual Results

Failure

### Additional Information

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

---

<div class="post-metadata">

**Author:** ![gclements-chwy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gclements-chwy/32/2171_2.png) [@gclements-chwy](https://community.codecov.com/u/gclements-chwy)\
**Post date:** [October 28, 2021, 3:56pm UTC](https://community.codecov.com/t/upgrading-to-new-codecov-uploader-in-circleci/3305/2 "2021-10-28T15:56:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![chris.jackson.coil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/chris.jackson.coil/32/2174_2.png) [@chris.jackson.coil](https://community.codecov.com/u/chris.jackson.coil)\
**Post date:** [October 28, 2021, 8:31pm UTC](https://community.codecov.com/t/upgrading-to-new-codecov-uploader-in-circleci/3305/3 "2021-10-28T20:31:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gclements-chwy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gclements-chwy/32/2171_2.png) [@gclements-chwy](https://community.codecov.com/u/gclements-chwy)\
**Post date:** [October 28, 2021, 9:00pm UTC](https://community.codecov.com/t/upgrading-to-new-codecov-uploader-in-circleci/3305/4 "2021-10-28T21:00:30Z")

</div>

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](https://github.com/codecov/uploader/issues/475)

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