codecov-action: Error: failed to properly upload

Hi,

We are getting failed to properly upload errors in our codecov reports. This is a link to a failed report: test.

The error looks like this:

[2021-12-09T21:21:20.606Z] ['verbose'] parent
76
[2021-12-09T21:21:20.607Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.1.13&token=*******&branch=iwahbe%2Fignore-ambient-plugins-exclude-language-plugins&build=1560590304&build_url=https%3A%2F%2Fgithub.com%2Fpulumi%2Fpulumi%2Factions%2Fruns%2F1560590304&commit=0d49bcd7594916ab15876197c806c30cd5312477&job=.github%2Fworkflows%2Frun-build-and-acceptance-tests.yml&pr=8576&service=github-actions&slug=pulumi%2Fpulumi&name=&tag=&flags=&parent=
77
[2021-12-09T21:21:20.607Z] ['verbose'] Passed token was 0 characters long
78
[2021-12-09T21:21:20.607Z] ['verbose'] https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.1.13&branch=iwahbe%2Fignore-ambient-plugins-exclude-language-plugins&build=1560590304&build_url=https%3A%2F%2Fgithub.com%2Fpulumi%2Fpulumi%2Factions%2Fruns%2F1560590304&commit=0d49bcd7594916ab15876197c806c30cd5312477&job=.github%2Fworkflows%2Frun-build-and-acceptance-tests.yml&pr=8576&service=github-actions&slug=pulumi%2Fpulumi&name=&tag=&flags=&parent=
79
        Content-Type: 'text/plain'
80
        Content-Encoding: 'gzip'
81
        X-Reduced-Redundancy: 'false'
82
[2021-12-09T21:21:20.804Z] ['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: 404 - Not Found - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
83
[2021-12-09T21:21:20.805Z] ['verbose'] The error stack is: Error: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 404 - Not Found - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
84
    at main (/snapshot/repo/dist/src/index.js)
85
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
86
[2021-12-09T21:21:20.805Z] ['verbose'] End of uploader: 431 milliseconds
87
Error: Codecov: Failed to properly upload: The process '/Users/runner/work/_actions/codecov/codecov-action/v2/dist/codecov' failed with exit code 255

It looks like the same issue as https://github.com/codecov/codecov-action/issues/595. Any help would be appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 36
  • Comments: 62 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@clementchadebec our repo is public, and we don’t have a secret configured

We get this 404 error from time to time. Rather annoying if you have fail_ci_if_error: true

There seem to be a few different “fixes” for this being posted here, but we’re just having this problem intermittently for no apparent reason.

We are getting this error on version v0.1.16, but version: "v0.1.15" in the action works fine:

- name: Upload coverage results to Codecov.io
      uses: codecov/codecov-action@v2
      with:
        token: ${{secrets.CODECOV_TOKEN}}
        version: "v0.1.15"

In the past few days the amount of failures has increased a lot. Usually a rebuild fixed it but now it takes multiple re-tries.

I’m having the same issue. Are the code-cove folks on this? what’s the status? Some times the server returns 404 😦

Hi all, I posted an update here on this issue. I know it’s not ideal, but this is the most important issue on my plate right now. Thanks for your patience as we try to fix the problem.

I’m having the same issue. Are the code-cove folks on this? what’s the status? Some times the server returns 404 😦

I just stopped using it.

New version codecov/codecov-action@v3 works. Please take a try.

I also still have this issue. I have the feeling that it goes away when I log into the admin panel of CodeCov and resync the repos, but that’s only an idea … Really annoying because it costs me many additional GitHub Actions runs.

Having this issue for private repo. It was because the GitHub action secrets token can be read in the plugin step.

Instead, I put the env variable CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} to the job level. It works then.

Example:

This doesn’t work

name: Test
on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        os: [ ubuntu-20.04 ]
        node-version: [ 12.x ]
    ...  
    # Running tests
    name: Running Tests on ${{ matrix.os }} 
    runs-on: ${{ matrix.os }}
    env:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
     - name: Install packages
        run: |
          npm install 
      - name: Run Test
        run: npm run test
      - name: Upload code coverage to codecov
        uses: codecov/codecov-action@v3
        with: 
            token: ${{secrets.CODECOV_TOKEN}}

This works

name: Test
on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        os: [ ubuntu-20.04 ]
        node-version: [ 12.x ]
    ...  
    # Running tests
    name: Running Tests on ${{ matrix.os }} 
    runs-on: ${{ matrix.os }}
    env:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
     - name: Install packages
        run: |
          npm install 
      - name: Run Test
        run: npm run test
      - name: Upload code coverage to codecov
        uses: codecov/codecov-action@v3

Hi,

I just got the same issue. Try regenerating a new secret token and change it in your settings > secrets.

Hope this helps.

I mentioned above that changing around where the coverage token was stored worked for me. However, it only worked very temporarily.

I’m encountering this issue off-and-on across multiple repos, and have been for many months now. Here’s some more details I can deduce about the nature of it.

  1. As @thomasrockhu mentioned here, it appears to be an issue with rate-limiting. Installing the app does not alleviate the issue.
  2. As far as I can tell, when run on a PR the action almost always fails the first time. Re-running the workflow sometimes resolves the issue - but not always.
  3. I can’t seem to track down the exact factors that cause the error, they seem to be different on a per-day, per-repository basis. This reinforces my thinking in number 1.
  4. It could be related to this, since it doesn’t seem to be passing the token in the first place. Not sure, as it’s failing only sometimes.

Having this issue for private repo. It was because the GitHub action secrets token can be read in the plugin step.

Instead, I put the env variable CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} to the job level. It works then.

Example:

This doesn’t work

name: Test
on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        os: [ ubuntu-20.04 ]
        node-version: [ 12.x ]
    ...  
    # Running tests
    name: Running Tests on ${{ matrix.os }} 
    runs-on: ${{ matrix.os }}
    env:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
     - name: Install packages
        run: |
          npm install 
      - name: Run Test
        run: npm run test
      - name: Upload code coverage to codecov
        uses: codecov/codecov-action@v3
        with: 
            token: ${{secrets.CODECOV_TOKEN}}

This works

name: Test
on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        os: [ ubuntu-20.04 ]
        node-version: [ 12.x ]
    ...  
    # Running tests
    name: Running Tests on ${{ matrix.os }} 
    runs-on: ${{ matrix.os }}
    env:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
     - name: Install packages
        run: |
          npm install 
      - name: Run Test
        run: npm run test
      - name: Upload code coverage to codecov
        uses: codecov/codecov-action@v3

This fixed it for me (Private repo)

Run codecov/codecov-action@v2
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (1e8637b5bdc0b03b67fda9d069fd5ea3673027cb709f06bc4bc9d120e0b086ef  codecov)
==> Running version latest
==> Running version v0.1.9
...
[2022-01-17T03:26:40.265Z] ['verbose'] Start of uploader: 1642390000265...
[2022-01-17T03:26:40.270Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.14
...
[2022-01-17T03:26:40.277Z] ['info'] -> No token specified or token is empty
[2022-01-17T03:26:40.277Z] ['verbose'] Start of network processing...
...
[2022-01-17T03:26:40.283Z] ['info'] Searching for coverage files...
[2022-01-17T03:26:40.311Z] ['verbose'] Preparing to clean the following coverage paths: 
[2022-01-17T03:26:40.311Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!
[2022-01-17T03:26:40.311Z] ['verbose'] The error stack is: Error: Error while cleaning paths. No paths matched existing files!
    at cleanCoverageFilePaths (/snapshot/repo/dist/src/helpers/files.js)
    at main (/snapshot/repo/dist/src/index.js)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-01-17T03:26:40.311Z] ['verbose'] End of uploader: 46 milliseconds
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov' failed with exit code 255

@thomasrockhu IMO it seems that the main issue is related to https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954

This is the general solution for everyone, just create a token to remove the API rate limitation by GitHub, this fixed the issue for me too!

@dixudx we use codecov/codecov-action@v3 and is currently occasionally failing https://github.com/rancher/dashboard/actions/workflows/test.yaml?query=is%3Afailure+branch%3Amaster

[2022-10-11T09:42:56.677Z] ['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: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov' failed with exit code 255

Update: I actually seem to have found a very likely cause. I have a special check that decreases the amount of actions that run per commit for PRs.

if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }}

Essentially, this cuts the amount of actions minutes used per commit in half. However, when disabling this check codecov appears to work just fine. I suppose if there’s any way fix this that’d be great. In the meantime, I’ll see if I can find a workaround such as always uploading even if tests aren’t run.

Edit: To clarify, on PRs, only actions triggered by push events run, as long as the PR is from the base repo. The others are skipped since they’re usually redundant

Screen Shot 2022-10-05 at 7 02 39 PM

@BobDotCom I would recommend the same thing, just check if the secret exists and is named CODECOV_TOKEN

Screen Shot 2022-10-05 at 6 51 49 PM

FWIW a clear pattern has emerged as to which runs fail - all runs triggered by PRs fail while those simply run on push work just fine.

The 404 error has been happening a lot in the past week or so

Getting these errors today, public repo on GitHub Actions https://github.com/ansible-collections/community.hashi_vault/runs/6353992475?check_suite_focus=true#step:5:95

Edit: Started working again after a few hours 🤷‍♂️

I had the same issue since today, generating a new token was pointless. Using an explicit version here with 0.1.15 was actually the only workaround I found. See Sonia-corporation/stale@d466fb2 (#388).

Thank you very much @rafaelcalpena!

Had to rerun the workflow. It’s up and running. Is it a Heisenbug?

I resolved the issue by changing the report extension to xml. I used to use coverage.out file.