github icon indicating copy to clipboard operation
github copied to clipboard

Error When Trying To Access Private Github Repo

Open SC7639 opened this issue 7 years ago • 13 comments

Description

In the GitHub (preview) tab displays "An unknown error occurred"

After checking the developer tools Network tab. The below is the response from https://api.github.com/graphql

{"query":"query Pr {relay {...F4}} fragment F0 on User {url,id} fragment F1 on Bot {url,id} fragment F2 on Node {id,__typename} fragment F3 on PullRequest {url,number,title,state,createdAt,author {login,avatarUrl,__typename,...F0,...F1,...F2},repository {name,owner {login,id,__typename},id},reactionGroups {content,users {totalCount}},commits {totalCount},_labels3D9oIE:labels(first:100) {edges {node {name,color,id},cursor},pageInfo {hasNextPage,hasPreviousPage}},id} fragment F4 on Query {_repositoryeNnn7:repository(owner:\"ORGNAME\",name:\"REPO\") {_pullRequestsk0zh:pullRequests(first:30,headRefName:\"master\") {totalCount,edges {node {id,number,title,url,...F3},cursor},pageInfo {hasNextPage,hasPreviousPage}},id}}","variables":{}}

I have replace the owner and repo names as its private

Steps to Reproduce

  1. Open a private repo in atom
  2. Open tab on the right using ctrl + shift + 8 to see the GitHub tab

Expected behavior:

I expected to see pull requests if there are any or something like the below screenshot image

Actual behavior:

An unknown error occurred is displayed in the GitHub tab image

Reproduces how often:

This happens every time I open the GitHub tab for this repo

Versions

atom --version output

Atom    : 1.18.0
Electron: 1.3.15
Chrome  : 52.0.2743.82
Node    : 6.5.0

apm --version

apm  1.18.1
npm  3.10.10
node 6.9.5 x64
python 2.7.13
git 2.13.3.windows.1
visual studio 2015

Additional Information

I can push and pull from/to the repo in atom image

SC7639 avatar Jul 25 '17 18:07 SC7639

I get the same problem. I think the login I provided for the repo may have been wrong. but there doesn't seem to be a place to unset the GitHub login credentials

Server request for query `Pr` failed for the following reasons:

1. Could not resolve to a Repository with the name 'sigma-monorepo'.
   agment F4 on Query {_repository1SJdNm:repository(owner:"omer

daveysigma avatar Aug 05 '17 00:08 daveysigma

I fixed it by going to github.com > settings > Authorized OAuth Apps > GitHub for Atom > grant permissions

HarveyThayer avatar Aug 09 '17 16:08 HarveyThayer

I have this problem too, with a private repo owned by an organization. They're a little paranoid, not inclined to change anything related to security.

This means I can't use the github package at all, for any repo. 😞

I do hope this can be fixed.

bronson avatar Aug 10 '17 05:08 bronson

Not true! If I restart Atom then I seem to be able to use the github package on authorized repos.

That's a relief.

bronson avatar Aug 10 '17 07:08 bronson

It works for me with public repos, but I need to request permission from a private repo owner for it to work even though I have access to that repo every other way. I tried restarting Atom, but had the same problem. Thanks to the earlier post by @HarveyThayer, I realized I had to click a button to request Atom access to a private repo.

fenkner avatar Aug 25 '17 14:08 fenkner

Thank you folks, I didn't realise what was the problem with my Atom installation until I found this issue! "An unknown error occurred." does not suffice and would be nice to have a message/link about granting permissions on your Github settings.

kibernick avatar Sep 01 '17 08:09 kibernick

I tried authorizing the github package for a different private organization. Even though GitHub shows a note saying that an email requesting authorization was sent, they never received an email.

And, there doesn't appear to be any ability to cancel or re-send the email. If that first one disappears, you're locked in that state forever. :)

As others said here, telling the owners of the org to manually go into the oauth settings and enable the permission did work.

bronson avatar Sep 06 '17 19:09 bronson

Are you still having trouble @SC7639? If so and you were having trouble with a private organization repository, you may need to authorize the Atom for GitHub app 1 2 as other folks have mentioned in the thread.

rsese avatar Sep 14 '17 01:09 rsese

FWIW, I've never been able to use the "GitHub" panel, as much as I'd love to see what it can do.

At the moment, I'm getting the message Query errors reported. Could not resolve to a Repository with the name 'insert-name-here'.

Screen Shot 2019-05-14 at 2 33 53 PM

Looking forward to eventually seeing what this tab can do one day...

trusktr avatar May 14 '19 21:05 trusktr

@trusktr I had a similar error using forge in Emacs. Anyway, it works for me if I set github.user and github.email in my git config. https://github.com/magit/forge/issues/192#issuecomment-528386826 gave me the idea.

ibizaman avatar Sep 25 '19 02:09 ibizaman

I fixed it by going to github.com > settings > Authorized OAuth Apps > GitHub for Atom > grant permissions

Thanks, And because this is still relevant:

github.com -> Your Profile icon -> Settings -> Applications -> Authorized OAuth Apps -> Atom GitHub package (the name not the three dots) -> grant permissions

beetle442002 avatar Jul 30 '20 06:07 beetle442002

FWIW, I've never been able to use the "GitHub" panel, as much as I'd love to see what it can do.

At the moment, I'm getting the message Query errors reported. Could not resolve to a Repository with the name 'insert-name-here'.

Screen Shot 2019-05-14 at 2 33 53 PM

Looking forward to eventually seeing what this tab can do one day...

I had the exact same issue - I was able to fix it for me by

  1. adding an SSH key that was generated on my machine to my GitHub account
  2. (re-)cloning the project I was working on using the SSH URL
  3. enter the token you can generate from the 'GitHub for Atom' panel

Jeniffen avatar Jan 22 '21 18:01 Jeniffen

I fixed it by going to github.com > settings > Authorized OAuth Apps > GitHub for Atom > grant permissions

Thanks Harvey!! This works for me - needed to grant permission to that repo under the Organisation Access section. Refreshed the connection in Atom and it now works :)

andrewfirth05 avatar May 25 '22 09:05 andrewfirth05