codecov / self-hosted

Example of how to setup Codecov with docker compose
Other
447 stars 36 forks source link

Reports Not Processing Due to Missing Bot Account #8

Closed aaronflorey closed 8 months ago

aaronflorey commented 1 year ago

I have successfully configured CodeCov on my server, the github connection/webhooks are all working and my PRs/commits are showing up in CodeCov.

But the worker logs indicate that it cannot find a bot account for our repository, preventing reports from being processed. I have specified the bot account using both global YAML and a codecov.yaml file in the repository, setting it as my GitHub user. I've also followed the enterprise setup guide and configured a GitHub App accordingly.

The YAML configuration doesn't seem to be copying into the repository and the system reports that I have no bot account.

I have reviewed the available documentation but have not found a solution

I would appreciate assistance in understanding why the bot account is not being recognized and what additional information might be required to diagnose and resolve this issue.

CyberHippo commented 1 year ago

Hi, we are also facing this issue.

The worker logs are showing the following error:

Could not apply diff to report because there is no valid bot found for that repo

We configured the github client id and secret. We also generated and configured the PEM to the Codecov configuration.

Is there something that we are missing?

aaronflorey commented 1 year ago

I found that you have to set RUN_ENV=ENTERPRISE on the environment for the worker/api containers, once i did that it started using Github App that i created

CyberHippo commented 1 year ago

Setting the environment variable also did the trick for us. Thanks @aaronflorey

juho9000 commented 1 year ago

Just a heads up for others bumping into this issue, if your Codecov is down when you install the Github app you will run into this issue.

schmurfy commented 1 year ago

I have the same issue but nothing worked so far:

But still no valid bot found and the logs contain nothing useful...

trent-codecov commented 1 year ago

Things to check:

schmurfy commented 12 months ago

I had a look at this again and still can't figure out what is wrong:

slice-srinidhis commented 8 months ago

Facing the same error with custom hosted codecov installtion , Was able to communicate with github with configured values via a python script similar to https://github.com/codecov/shared/blob/main/shared/github/__init__.py and that works fine . worker logs response = await self.make_http_call(*args, token_to_use=token_to_use, **kwargs)\n File \"/usr/local/lib/python3.10/site-packages/shared/torngit/github.py\", line 301, in make_http_call\n raise TorngitUnauthorizedError(\nshared.torngit.exceptions.TorngitUnauthorizedError: ('{\"message\":\"Bad credentials\",\"documentation_url\":\"https://docs.github.com/rest\"}', 'Github API unauthorized error: Unauthorized')\n", "args": "[]", "kwargs": "{'ownerid': 2, 'username': 'xxxxx', 'using_integration': False}" The Github application name is Org-Codecov not sure if that will have any impact . There is also no entry in database table codecov_auth_githubappinstallation The installation_id in the users table is also null @trent-codecov Can you please help in fixing the error

trent-codecov commented 8 months ago

I'm assuming you set the configuration up as I mentioned above.

Can you reinstall the GitHub app? This will send an install event. If that is successful, it should set the appropriate db values. If it is not, check your webhooks config and logs.

slice-srinidhis commented 8 months ago

The uninstallation worked and the appropriate db values where populated once the event was processed . Thanks for the resolution @trent-codecov .