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

Couldn't determine repo owner and name from url #266

Open
pluiez opened this issue Nov 5, 2024 · 5 comments
Open

Couldn't determine repo owner and name from url #266

pluiez opened this issue Nov 5, 2024 · 5 comments

Comments

@pluiez
Copy link

pluiez commented Nov 5, 2024

Hi, I'm using privately hosted gitlab and encounterd the following error. I have checked #162 and #244 but I cound't find solution to my problem.

ERROR: Fatal exception
Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/logs.py", line 105, in manager
    yield
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/cli.py", line 46, in cli_context
    yield shell, config, github
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/cli.py", line 258, in submit
    ghstack.submit.main(
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/submit.py", line 260, in main
    submitter = Submitter(**kwargs)
                ^^^^^^^^^^^^^^^^^^^
  File "<string>", line 24, in __init__
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/submit.py", line 380, in __post_init__
    repo = ghstack.github_utils.get_github_repo_info(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/github_utils.py", line 71, in get_github_repo_info
    name_with_owner = get_github_repo_name_with_owner(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/github_utils.py", line 44, in get_github_repo_name_with_owner
    raise RuntimeError(
RuntimeError: Couldn't determine repo owner and name from url: [email protected]_NAME.com:PROJECT_NAME/TEAM_NAME/REPO_NAME.git
@ezyang
Copy link
Owner

ezyang commented Nov 5, 2024

Whoops. This is probably not hard to adjust the regex, feel free to send a PR or maybe eventually I will get to it

@pluiez
Copy link
Author

pluiez commented Nov 6, 2024

Whoops. This is probably not hard to adjust the regex, feel free to send a PR or maybe eventually I will get to it

I set the github_url field in .ghstackrc, but it comes to another error:

ERROR: Fatal exception
Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/logs.py", line 105, in manager
    yield
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/cli.py", line 46, in cli_context
    yield shell, config, github
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/cli.py", line 258, in submit
    ghstack.submit.main(
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/submit.py", line 262, in main
    submitter = Submitter(**kwargs)
                ^^^^^^^^^^^^^^^^^^^
  File "<string>", line 24, in __init__
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/submit.py", line 382, in __post_init__
    repo = ghstack.github_utils.get_github_repo_info(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/github_utils.py", line 95, in get_github_repo_info
    repo = github.graphql(
           ^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/ghstack/github_real.py", line 115, in graphql
    raise RuntimeError(pretty_json)
RuntimeError: {
 "errors": [
  {
   "message": "Field 'repository' doesn't exist on type 'Query'",
   "locations": [
    {
     "line": 3,
     "column": 13
    }
   ],
   "path": [
    "query",
    "repository"
   ],
   "extensions": {
    "code": "undefinedField",
    "typeName": "Query",
    "fieldName": "repository"
   }
  },
  {
   "message": "Variable $owner is declared by anonymous query but not used",
   "locations": [
    {
     "line": 2,
     "column": 9
    }
   ],
   "path": [
    "query"
   ],
   "extensions": {
    "code": "variableNotUsed",
    "variableName": "owner"
   }
  },
  {
   "message": "Variable $name is declared by anonymous query but not used",
   "locations": [
    {
     "line": 2,
     "column": 9
    }
   ],
   "path": [
    "query"
   ],
   "extensions": {
    "code": "variableNotUsed",
    "variableName": "name"
   }
  }
 ]
}

@ezyang
Copy link
Owner

ezyang commented Nov 7, 2024

beh, this might be some sort of private github difference. This query doesn't matter, what happens if you patch it to hard code your info?

@pluiez
Copy link
Author

pluiez commented Nov 8, 2024

beh, this might be some sort of private github difference. This query doesn't matter, what happens if you patch it to hard code your info?

Sorry, I am not familiar with how the git cilent communicates with host server. What is the "query" used for? What is the desired hard coding I should try?

@ezyang
Copy link
Owner

ezyang commented Nov 9, 2024

It's a few things, but I think the main load bearing one is knowing what the default branch is

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