tea pr checkout fails with path "segment [0] is empty" #444

Closed
opened 2021-11-15 21:09:02 +00:00 by plafue · 8 comments

I'm using tea 0.8.0 and gitea 1.15.6.

The ssh server I use for git listens on a port other than 22. Tea seems to ignore .ss/config, so I tried to add the port to ssh_host as suggested in #431 (comment) .

After doing that I don't get the no route to host error anymore, but the following:

$ tea pr checkout 1
Error: couldn't fetch PR: path segment [0] is empty

I also tried adding the port explicitly in ~/.git/config (and removing the host specific configuration from ~/.ssh/config), which lead to the same error above, while git commands continued working correctly.

I'm using tea `0.8.0` and gitea `1.15.6`. The ssh server I use for git listens on a port other than `22`. Tea seems to ignore `.ss/config`, so I tried to add the port to ssh_host as suggested in https://gitea.com/gitea/tea/issues/431#issuecomment-593348 . After doing that I don't get the `no route to host` error anymore, but the following: ``` $ tea pr checkout 1 Error: couldn't fetch PR: path segment [0] is empty ``` I also tried adding the port explicitly in `~/.git/config` (and removing the host specific configuration from `~/.ssh/config`), which lead to the same error above, while `git` commands continued working correctly.
noerw added the
kind/bug
label 2021-11-19 11:25:33 +00:00
Member

Oh no.
Can you send us the (redacted) output of git remote -v in the repo where you ran that command?
And also the (redacted) tea config?
Thanks

Oh no. Can you send us the (redacted) output of `git remote -v` in the repo where you ran that command? And also the (redacted) tea config? Thanks
Author

Hey @noerw thanks for the reply!

≻  git remote -v
origin  gitea@${REMOTE}:test/test.git (fetch)
origin  gitea@${REMOTE}:test/test.git (push)

Here are the contents of ~/.config/tea/config.yml. There were no trailing slashes in any occurence of ${REMOTE}, just in case you were wondering.

logins:
- name: ${REMOTE}
  url: https://${REMOTE}
  token: ${TOKEN}
  default: false
  ssh_host: ${REMOTE}
  ssh_key: /home/plafue/.ssh/id_rsa
  insecure: false
  user: plafue
  created: 1636976517

I can also provide access to the repo if it helps debugging.

Hey @noerw thanks for the reply! ```shell ≻ git remote -v origin gitea@${REMOTE}:test/test.git (fetch) origin gitea@${REMOTE}:test/test.git (push) ``` Here are the contents of `~/.config/tea/config.yml`. There were no trailing slashes in any occurence of `${REMOTE}`, just in case you were wondering. ```yaml logins: - name: ${REMOTE} url: https://${REMOTE} token: ${TOKEN} default: false ssh_host: ${REMOTE} ssh_key: /home/plafue/.ssh/id_rsa insecure: false user: plafue created: 1636976517 ``` I can also provide access to the repo if it helps debugging.
Author

The error reported in this issue happens as soon as I add a port to the ssh_host line e.g. ssh_host: ${REMOTE}:3333

The error reported in this issue happens as soon as I add a port to the `ssh_host` line e.g. `ssh_host: ${REMOTE}:3333`
Member

I see, thanks. I assume it will work when you set REMOTE=${REMOTE}:3333 for your git remote configuration and tea ssh_host value (i.e. don't rely on ~/.ssh/config & ~/.gitconfig).
tea embeds its own clients for ssh and git, and it seems they don't make use of that config.
Not sure if it's simpler to add support for these configs to the client libraries, or to switch to native git..

Did this setup work for you with tea 0.7? If so, we may need to revert #391.

I see, thanks. I assume it will work when you set `REMOTE=${REMOTE}:3333` for your git remote configuration and tea `ssh_host` value (i.e. don't rely on `~/.ssh/config` & `~/.gitconfig`). tea embeds its own clients for ssh and git, and it seems they don't make use of that config. Not sure if it's simpler to add support for these configs to the client libraries, or to switch to native git.. Did this setup work for you with tea 0.7? If so, we may need to revert #391.
Member

Nonetheless, the error path segment [0] is empty shouldn't ever be thrown, there's an issue in the URL parsing to be fixed (fwiw: I currently don't have time to work on tea)

Nonetheless, the error `path segment [0] is empty` shouldn't ever be thrown, there's an issue in the URL parsing to be fixed (fwiw: I currently don't have time to work on tea)
Author

I see, thanks. I assume it will work when you set REMOTE=${REMOTE}:3333 for your git remote configuration and tea ssh_host value (i.e. don't rely on ~/.ssh/config & ~/.gitconfig).

I tried that too and didn't work. I will give a try to v0.7 once I have some time.

fwiw: I currently don't have time to work on te

I appreciate that you take the time to even reply.

> I see, thanks. I assume it will work when you set REMOTE=${REMOTE}:3333 for your git remote configuration and tea ssh_host value (i.e. don't rely on ~/.ssh/config & ~/.gitconfig). I tried that too and didn't work. I will give a try to v0.7 once I have some time. > fwiw: I currently don't have time to work on te I appreciate that you take the time to even reply.
plafue reopened this issue 2021-11-19 14:07:18 +00:00
Author

Using 0.7.1 and setting teas configuration to ssh_host: ${REMOTE}:3333 leads to a 404:

≻  ~/Downloads/tea-0.7.1-linux-amd64 pr checkout 1
Error: 404 Not Found
Using 0.7.1 and setting teas configuration to `ssh_host: ${REMOTE}:3333` leads to a 404: ``` ≻ ~/Downloads/tea-0.7.1-linux-amd64 pr checkout 1 Error: 404 Not Found ```
Member

to add: running tea repo fork without local repo context also returns Error: path segment [0] is empty

to add: running `tea repo fork` without local repo context also returns `Error: path segment [0] is empty`
lunny closed this issue 2022-03-26 07:32:54 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/tea#444
No description provided.