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)
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:
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
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.