# Codecov: Failed to properly upload

**URL:** <https://community.codecov.com/t/codecov-failed-to-properly-upload/4242>\
**Category:** Bug Fixes\
**Created:** [March 31, 2023, 1:12pm UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242 "2023-03-31T13:12:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmoayyed](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mmoayyed/32/544_2.png) [@mmoayyed](https://community.codecov.com/u/mmoayyed)\
**Post date:** [March 31, 2023, 1:12pm UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242/1 "2023-03-31T13:12:19Z")

</div>

## Before submitting a topic, please confirm the following

I have searched for similar issues before creating this topic.  
 I have verified that my repository is using the [Codecov GitHub app](https://github.com/apps/codecov), if using GitHub  
 I have [validated](https://docs.codecov.com/docs/codecov-yaml#validate-your-repository-yaml) my `codecov.yaml` configuration file.  
 I have filled out the below sections to the best of my ability.  
 I understand that the community boards are a free, best-effort tool. While we hope to have someone on the Codecov team resolve your problem quickly, this is not always possible.

### Description

Somewehat recently, CodeCov upload operations for a public repository using the appropriate GH action seem to randomly fail to upload results. The error message is often about a gateway timeout, or google storage APIs failing to accept the request.

### CI/CD URL

An example: [https://github.com/mmoayyed/cas/actions/runs/4554798272/jobs/8033219021#step:8:57](https://github.com/mmoayyed/cas/actions/runs/4554798272/jobs/8033219021#step:8:57)

Here is another run where you’d see many CodeCov upload failures:  
[https://github.com/mmoayyed/cas/actions/runs/4566411516](https://github.com/mmoayyed/cas/actions/runs/4566411516)

### Codecov Output

```auto
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (671cf0d89d1c149f57e1a9a31f3fb567ab4209e4d5829f13ff7b8c104db7131f codecov)
==> Running version latest
==> Running version v0.4.0
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n ldapauthentication -Q github-action-3.1.1 -Z -f ./build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml -F ldapauthentication
[2023-03-29T14:43:53.002Z] ['info'] 
     _____ _
    / ____ | | |
   | | _____ | | ______  _______
   | | / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |__/ (_| (_) \ V /
    \ _____\___ / \ __,_|\___ |\ ___\___ / \_/

  Codecov report uploader 0.4.0
[2023-03-29T14:43:53.026Z] ['info'] => Project root located at: /home/runner/work/cas/cas
[2023-03-29T14:43:53.031Z] ['info'] -> Token found by environment variables
[2023-03-29T14:43:53.080Z] ['info'] Searching for coverage files...
[2023-03-29T14:43:55.359Z] ['info'] => Found 1 possible coverage files:
  ./build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
[2023-03-29T14:43:55.359Z] ['info'] Processing ./build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml...
[2023-03-29T14:43:55.583Z] ['info'] Detected GitHub Actions as the CI provider.
[2023-03-29T14:43:55.585Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.1-uploader-0.4.0&token= *******&branch=master&build=4554798272&build_url=https%3A%2F%2Fgithub.com%2F*** %2Fcas%2Factions%2Fruns%2F4554798272&commit=e47371a75a0454b7d1baa1d7e6c616f663088c2c&job=Tests+-+Ubuntu&pr=&service=github-actions&slug=***%2Fcas&name=ldapauthentication&tag=&flags=ldapauthentication&parent=
[2023-03-29T14:43:56.543Z] ['info'] https://app.codecov.io/github/***/cas/commit/e47371a75a0454b7d1baa1d7e6c616f663088c2c
https://storage.googleapis.com/codecov/v4/raw/2023-03-29/73A1E7171A8C172C16497ED22FF80BC3/e47371a75a0454b7d1baa1d7e6c616f663088c2c/8a8a7721-80c6-4bbc-922b-4a9dbed6bda0.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EJOGFN2JQ4OCTGA2MU5AEIT7OT5Z7HTFOAN2SPG4NWSN2UJYOY5U6LZQ%2F20230329%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20230329T144356Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=780d637db151da8c841eb84a7dddc248e519615da305351397c9461482fa8e1c
[2023-03-29T14:43:56.543Z] ['info'] Uploading...
[2023-03-29T14:44:01.553Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: getaddrinfo EAI_AGAIN storage.googleapis.com
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov' failed with exit code 255

```

### Additional Information

This seems to be quite random, and does not happen every time, for the same job, etc. I wonder if this can perhaps be improved with some sort of retry mechanism, for which I see there is a request on GH.

---

<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:** [April 3, 2023, 3:04am UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242/2 "2023-04-03T03:04:42Z")

</div>

@mmoayyed I have no idea why this is, I’ll take a look tomorrow morning

---

<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:** [April 5, 2023, 2:04pm UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242/3 "2023-04-05T14:04:46Z")

</div>

Hi @mmoayyed, ok, it looks like for the 2nd link where we are returning `There was an error fetching the storage URL during POST: 502 - ` that there was a short bit of downtime on our side.

The 1st link reads like a DNS error `getaddrinfo EAI_AGAIN storage.googleapis.com` which I think would probably be outside our control. I can’t imagine that that should happen again. Please correct me if I’m wrong.

---

<div class="post-metadata">

**Author:** ![mmoayyed](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mmoayyed/32/544_2.png) [@mmoayyed](https://community.codecov.com/u/mmoayyed)\
**Post date:** [April 5, 2023, 2:25pm UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242/4 "2023-04-05T14:25:41Z")

</div>

Thank you @tom! I will keep an eye on it and will report back if this popped up again.

---

<div class="post-metadata">

**Author:** ![mmoayyed](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mmoayyed/32/544_2.png) [@mmoayyed](https://community.codecov.com/u/mmoayyed)\
**Post date:** [June 9, 2023, 5:53am UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242/5 "2023-06-09T05:53:02Z")

</div>

This continues to show up at random:

> <https://github.com/mmoayyed/cas/actions/runs/5214849612>

```auto
5s
Run codecov/codecov-action@v3
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (02b055414cc124203ab061ffc45f5497ca39ede5e63a06717a6981c32d7b425f codecov)
==> Running version latest
==> Running version v0.5.0
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n activedirectory -Q github-action-3.1.4 -Z -f ./build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml -F activedirectory
[2023-06-08T19:28:04.628Z] ['info'] 
     _____ _
    / ____ | | |
   | | _____ | | ______  _______
   | | / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |__/ (_| (_) \ V /
    \ _____\___ / \ __,_|\___ |\ ___\___ / \_/

  Codecov report uploader 0.5.0
[2023-06-08T19:28:04.645Z] ['info'] => Project root located at: /home/runner/work/cas/cas
[2023-06-08T19:28:04.649Z] ['info'] -> Token found by environment variables
[2023-06-08T19:28:04.679Z] ['info'] Searching for coverage files...
[2023-06-08T19:28:07.416Z] ['info'] => Found 1 possible coverage files:
  ./build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
[2023-06-08T19:28:07.416Z] ['info'] Processing ./build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml...
[2023-06-08T19:28:07.623Z] ['info'] Detected GitHub Actions as the CI provider.
[2023-06-08T19:28:07.880Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.4-uploader-0.5.0&token= *******&branch=master&build=5214849612&build_url=https%3A%2F%2Fgithub.com%2F*** %2Fcas%2Factions%2Fruns%2F5214849612&commit=0416eab76d3ad44844548688b9b481e4f1d2ad3a&job=Tests+-+Ubuntu&pr=&service=github-actions&slug=***%2Fcas&name=activedirectory&tag=&flags=activedirectory&parent=
[2023-06-08T19:28:08.032Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 503 - upstream connect error or disconnect/reset before headers. reset reason: connection failure
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov' failed with exit code 255

```

This issue seems worthwhile:

> <https://github.com/codecov/codecov-action/issues/926>
>
> Hi, Time to time we get 503 errors while uploading the data. The log looks like …this:
> \`\`\`
> ...
> \[2023-02-24T17:38:21.359Z\] \['verbose'\] tag
> \[2023-02-24T17:38:21.359Z\] \['verbose'\] flags
> \[2023-02-24T17:38:21.359Z\] \['verbose'\] parent
> \[2023-02-24T17:38:21.360Z\] \['info'\] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.3.5&token=\*\*\*\*\*\*\*....
> \[2023-02-24T17:38:21.360Z\] \['verbose'\] Passed token was 36 characters long
> \[2023-02-24T17:38:21.360Z\] \['verbose'\] https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.3.5&...
> Content-Type: 'text/plain'
> Content-Encoding: 'gzip'
> X-Reduced-Redundancy: 'false'
> \[2023-02-24T17:38:23.332Z\] \['error'\] There was an error running the uploader: Error uploading to \[https://codecov.io:\](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 503 - upstream connect error or disconnect/reset before headers. reset reason: connection failure
> \[2023-02-24T17:38:23.332Z\] \['verbose'\] The error stack is: Error: Error uploading to \[https://codecov.io:\](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 503 - upstream connect error or disconnect/reset before headers. reset reason: connection failure
> at main (/snapshot/repo/dist/src/index.js)
> at processTicksAndRejections (node:internal/process/task\_queues:96:5)
> \[2023-02-24T17:38:23.332Z\] \['verbose'\] End of uploader: 3001 milliseconds
> \`\`\`
> 
> It would be great to have a retry mechanism with some defined timeout.

---

<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 15, 2023, 5:31pm UTC](https://community.codecov.com/t/codecov-failed-to-properly-upload/4242/6 "2023-06-15T17:31:47Z")

</div>

@mmoayyed I made a product request [here](https://app.codecov.io/gh/feedback/p/add-retries-to-codecov-uploader-action) to try to get this in front of our product team.
