Reports Not Processing Due to Missing Bot Account
aaronflorey opened this issue ยท 10 comments
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.
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?
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
Setting the environment variable also did the trick for us. Thanks @aaronflorey
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.
I have the same issue but nothing worked so far:
- bot is configured in global org yaml
- RUN_ENV=ENTERPRISE is set on worker and api process
- app was reinstalled
But still no valid bot found and the logs contain nothing useful...
Things to check:
- Valid config for Github app in Codecov install yaml. docs. Note that you will end up with a yaml like
github:
client_id: the_id
client_secret: the_secret
webhook_secret: some_value_you_make
integration:
id: the_app_id
pem: the_path_to_privatekey_that_is_mounted_in_container
- Your owners table record for your org has an integration_id set. This value will correspond to the install_id in Github. You can see this in the url when you visit the app settings for the Github app. Ex for Codecov org
https://github.com/organizations/codecov/settings/installations/AN_INTEGER
. TheAN_INTEGER
value should match what is in your db. If the record is null or incorrect there was a problem installing. - The logs for the Github app. If the app install event fails, the integration_id record for your owner will not be set.
I had a look at this again and still can't figure out what is wrong:
- my config is valid, data are correctly pulled from github
- my owners table has a line for my organization with the correct organization_id
- no particular error in the logs when installing the app
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
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.
The uninstallation worked and the appropriate db values where populated once the event was processed . Thanks for the resolution @trent-codecov .