codecov / codecov-action

GitHub Action that uploads coverage to Codecov :open_umbrella:
https://www.codecov.io
MIT License
1.49k stars 210 forks source link

Codecov responds with "Repository not found" #1623

Open SethMMorton opened 1 month ago

SethMMorton commented 1 month ago

I am experiencing an inability to upload to codecov.

I was using v3 without a token, and I was getting the following rejection message:

[2024-10-23T05:33:29.815Z] ['info'] Detected GitHub Actions as the CI provider.
[2024-10-23T05:33:30.807Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.6-uploader-0.8.0&token=*******&branch=update-dev-infrastructure&build=11473685570&build_url=https%3A%2F%2Fgithub.com%2FSethMMorton%2Ffastnumbers%2Factions%2Fruns%2F11473685570&commit=ab3084282811cb6a02c5ed2ccd9296f0b4a78247&job=Tests&pr=&service=github-actions&slug=SethMMorton%2Ffastnumbers&name=&tag=&flags=&parent=
[2024-10-23T05:33:30.989Z] ['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: 429 - {"message":"Rate limit reached. Please upload with the Codecov repository upload token to resolve issue. Expected time to availability: 1059s."}

[2024-10-23T05:33:30.989Z] ['info'] Codecov will exit with status code 0. If you are expecting a non-zero exit code, please pass in the `-Z` flag

I then registered a global upload token with Codecov and added that to my configuration, and now the message I get is:

[2024-10-24T02:33:28.906Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.6-uploader-0.8.0&token=*******&branch=update-dev-infrastructure&build=11491437313&build_url=https%3A%2F%2Fgithub.com%2FSethMMorton%2Ffastnumbers%2Factions%2Fruns%2F11491437313&commit=19c704f7175545bedb1b996e4a27dc53d8d3ae03&job=Tests&pr=&service=github-actions&slug=SethMMorton%2Ffastnumbers&name=&tag=&flags=&parent=
[2024-10-24T02:33:28.906Z] ['verbose'] Passed token was 36 characters long
[2024-10-24T02:33:28.906Z] ['verbose'] https://codecov.io/upload/v4?package=github-action-3.1.6-uploader-0.8.0&branch=update-dev-infrastructure&build=11491437313&build_url=https%3A%2F%2Fgithub.com%2FSethMMorton%2Ffastnumbers%2Factions%2Fruns%2F11491437313&commit=19c704f7175545bedb1b996e4a27dc53d8d3ae03&job=Tests&pr=&service=github-actions&slug=SethMMorton%2Ffastnumbers&name=&tag=&flags=&parent=
        Content-Type: 'text/plain'
        Content-Encoding: 'gzip'
        X-Reduced-Redundancy: 'false'
[2024-10-24T02:33:29.260Z] ['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: 400 - {"message":"Repository not found"}
[2024-10-24T02:33:29.261Z] ['verbose'] The error stack is: Error: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 400 - {"message":"Repository not found"}
    at main (/snapshot/repo/dist/src/index.js)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024-10-24T02:33:29.261Z] ['verbose'] End of uploader: 1429 milliseconds
[2024-10-24T02:33:29.261Z] ['info'] Codecov will exit with status code 0. If you are expecting a non-zero exit code, please pass in the `-Z` flag

I get this same response whether or not I am using v3 or v4.

How can I solve this "Repository not found" error?

thomasrockhu-codecov commented 2 weeks ago

@SethMMorton can you try using v4? We are not actively doing work on v3

SethMMorton commented 2 weeks ago

As I mentioned in the original post, I get the same results for both V3 and V4.

thomasrockhu-codecov commented 2 weeks ago

Ah sorry @SethMMorton, can you share the output of v4?

SethMMorton commented 2 weeks ago

I re-tried with V4 and it is now working. I'll try to dig through the old logs to find where I used V4 before and it failed, but it seems like maybe the issue was transient.

thomasrockhu-codecov commented 2 weeks ago

@SethMMorton got it, thanks for getting back to me! I'll close for now, but if you run into it again, please feel free to re-open and tag me

elalish commented 2 weeks ago

I'm hitting this same problem (3 out of 3 tries so far) - e.g. https://github.com/elalish/manifold/actions/runs/11753759913/job/32747207966?pr=1032

==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-commit'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-commit --git-service github -C f97e447c6ce7d26771a6a41[36](https://github.com/elalish/manifold/actions/runs/11753759913/job/32747207966?pr=1032#step:10:37)2d30605f6ed1e9a
info - 2024-11-09 06:12:30,715 -- ci service found: github-actions
info - 2024-11-09 06:12:31,379 -- Process Commit creating complete
error - 2024-11-09 06:12:31,[37](https://github.com/elalish/manifold/actions/runs/11753759913/job/32747207966?pr=1032#step:10:38)9 -- Commit creating failed: {"message":"Repository not found"}
==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-report'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-report --git-service github -C f97e447c6ce7d26771a6a41362d30605f6ed1e9a
info - 2024-11-09 06:12:32,073 -- ci service found: github-actions
info - 2024-11-09 06:12:32,917 -- Process Report creating complete
error - 2024-11-09 06:12:32,917 -- Report creating failed: {"message":"Repository not found"}

I'm using v4 and I just set up an access token when I realized our codecov hadn't been updated for months due to the access change. I'm not allowed to reopen apparently, but I can tag you as requested, @thomasrockhu-codecov.

elalish commented 1 week ago

I just retried and it's still failing - doesn't seem transient. I also see that someone else hit the same bug and decided to migrate to coverall in response: https://github.com/raeperd/test.go/issues/6. I'm considering the same if no one can help out here.

thomasrockhu-codecov commented 1 week ago

@eliatcodecov I responded on your PR, let me know and I can dig more into why this is happening for you

thomasrockhu-codecov commented 1 week ago

Posting the CI build failure to make it easier for me to find: https://github.com/elalish/manifold/pull/1032

bergos commented 1 week ago

I ran into the same issue: https://github.com/rdf-ext/rdf-sparql-builder/pull/36

thomasrockhu-codecov commented 1 week ago

@bergos could you humor me and double-check that the CODECOV_TOKEN secret in GitHub matches the repository one in Codecov? In your particular case, that is often the issue.

bergos commented 1 week ago

@thomasrockhu-codecov I'm using a global upload token and added it to the organization. The error message changed after adding the token secret. And I'm sure the token matches the organization.

thomasrockhu-codecov commented 1 week ago

@elalish would you be able to try 5.0.2? I believe it has the right fixes now

elalish commented 1 week ago

Alas no, same error: https://github.com/elalish/manifold/actions/runs/11861494747/job/33058947253?pr=1032

thomasrockhu-codecov commented 3 days ago

@elalish I made some changes and pushed 5.0.3. I'm sorry this is being so difficult, but would you mind seeing if that fixes the issue?

thomasrockhu-codecov commented 3 days ago

@bergos same as well, would you be able to to try 5.0.3?

bergos commented 3 days ago

@thomasrockhu-codecov I'm using v5 of the GitHub action. The latest version should be used, but the log doesn't explicitly show the version number of the action. Only the version of the CLI is shown, which is 9.0.4.

https://github.com/rdf-ext/rdf-sparql-builder: It's configured with a token and still shows: Repository not found

https://github.com/rdf-ext/grapoi: It's configured without a token. I can see the results in codecov, but the action shows this error: Upload failed: {"message":"Token required because branch is protected"}

elalish commented 3 days ago

@thomasrockhu-codecov I tried again with the same result: https://github.com/elalish/manifold/actions/runs/11861494747/job/33225774720?pr=1032

I simply re-ran the job - IIUC my codecov/codecov-action@v5 should automatically pick up the latest point release version, though it's hard to verify this in the debug output.

thomasrockhu-codecov commented 3 days ago

@bergos @elalish yeesh, ok. 5.0.4 will definitely have a log saying it's 5.0.4. Going to dig into these and see what's going on

thomasrockhu-codecov commented 3 days ago

@elalish, I forked your repo and I'm not seeing the error. Just to be doubly sure, can you pull down the CODECOV_TOKEN again and re-set in your secret vars?

thomasrockhu-codecov commented 3 days ago

@bergos I released 5.0.4, do you mind trying that (and also just for my sanity double-checking the CODECOV_TOKEN)?

elalish commented 2 days ago

@thomasrockhu-codecov Hey, looks like it worked! It says it ran v5.0.5. Not sure if it was a fix you pushed or the fact that I regenerated my token and updated it. However, I would certainly hope your action would give a clearer error than "repository not found", especially if the problem is with the token. But hey, I really appreciate your help and glad to see my coverage charts again!

thomasrockhu-codecov commented 2 days ago

@elalish 😅, yeah it's a pretty terrible error message. I'm gonna work with the product team to hopefully get some better messaging that is actionable.

thomasrockhu-codecov commented 2 days ago

@bergos let me know if I can help out