Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload with v3 action fails because of missing token #1359

Closed
firewave opened this issue Apr 7, 2024 · 7 comments
Closed

Upload with v3 action fails because of missing token #1359

firewave opened this issue Apr 7, 2024 · 7 comments

Comments

@firewave
Copy link

firewave commented Apr 7, 2024

The v3 action started to fail today because it is done without a token:

[2024-04-07T11:12:16.167Z] ['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

Interestingly the v3 action seems to use the v4 API which appears wrong to me:

[2024-04-07T11:12:15.874Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.6-uploader-0.7.2&token=*******&branch=windows_cfg_added_more_obsolte_functions&build=8586929612&build_url=https%3A%2F%2Fgithub.com%2Fdanmar%2Fcppcheck%2Factions%2Fruns%2F8586929612%2Fjob%2F23532898031&commit=5f9e79c47e8f116481df6fb981dc67eef975344e&job=Coverage&pr=6251&service=github-actions&slug=danmar%2Fcppcheck&name=danmar%2Fcppcheck&tag=&flags=unittests&parent=
firewave added a commit to danmar/cppcheck that referenced this issue Apr 7, 2024
…es (#6253)

The `v3` action appears to use the `v4` API:
```
[2024-04-07T11:12:15.874Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.6-uploader-0.7.2&token=*******&branch=windows_cfg_added_more_obsolte_functions&build=8586929612&build_url=https%3A%2F%2Fgithub.com%2Fdanmar%2Fcppcheck%2Factions%2Fruns%2F8586929612%2Fjob%2F23532898031&commit=5f9e79c47e8f116481df6fb981dc67eef975344e&job=Coverage&pr=6251&service=github-actions&slug=danmar%2Fcppcheck&name=danmar%2Fcppcheck&tag=&flags=unittests&parent=
[2024-04-07T11:12:16.167Z] ['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
```

I filed codecov/codecov-action#1359 upstream.
arkodg added a commit to arkodg/gateway that referenced this issue Apr 8, 2024
Codecov uploads recently started failing
relates to codecov/codecov-action#1359

Signed-off-by: Arko Dasgupta <[email protected]>
arkodg added a commit to envoyproxy/gateway that referenced this issue Apr 8, 2024
* dont fail CI is Codecov upload fails

Codecov uploads recently started failing
relates to codecov/codecov-action#1359

Signed-off-by: Arko Dasgupta <[email protected]>

* fix lint

Signed-off-by: Arko Dasgupta <[email protected]>

---------

Signed-off-by: Arko Dasgupta <[email protected]>
arkodg added a commit to arkodg/gateway that referenced this issue Apr 8, 2024
* dont fail CI is Codecov upload fails

Codecov uploads recently started failing
relates to codecov/codecov-action#1359

Signed-off-by: Arko Dasgupta <[email protected]>

* fix lint

Signed-off-by: Arko Dasgupta <[email protected]>

---------

Signed-off-by: Arko Dasgupta <[email protected]>
(cherry picked from commit e12fdeb)
Signed-off-by: Arko Dasgupta <[email protected]>
arkodg added a commit to arkodg/gateway that referenced this issue Apr 8, 2024
* dont fail CI is Codecov upload fails

Codecov uploads recently started failing
relates to codecov/codecov-action#1359

Signed-off-by: Arko Dasgupta <[email protected]>

* fix lint

Signed-off-by: Arko Dasgupta <[email protected]>

---------

Signed-off-by: Arko Dasgupta <[email protected]>
(cherry picked from commit e12fdeb)
Signed-off-by: Arko Dasgupta <[email protected]>
arkodg added a commit to envoyproxy/gateway that referenced this issue Apr 8, 2024
dont fail CI if codecov upload fails (#3123)

* dont fail CI is Codecov upload fails

Codecov uploads recently started failing
relates to codecov/codecov-action#1359



* fix lint



---------


(cherry picked from commit e12fdeb)

Signed-off-by: Arko Dasgupta <[email protected]>
skirpichev added a commit to skirpichev/mpmath that referenced this issue Apr 9, 2024
skirpichev added a commit to skirpichev/diofant that referenced this issue Apr 10, 2024
@dennisbader
Copy link

dennisbader commented Apr 10, 2024

Hey, we at Darts also facing this issue with v2. Is there any news on this?

sgratch added a commit to sgratch/forklift-console-plugin that referenced this issue Apr 10, 2024
Try fixing the following codecov failure:
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov' failed with exit code 255

Based on codecov/codecov-action#1359, just
avoid failing the CI if Codecov fails, till they will find a resolution.

Signed-off-by: Sharon Gratch <[email protected]>
@firewave
Copy link
Author

Updating to v4 fixed the issue for us which was rather unexpected...

@dennisbader
Copy link

dennisbader commented Apr 11, 2024

Updating to v4 fixed the issue for us which was rather unexpected...

@firewave, I tested as well, and upgrading to v4 without token unfortunately did not work for us (commit here).

Looks like for @jvallesm it didn't work either.

It is indeed very strange why it works without a token, since according to this, tokenless uploads are not supported anymore in v4:

  • Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token)

Actually reading this it sounds like tokenless is only supported for forks.

I read the actions logs here from @firewave's run and it also appears that v4 worked from a forked repo:

info - 2024-04-11 12:01:30,937 -- ci service found: github-actions
info - 2024-04-11 12:01:31,200 -- The PR is happening in a forked repo. Using tokenless upload.
info - 2024-04-11 12:01:31,885 -- Process Commit creating complete

I'll check:

  • add secret upload token that can be read when opening PRs directly in the base repo
  • check if v4 works for forked repos that cannot read the secrets - default behavior if no token can be found

@firewave
Copy link
Author

I tested as well, and upgrading to v4 without token unfortunately did not work for us

Same here. It fixed the PRs but fails after those have been merged to the trunk:

Error: Codecov token not found. Please provide Codecov token with -t flag.
Error: Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov' failed with exit code 1

We do not have the app installed for our repo. That is necessary avoid the quota issues but maybe that has an effect here as well.

@dennisbader
Copy link

dennisbader commented Apr 11, 2024

@firewave, we got it to work now on our side:

  • we have codecov app installed and gave repository read access rights for Darts
  • the gh action workflow files use codecov-action@v4 with an upload token stored as a repository secret (this will be available after syncing codecov app with the repo)
    • so for all collaborators who can directly push to the repo (and who have read access for repo secrets) codecov uses the upload token
    • other collaborators who cannot push directly, have to open a PR after forking the repo. They do not have read access to the secrets, but codecov supports tokenless uploads from forked repos.

Hope this helps

Here is the workflow config.

@superical
Copy link

After spending over an hour grappling with this issue, it seems like my problem was with the token (which is stored as a secret) missing in codecov when triggering via a workflow_call. I'm not sure why it has worked all along until today.

For anyone facing the same problem, my workaround is passing the secret from the caller job into the workflow job. This allows codecov to receive the token. Here's the change that did the trick for me: https://github.com/Open-Attestation/document-store/pull/170/files

You only have to pass the token input to codecov if you aren't using a workflow_call like I did.

tobegit3hub pushed a commit to 4paradigm/OpenMLDB that referenced this issue Apr 16, 2024
tokenless upload seems break for codecov-action v3, no fix upstream.
Upgrading to v4 with a upload token. Ref codecov/codecov-action#1359
@thomasrockhu-codecov
Copy link
Contributor

Seems like the original posters have figured out the issue. If you are still experiencing this, please open a new issue in our feedback repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants