GitHub API: Forbidden, when viewing coverage report for PR

Description

In a recent PR that enables Codecov on the Node.js project for C++/Windows coverage, two reviewers indicated that they were having trouble viewing reports, receiving the message “GitHub API: Forbidden”:

Repository

CI/CD

GitHub Actions

Uploader

Codecov GitHub Action

Commit SHAs

The authorization issue is happening for the following link:

Codecov YAML

Codecov Output

There were no issues with uploading:

==> GitHub Actions detected.
    project root: .
    Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + ./coverage
    -> Found 2 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage/cobertura-coverage.xml bytes=5426882
    + ./coverage/coverage-cxx.xml bytes=2873192
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
==> Uploading reports
    url: https://codecov.io
    query: branch=windows-coverage-action&commit=3a6e93f0431de647bae0f953d0f6a2867c0a291a&build=318011589&build_url=http%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Factions%2Fruns%2F318011589&name=&tag=&slug=nodejs%2Fnode&service=github-actions&flags=&pr=35670&job=&cmd_args=s,n,F
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-20201009-048fee3&token=secret&branch=windows-coverage-action&commit=3a6e93f0431de647bae0f953d0f6a2867c0a291a&build=318011589&build_url=http%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Factions%2Fruns%2F318011589&name=&tag=&slug=nodejs%2Fnode&service=github-actions&flags=&pr=35670&job=&cmd_args=s,n,F
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2020-10-20/83E94EF14AA7BB890B5E2696A7C39F67/c646f6d3a7c5b5a1f5b50e1b38130ec6ac28290a/a03c43c5-72a5-4a3a-a871-831b5ea0b51f.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20201020%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20201020T165721Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=ffd8625899de7bede7981f1f5838b40903e2ba54a3249712ba085f290212d8b5
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1168k    0     0  100 1168k      0  4297k --:--:-- --:--:-- --:--:-- 4297k
    -> View reports at https://codecov.io/github/nodejs/node/commit/c646f6d3a7c5b5a1f5b50e1b38130ec6ac28290a

Additional Information

It seems like the error is somewhat intermittent:

  • When I opened the URL shared in this bug report at the beginning of writing this up, in an incognito window, I received a 404 forbidden error.
  • As I finish writing up this bug report, I seem to no longer be receiving an error.

Hi @bcoe, thanks for opening the ticket. Do you know the GitHub usernames of those users?

mhdawson@ and targos@ were both having issues, I’ve bumped into it periodically myself; it seems like it’s potentially related to the data not yet being cached (just to speculate.)

@bcoe this looks to be an issue with our integration with GitHub.

I would recommend that they

  1. Clear Codecov cookies and logout
  2. Remove Codecov access on GitHub here
  3. Log back into Codecov and access that page (note they will need to reauthorize Codecov when logging in).

Let me know if that works!

I’m running into the same problem. In my normal browser window where I’m logged into GitHub and Codecov, I can see the pages linked in the Codecov comment in a pull request. If I use a private browser window and paste the links in, I run into the 403 Forbidden error.

@tom any clues? Is this the expected behavior? As in, is it a requirement to log in to Codecov before viewing any some of the reports?

@rafmudaf this should not be happening, but there is an active bug report out for this. I’ll make sure to continue pushing the product team on this.