Organization sync between SonarQube Cloud and GitHub is not updating

I have a GitHub to SonarQube organizational sync set up between the two, but membership in SonarQube has not been updating. I see several members in SonarQube that are no longer in GitHub, and new GitHub users are not being added to SonarQube. I’ve tried the old trick of switching back and forth from manual back to automatic, and when automatic is re-selected, I get a message “An unexpected error occurred. Please try again later.”

My SonarQube organization key is ‘ansible-saas’.

Hey @schmidtd,

When SonarQube Cloud tries to sync members for your organization, it needs to fetch an access token from GitHub for the installed SonarQube Cloud GitHub App (installation ID 43333355). I had a look at the logs for your failure and it seems like that token request is failing. GitHub isn’t returning a valid token for that installation, which causes the sync to fail with the generic error you’re seeing.

This usually means the GitHub App installation is in a bad state, for example:

  • The installation was suspended on the GitHub side
  • The app was uninstalled and reinstalled (which changes the installation ID our binding still points to)
  • The app’s permissions/authorization were revoked or need re-approval

Could you go to your GitHub organization settings > GitHub Apps > Installed GitHub Apps, find the SonarQube Cloud app and check if it seems like any of those cases are at play here?

I see, it is in fact suspended. It is asking for read access to GitHub Copilot Business, which I do not wish to grant. I don’t seem to have an option to deny it; I can only accept.

Ok, we decided to delete the org from sonar and remove the app from github. Thanks for looking into it!

Hey @schmidtd, the GitHub app will only ask for this permission if the “Autodetect AI-generated code” feature is on at the SonarQube Cloud organization level. You can go to the org > Administration > Autodetect AI-generated Code and disable it. This is a deprecated feature anyways, so you’re not missing out on much.

If this was the make-or-break factor for you to stop using the product, then perhaps you may reconsider it, since it’s not really required :sweat_smile: