Problem
When accessing the Pull Requests tab for a GitHub repository in the IDE, an error message appears indicating an inability to connect to the repository, despite the ability to access commit information from the same repository. Error message:
Could not connect to repository github.com/<org>/<repo> with account github.com/<github-username>
Can't get repository
Following exception is shown in the idea.log file:
2025-07-15 09:36:26,807 [ 804712] INFO - #o.j.p.g.p.d.GHPRDataContextRepository - Error occurred while creating data context
org.jetbrains.plugins.github.exceptions.GithubConfusingException: Can't get repository
Could not resolve to a Repository with the name '<repository_name>'.
at org.jetbrains.plugins.github.api.GithubApiRequest$Post$GQLQuery.throwException(GithubApiRequest.kt:165)
at org.jetbrains.plugins.github.api.GithubApiRequest$Post$GQLQuery.parseResponse(GithubApiRequest.kt:271)
at org.jetbrains.plugins.github.api.GithubApiRequest$Post$GQLQuery.parseResponse(GithubApiRequest.kt:245)
at org.jetbrains.plugins.github.api.GithubApiRequest$Post$GQLQuery$OptionalTraversedParsed.extractResultWithCost(GithubApiRequest.kt:215)
at org.jetbrains.plugins.github.api.GithubApiRequestExecutor$Base.execute$lambda$1(GithubApiRequestExecutor.kt:122)
at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:529)
at com.intellij.util.io.HttpRequests.process(HttpRequests.java:511)
at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:340)
at org.jetbrains.plugins.github.api.GithubApiRequestExecutor$Base.execute(GithubApiRequestExecutor.kt:99)
at org.jetbrains.plugins.github.api.GithubApiRequestExecutor$WithTokenAuth.execute(GithubApiRequestExecutor.kt:71)
at org.jetbrains.plugins.github.api.GithubApiRequestExecutorKt$executeSuspend$2.invokeSuspend$lambda$0(GithubApiRequestExecutor.kt:309)
at com.intellij.openapi.progress.CoroutinesKt.jobToIndicator$lambda$5(coroutines.kt:451)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:229)
at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:43)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:228)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:680)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:755)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:711)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:77)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:209)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
at com.intellij.openapi.progress.CoroutinesKt.jobToIndicator(coroutines.kt:439)
at com.intellij.openapi.progress.CoroutinesKt.contextToIndicator(coroutines.kt:431)
at com.intellij.openapi.progress.CoroutinesKt.coroutineToIndicator(coroutines.kt:375)
at org.jetbrains.plugins.github.api.GithubApiRequestExecutorKt$executeSuspend$2.invokeSuspend(GithubApiRequestExecutor.kt:307)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Cause
This issue can occur because GitHub integration in the IDE relies on a specific authentication method (OAuth or PAT - personal access token), which requires additional approvals and authorizations on the GitHub side.
Resolution
To resolve the issue, ensure the following:
- For Personal Access Token authentication:
-
Create a Classic personal access token in your GitHub account with the necessary scopes:
repo,gist, andread:org. -
If the repository is part of an organization, make sure that PATs are allowed to access organization resources: https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization. This needs to be configured by organization administrator - so if you are not the administrator please reach out to your organization administrator with this request.
-
After configuring the personal access token and authorizing access in Settings (
⌘ + ,orCtrl + Alt + S) > Version Control > GitHub, the Pull Requests window should function correctly.
- For OAuth authentication:
- It is needed to authorize the IDE integration on your personal account: https://docs.github.com/en/apps/oauth-apps/using-oauth-apps/authorizing-oauth-apps
- If the repository is part of an organization and you are an organization member, it is needed to perform the previous step and also to request access for the IDE integration, from the organization owner: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/requesting-organization-approval-for-oauth-apps
- If the repository is part of an organization and you are the organization owner, it is needed to grant access to the IDE integration for your organization: https://docs.github.com/en/organizations/managing-oauth-access-to-your-organizations-data/approving-oauth-apps-for-your-organization
Comments
0 comments
Please sign in to leave a comment.