# GitHub API: Forbidden, when viewing coverage report for PR

**URL:** <https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197>\
**Category:** Support\
**Created:** [October 22, 2020, 3:15am UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197 "2020-10-22T03:15:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcoe](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bcoe](https://community.codecov.com/u/bcoe)\
**Post date:** [October 22, 2020, 3:15am UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197/1 "2020-10-22T03:15:35Z")

</div>

### Description

In a [recent PR](https://github.com/nodejs/node/pull/35670) 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** ”:

![](https://user-images.githubusercontent.com/9373002/96514897-5e054300-1232-11eb-9955-a93c35bc1a69.png)

### Repository

[https://github.com/nodejs/node](https://github.com/nodejs/node)

### CI/CD

GitHub Actions

### Uploader

Codecov GitHub Action

### Commit SHAs

The authorization issue is happening for the following link:

> **[Code coverage done right.](https://app.codecov.io/gh/nodejs/node/compare/35670/diff?src=pr&el=tree-more)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

### Codecov YAML

> <https://github.com/nodejs/node/blob/main/codecov.yml>

### Codecov Output

There were no issues with uploading:

```auto
==> 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.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [October 22, 2020, 1:16pm UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197/2 "2020-10-22T13:16:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bcoe](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bcoe](https://community.codecov.com/u/bcoe)\
**Post date:** [October 23, 2020, 2:05am UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197/3 "2020-10-23T02:05:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [October 26, 2020, 4:05pm UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197/4 "2020-10-26T16:05:11Z")

</div>

@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](https://github.com/settings/applications)
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!

---

<div class="post-metadata">

**Author:** ![rafmudaf](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/rafmudaf/32/2094_2.png) [@rafmudaf](https://community.codecov.com/u/rafmudaf)\
**Post date:** [October 27, 2021, 4:09pm UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197/5 "2021-10-27T16:09:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [November 1, 2021, 11:24pm UTC](https://community.codecov.com/t/github-api-forbidden-when-viewing-coverage-report-for-pr/2197/6 "2021-11-01T23:24:11Z")

</div>

@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.
