Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied to create PR via ghstack #104

Closed
EikanWang opened this issue Jun 22, 2022 · 3 comments
Closed

Permission denied to create PR via ghstack #104

EikanWang opened this issue Jun 22, 2022 · 3 comments

Comments

@EikanWang
Copy link

I'm trying to use ghstack to stack my PRs. But I encountered the "permission denied" error. The details is as follows. I checked with Meta internally and got the response that I'm on the external contributor list and should have the ghstack privilege. Hence, I raise this issue here and check what the next step is. I notice that Make sure you have write permission to the repo you're opening PR with. in the README of ghstack repo. So does that mean I do not have the write permission?

version: 0.6.0
command: /home/eikan/dev/anaconda3/envs/pyt-te/bin/ghstack
status: 3f6b1ab9d "Test ghstack"

config_path = /home/eikan/.ghstackrc
conf = Config(proxy=None, github_oauth='<GITHUB_OAUTH>', github_username='EikanWang', circle_token=None, fbsource_path='/home/eikan/local/fbsource', github_path='/home/eikan/local/ghstack-pytorch', default_project_dir='fbcode/caffe2', github_url='github.com', remote_name='origin')
$ git remote get-url origin
Using selector: EpollSelector
https://github.com/pytorch/pytorch.git

# POST https://api.github.com/graphql
Request GraphQL query:

        query ($owner: String!, $name: String!) {
            repository(name: $name, owner: $owner) {
                id
                isFork
                defaultBranchRef {
                    name
                }
            }
        }
Request GraphQL variables:
{
 "owner": "pytorch",
 "name": "pytorch"
}
Starting new HTTPS connection (1): api.github.com:443
https://api.github.com:443 "POST /graphql HTTP/1.1" 200 None
Response status: 200
Response JSON:
{
 "data": {
  "repository": {
   "id": "MDEwOlJlcG9zaXRvcnk2NTYwMDk3NQ==",
   "isFork": false,
   "defaultBranchRef": {
    "name": "master"
   }
  }
 }
}
$ git fetch --prune origin
# stderr:
From https://github.com/pytorch/pytorch
 + c7e42f55f4...983664876a functionality/fsdp_commhook_interface -> origin/functionality/fsdp_commhook_interface  (forced update)
   ec4be38ba9..61305cd638  viable/strict -> origin/viable/strict

$ git merge-base origin/master HEAD
2148e6b4a4c51f84ffc406089876af3e5472e7fc

$ git rev-list --header '^2148e6b4a4c51f84ffc406089876af3e5472e7fc' HEAD
3f6b1ab9d252a52c5567d9692889c0b2b4637f65
tree b7927314af86400ee2ab263a70d1f592d6494cc1
parent 2148e6b4a4c51f84ffc406089876af3e5472e7fc
author Wang, Eikan <eikan.wang@intel.com> 1655873368 +0000
committer Wang, Eikan <eikan.wang@intel.com> 1655873368 +0000

    Test ghstack
\0
$ git rev-list --header '^2148e6b4a4c51f84ffc406089876af3e5472e7fc^@' 2148e6b4a4c51f84ffc406089876af3e5472e7fc
2148e6b4a4c51f84ffc406089876af3e5472e7fc
tree cfceb81d57d8c98b7931d7668459e8af9a3fd048
parent b99a1653ed0ffb01b924d99ae72178f08ad23f48
author PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> 1655869300 +0000
committer PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> 1655869302 +0000

    [torchdynamo hash update] update the pinned torchdynamo hash (#79149)
    
    This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/master/.github/workflows/_update-commit-hash.yml).
    Update the pinned torchdynamo hash.
    Pull Request resolved: https://github.com/pytorch/pytorch/pull/79149
    Approved by: https://github.com/clee2000, https://github.com/malfet
\0
$ git rev-parse --show-toplevel
/home/eikan/dev/pytorch

$ git config --default /home/eikan/dev/pytorch/.git/hooks --get core.hooksPath
/home/eikan/dev/pytorch/.git/hooks

$ git for-each-ref refs/remotes/origin/gh/EikanWang '--format=%(refname)'
$ git rev-parse '3f6b1ab9d252a52c5567d9692889c0b2b4637f65~^{tree}'
cfceb81d57d8c98b7931d7668459e8af9a3fd048

$ git config --get commit.gpgsign
$ git commit-tree -p 2148e6b4a4c51f84ffc406089876af3e5472e7fc b7927314af86400ee2ab263a70d1f592d6494cc1
6ba845eb50d83158e14702d23d6e28ec21901f4b

$ git push origin 6ba845eb50d83158e14702d23d6e28ec21901f4b:refs/heads/gh/EikanWang/1/head 2148e6b4a4c51f84ffc406089876af3e5472e7fc:refs/heads/gh/EikanWang/1/base
# stderr:
remote: Permission to pytorch/pytorch.git denied to EikanWang.
fatal: unable to access 'https://github.com/pytorch/pytorch.git/': The requested URL returned error: 403

ERROR: Fatal exception
Traceback (most recent call last):
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/logs.py", line 107, in manager
    yield
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/__main__.py", line 101, in main
    ghstack.submit.main(
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/submit.py", line 203, in main
    submitter.prepare_updates()
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/submit.py", line 930, in prepare_updates
    self.process_new_commit(s)
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/submit.py", line 611, in process_new_commit
    self.sh.git(
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/shell.py", line 273, in git
    return self._maybe_rstrip(self.sh(*(("git",) + args), **kwargs))
  File "/home/eikan/dev/anaconda3/envs/pyt-te/lib/python3.8/site-packages/ghstack/shell.py", line 210, in sh
    raise RuntimeError(
RuntimeError: git push origin 6ba845eb50d83158e14702d23d6e28ec21901f4b:refs/heads/gh/EikanWang/1/head 2148e6b4a4c51f84ffc406089876af3e5472e7fc:refs/heads/gh/EikanWang/1/base failed with exit code 128
@EikanWang
Copy link
Author

@XiaobingSuper also encounters the same issue.

@EikanWang EikanWang changed the title Cannot create ghstack Permission denied to create PR via ghstack Jun 22, 2022
@ezyang
Copy link
Owner

ezyang commented Jun 25, 2022

try replacing your origin url from http to ssh

@EikanWang
Copy link
Author

Thanks for your information. It works now by replacing the URL with ssh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants