Github might restrict number of OAuth access tokens for a Jira DVCS connector set up with one account
Problem
Currently a DVCS connector is setup with a authorizing service account and OAuth id/secret to link with github organization based on linking-github-repository-with-jira.
The service account might have access to a number of organizations.
At times users might link a new account for a new organization using the same id/secret combination used for the service account, resulting in one oauth app for multiple organizations. This resulted in JIRA at times running out of a number of access tokens allowed per user/application/scope combination. This is documented under https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/
Diagnosis
Collect any supporting logs from Github to identify any possible problems with authorization or generation of an access token. In the current scenario, the GitHub logs show errors similar to below
oauth_access.destroy OAuth application (JIRA GitHub DVCS) deleted automatically (max accesses for application)
Performed by xxxxxx from (United States)
Resolution
It is suggested to create a unique OAuth app for each organization in Github to avoid running into a similar issue.
Related links
https://confluence.atlassian.com/adminjiraserver073/linking-a-bitbucket-or-github-repository-with-jira-867028213.html
https://confluence.atlassian.com/jirakb/how-to-add-github-organization-repositories-to-jira-815256707.html
https://confluence.atlassian.com/jirakb/slow-appearing-commits-from-bitbucket-or-github-in-jira-779160823.html
https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/