Unable to publish codecov reports for public repository

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, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.

Description

The public repository is unable to publish codecov reports and throws below error:

[2022-10-24T17:46:29.383Z] ['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 - {'detail': ErrorDetail(string='Could not find a repository, try using repo upload token', code='not_found')}

We have not added a token as it is a public repository.
Repository: GitHub - opensearch-project/opensearch-build-libraries
Please note that this was private before and was recently made public.

CI/CD URL

https://github.com/opensearch-project/opensearch-build-libraries/actions/runs/3285529146/jobs/5474728602

Codecov Output

Please provide the full output of running the uploader on your CI/CD. This will typically have the Codecov logo as ASCII.

Run codecov/codecov-action@v3.1.0
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (20f9c9d78483fce977b6cc39e231a734a23bcd36f4d536bb7355222fb88d02bc  codecov)
==> Running version latest
==> Running version v0.3.2
/home/runner/work/_actions/codecov/codecov-action/v3.1.0/dist/codecov -n  -Q github-action-3.1.0 -f ./build/reports/jacoco/test/jacocoTestReport.xml
[2022-10-24T17:46:28.419Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.3.2
[2022-10-24T17:46:28.428Z] ['info'] => Project root located at: /home/runner/work/opensearch-build-libraries/opensearch-build-libraries
[2022-10-24T17:46:28.432Z] ['info'] -> No token specified or token is empty
[2022-10-24T17:46:28.442Z] ['info'] Searching for coverage files...
[2022-10-24T17:46:28.625Z] ['info'] => Found 1 possible coverage files:
  ./build/reports/jacoco/test/jacocoTestReport.xml
[2022-10-24T17:46:28.626Z] ['info'] Processing ./build/reports/jacoco/test/jacocoTestReport.xml...
[2022-10-24T17:46:28.631Z] ['info'] Detected GitHub Actions as the CI provider.
[2022-10-24T17:46:28.632Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.0-uploader-0.3.2&token=*******&branch=main&build=3285529146&build_url=https%3A%2F%2Fgithub.com%2Fopensearch-project%2Fopensearch-build-libraries%2Factions%2Fruns%2F3285529146&commit=b251fcf658c8c71de13085fd6bb03608801d7ef1&job=groovy-tests&pr=&service=github-actions&slug=opensearch-project%2Fopensearch-build-libraries&name=&tag=&flags=&parent=
[2022-10-24T17:46:29.383Z] ['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 - {'detail': ErrorDetail(string='Could not find a repository, try using repo upload token', code='not_found')}

Expected Results

Should publishcodecov reports

Actual Results

Please provide what actually happened.

Additional Information

Facing similar issue with one more repository here: Adds code coverage for the repo · opensearch-project/project-tools@edde7d0 · GitHub

Related to the other above-mentioned repo (https://github.com/opensearch-project/project-tools/pull/13). All repos in the org start private, this one was flipped public within 24 hours and has never tried to upload any codecov data. It’s failing with the same error, but this was the first time it tried to upload codecov data (it never tried to upload codecov data while being private).

PS: please note that granting codecov org-wide read/write access is going to be difficult. I have asked the org admins, and their security people are asking “why would we need to do that when it should work without it”.

@gaiksaya this is pretty strange, can you try logging into Codecov and going to the opensearch-project page? Do you see the repository in the Not yet setup section?

Neither opensearch-build-libraries nor project-tools are found in either tab.

1 Like

@dblock that’s probably the issue. I don’t see those repos on our side at all either. Have you tried following these steps?

image

Hey @tom ,

The other repositories in this organization did not need to do that. Wondering why the new repositories are asking for this access.
Also as @dblock said, above

PS: please note that granting codecov org-wide read/write access is going to be difficult. I have asked the org admins, and their security people are asking “why would we need to do that when it should work without it”.

Tom, we tried everything, we do not have org management access and it’s not going to be sustainable to ask someone to click sync for every repo.

This looks like a codecov bug. Can you please escalate this? Why isn’t codecov doing the sync?

Hi Daniel,

The repos are on Codecov, and receiving coverage: Codecov and Codecov

If you are a contributor, that would explain why the repos are not showing in your dashboard, but you can access them directly or search as I linked above.

The error message Could not find a repository, try using repo upload token means that we could not locate the build using the tokenless API, usually due to rate limits. In this case, you would need to use the token as suggested. I recommend setting it as a repo secret in GitHub.