codecov-action: Failed to properly upload, codecov failed with exit code 255

I’m trying to upload codecov report for a private repo.

Upload token seems to be verified correctly, and coverage.xml is also found, but the upload still fails.

This is my first time opening an issue on Github. Apologies if I’m missing any critical information that I should provide. My workflow configuration is pretty simple and I can’t think of anything that might be causing this issue.

Configuration:

    [...]
    - name: Test
          run: make test
    - name: Upload to Codecov
      uses: codecov/codecov-action@v2.0.1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        files: ./coverage.xml
        fail_ci_if_error: true
        verbose: true

Github action log:

Processing ./coverage.xml...
Detected GitHub Actions as the CI provider.
Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.0.1-uploader-0.1.0&token=*******&branch=main&build=1052693173&build_url=https%3A%2F%2Fgithub.com%2Ffrom81%2FAirwallex-Exchange-Rate-Monitor%2Factions%2Fruns%2F1052693173&commit=4326ca4ff0912e455b2fe44dc41c99fbbc232973&job=Test%20and%20Codecov&pr=&service=github-actions&slug=from81/Airwallex-Exchange-Rate-Monitor&name=&tag=&flags=&parent=
https://codecov.io/upload/v4?package=github-action-2.0.1-uploader-0.1.0&branch=main&build=1052693173&build_url=https%3A%2F%2Fgithub.com%2Ffrom81%2FAirwallex-Exchange-Rate-Monitor%2Factions%2Fruns%2F1052693173&commit=4326ca4ff0912e455b2fe44dc41c99fbbc232973&job=Test%20and%20Codecov&pr=&service=github-actions&slug=from81/Airwallex-Exchange-Rate-Monitor&name=&tag=&flags=&parent=
        Content-Type: 'text/plain'
        Content-Encoding: 'gzip'
        X-Reduced-Redundancy: 'false'
==> Uploader SHASUM verified
Error!: Error: Error uploading to https://codecov.io: Error: Error uploading to Codecov: Error: Not Found
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v2.0.1/dist/codecov' failed with exit code 255

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Same thing. Did some more digging, and I think I’ve got it figured out:

In the uploader, you validate tokens for being alphanumeric:

https://github.com/codecov/uploader/blob/b3d01c06d505b60f22e18858c997e2d20f9ccfdc/src/helpers/validate.js#L8-L10

However, tokens (at least mine) are UUIDv4 strings, which are not alphanumeric, as they contain hyphens. The code extracting tokens sees this and blanks it out as invalid. When I manually set the token in the action to notrealtoken, which is alphanumeric, I see -> Token set by environment variables in the logs, and the actual request to upload turns into a Bad Request instead of Not Found.

I think either by swapping the validator in the uploader to isUUID (assuming all of your issued tokens indeed are that format), things will work.

Additionally, you may want to enhance the output logs to indicate that you’ve found an invalid value for a token in an expected location for one in the token helper.

@thomasrockhu I encountered the same issue moments ago, and it seems to still be the case:

2021-07-21T18:52:16.4749400Z ##[group]Run codecov/codecov-action@v2
2021-07-21T18:52:16.4749974Z with:
2021-07-21T18:52:16.4750977Z   token: ***
2021-07-21T18:52:16.4751429Z ##[endgroup]
2021-07-21T18:52:18.8571823Z ==> SHASUM file signed by key id 806bb28aed779869
2021-07-21T18:52:18.8600896Z [command]/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n  -Q github-action-2.0.1
2021-07-21T18:52:19.1204008Z 
2021-07-21T18:52:19.1205114Z      _____          _
2021-07-21T18:52:19.1206065Z     / ____|        | |
2021-07-21T18:52:19.1206741Z    | |     ___   __| | ___  ___ _____   __
2021-07-21T18:52:19.1207228Z    | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
2021-07-21T18:52:19.1207734Z    | |___| (_) | (_| |  __/ (_| (_) \ V /
2021-07-21T18:52:19.1208202Z     \_____\___/ \__,_|\___|\___\___/ \_/
2021-07-21T18:52:19.1208493Z 
2021-07-21T18:52:19.1208969Z   Codecov report uploader 0.1.0
2021-07-21T18:52:19.1347357Z => Project root located at: /home/runner/work/XXXXX
2021-07-21T18:52:19.1348868Z Searching for coverage files...
2021-07-21T18:52:19.1849367Z ==> Uploader SHASUM verified
2021-07-21T18:52:40.2712175Z => Found 4 possible coverage files:
2021-07-21T18:52:40.2714522Z coverage/coverage-final.json
2021-07-21T18:52:40.2721873Z coverage/clover.xml
2021-07-21T18:52:40.2723697Z coverage/coverage-final.json
2021-07-21T18:52:40.2724918Z coverage/lcov.info
2021-07-21T18:52:40.2726679Z Processing coverage/coverage-final.json...
2021-07-21T18:52:40.2728890Z Processing coverage/clover.xml...
2021-07-21T18:52:40.2730848Z Processing coverage/coverage-final.json...
2021-07-21T18:52:40.2732408Z Processing coverage/lcov.info...
2021-07-21T18:52:40.2779016Z Detected GitHub Actions as the CI provider.
2021-07-21T18:52:40.2790114Z Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.0.1-uploader-0.1.0&token=*******&branch=codecov-native&build=1053654892&build_url=https%3A%2F%2Fgithub.com%2FXXXXXX%2Factions%2Fruns%2F1053654892&commit=111e7400233f99d80e4fc46add390b2fbbac7375&job=Build%20and%20test&pr=&service=github-actions&slug=XXXXX&name=&tag=&flags=&parent=
2021-07-21T18:52:41.2735348Z Error!: Error: Error uploading to https://codecov.io: Error: Error uploading to Codecov: Error: Not Found

This is on a private repo. Swapping to v1 with no other changes allowed the upload to go through.

Worth noting: the repo did not previously have codecov set up at all, and the initial setup was attempted on a branch.

No worries, glad we were able to figure it out! I can confirm it’s now working as expected my end.

@Firehed @mrz1836, I deployed a change that should be live in about an hour with a few more logs. Would you be able to see then? Specifically if it doesn’t work, if you have a commit SHA and the output from the step

    - name: Upload coverage report
      if: always()
      uses: codecov/codecov-action@v2
      with:
        token: ${{ secrets.CODECOV_TOKEN }}

I’ve confirmed the secret is set, and the log above shows it’s being passed in to the action.

@from81 and @Firehed, I think there’s an issue with the token. I’m not seeing it from our side and I wonder if it’s getting set properly. I’m adding a log here that should help identify.