Unable to clone repositories from Github? Read more below to find out the common reasons why.
Your OAuth Application Lacks Organization Permissions
Seeing 404's, but only for specific repositories? If you are unable to clone repositories from a specific organization, then this is most likely your problem.
When you connect your Stoplight and Github accounts, you should have been presented with an OAuth authorization screen like the one below.
This screen lists:
- What permissions the Stoplight OAuth application is requesting (more on this here), and
- What, if any, organizations should be included in this access
What this means if that you did not explicitly grant the OAuth application access to a Github organization, then you will be unable to pull or push data to any repository owned by that organization. If this is the case, you will see 404 errors when trying to clone projects in Studio.
The fix here is easy enough, which is to authorize the application for your organization. The quickest way to do this is:
- Login to your Github account, and navigate to the Application Settings screen. If you are using github.com, then you can find this screen here. For Github Enterprise users, navigate to the URL path "/settings/applications" in your Github instance.
- Using the right-hand options for the Stoplight OAuth application, revoke the access to your account.
- Once revoked, disconnect your Github account from your Stoplight account. This can be done in Stoplight by navigating to the Account Settings (bottom left-hand corner of the screen) > Connected Accounts screen and clicking Disconnect next to your Github account.
- Once your account is disconnected, re-authorize by clicking the Connect button.
This will re-open the OAuth authorization dialog again, allowing you to choose an organization to grant or request access to.
For more information on this topic, review the following articles: