# CircleCI orb fails to upload quite often

**URL:** <https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572>\
**Category:** Bug Fixes\
**Created:** [June 10, 2020, 8:13pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572 "2020-06-10T20:13:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![joelpoloney](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/joelpoloney/32/616_2.png) [@joelpoloney](https://community.codecov.com/u/joelpoloney)\
**Post date:** [June 10, 2020, 8:13pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/1 "2020-06-10T20:13:10Z")

</div>

### Description

I’m seeing that the uploading of reports fails quite often on our project. Generating the reports works just fine, but when we run the `codecov/upload` step, we get failures. This causes some wonkiness in our reports because an entire section is missing.

### Repository

Private repo

### CI/CD

CircleCI

### Uploader

CircleCI Orb [GitHub - codecov/codecov-circleci-orb](https://github.com/codecov/codecov-circleci-orb/)

### Commit SHAs

We’re using version `1.1.0` of the orb. But this was happening on the previous release as well.

### Codecov YAML

```auto
coverage:
  range: 70..100
  round: down
  precision: 2

fixes:
  - 'workspace/::'

```

### Codecov Output

```bash
#!/bin/bash -eo pipefail
curl -s https://codecov.io/bash | bash -s -- \
  -f "packages/web/coverage/coverage-final.json" \
  -t "${CODECOV_TOKEN}" \
  -n "${CIRCLE_BUILD_NUM}" \
  -y ".codecov.yml" \
  -F "web" \
  -Z || echo 'Codecov upload failed'
Codecov upload failed
CircleCI received exit code 0

```

### Steps to Reproduce

1. Add orb to CircleCI config. Here’s our CircleCI config.yml (note: all of our packages use the `flags` option):

```yaml
- codecov/upload:
    file: packages/web/coverage/coverage-final.json
    flags: web

```

1. Wait for CircleCI to build
2. Observe some uploads fail

**Expected behavior:** [What you expect to happen]

Not to fail.

**Actual behavior:** [What actually happens]

Fails.

**Flakiness?** [Does this happen all the time or only sometimes?]

Only sometimes, hard to give a percentage… maybe 5-10% of the time.

### Additional Information

It’s possible this is a timeout because this particular step took 2m9s whereas our other 6 uploads took 2s each and succeeded.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [June 10, 2020, 8:16pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/2 "2020-06-10T20:16:49Z")

</div>

Thanks @joelpoloney, could you supply a commit SHA for this so I can dig in?

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [June 10, 2020, 8:37pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/4 "2020-06-10T20:37:23Z")

</div>

@joelpoloney, we had an [incident](https://status.codecov.io/incidents/mhdmp5ymkmnx) earlier that has been resolved and might be why you were experiencing this issue. Would you be able to log out of [Codecov.io](http://Codecov.io), clear your cookies, and log back in? This should resolve your problem.

---

<div class="post-metadata">

**Author:** ![emdob](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@emdob](https://community.codecov.com/u/emdob)\
**Post date:** [June 15, 2020, 9:54pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/5 "2020-06-15T21:54:43Z")

</div>

I am also experiencing upload failures when using CircleCI in a private GitHub repo. The codecov stage takes about 30mins and then it fails without publishing the report. Any idea how this can be fixed?  
==\> Gzipping contents  
==\> Uploading reports  
url: [https://codecov.io](https://codecov.io)  
query: branch=pull%2F33&commit=83559ae44b08bb506b158bd7cd90f6f38b1d2278&build=89&…  
 → Pinging Codecov  
[https://codecov.io/upload/v4?](https://codecov.io/upload/v4?)…  
 → Uploading  
X\> Failed to upload  
 → Sleeping for 30s and trying again…  
 → Pinging Codecov  
 → Uploading  
X\> Failed to upload  
 → Sleeping for 30s and trying again…  
 → Uploading to Codecov  
 → Sleeping for 30s and trying again…  
 → Sleeping for 30s and trying again…  
 → Sleeping for 30s and trying again…  
 → Sleeping for 30s and trying again…  
X\> Failed to upload coverage reports

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [June 18, 2020, 2:44am UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/6 "2020-06-18T02:44:47Z")

</div>

Hi @emdob, what uploader are you using and what version?

---

<div class="post-metadata">

**Author:** ![joelpoloney](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/joelpoloney/32/616_2.png) [@joelpoloney](https://community.codecov.com/u/joelpoloney)\
**Post date:** [July 14, 2020, 6:11pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/7 "2020-07-14T18:11:08Z")

</div>

@tom This issue isn’t with the Codecov website or cookies or anything like that. It’s specifically when the CircleCI orb tries uploading and after 2 minutes it fails. This is still consistently happening a few times a week for us.

---

<div class="post-metadata">

**Author:** ![joelpoloney](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/joelpoloney/32/616_2.png) [@joelpoloney](https://community.codecov.com/u/joelpoloney)\
**Post date:** [July 14, 2020, 6:15pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/8 "2020-07-14T18:15:26Z")

</div>

Here’s a git commit hash for one that failed 2/7 times from this morning: `8df1469538963bddc28210cdbb63bfee5c88578a`.

This is what we see:

 ![Screen Shot 2020-07-14 at 11.14.33 AM](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/1X/c6cded025194bfbd9c2e32a0ac5fb7dcecfa035a.png)

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [July 15, 2020, 2:53am UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/9 "2020-07-15T02:53:46Z")

</div>

@joelpoloney, is there no other output on that failed bash upload? We typically expect to at least see the bash script running.

---

<div class="post-metadata">

**Author:** ![joelpoloney](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/joelpoloney/32/616_2.png) [@joelpoloney](https://community.codecov.com/u/joelpoloney)\
**Post date:** [July 15, 2020, 3:21am UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/10 "2020-07-15T03:21:59Z")

</div>

Nope that’s all there is. Our CircleCI `config.yml` has steps that look like:

```auto
      - codecov/upload:
          file: packages/notifications/coverage/coverage-final.json
          flags: notifications

```

and this is all we see 🤷‍♂️We’re going to try moving off the orb and writing our own script that wraps the codecov npm commands and will see if that’s any better for us.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [July 16, 2020, 3:46pm UTC](https://community.codecov.com/t/circleci-orb-fails-to-upload-quite-often/1572/11 "2020-07-16T15:46:55Z")

</div>

@joelpoloney, before you do that, would you be open to trying the [bash script](https://github.com/codecov/codecov-bash)? I’d at least like to see more error logs on why this is happening, and I think directly using the script should give us some output.
