wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.72k stars 263 forks source link

PackerSync fails to clone repository - x11-ssh-askpass doesn't work either #1258

Closed promitheas17j closed 10 months ago

promitheas17j commented 10 months ago

Run :checkhealth for more info

- `git --version`:

git version 2.41.0

- Operating system/version:

Arch Linux (6.4.8-arch1-1)

- Terminal name/version:

alacritty 0.12.2 (9d9982df)

### Steps to reproduce
- Run following command after packer give error about being unable to read username and terminal prompts being disabled(sorry I can't remember it exactly). This seems to be a git error.

git config --global url.ssh://git@github.com/.insteadOf https://github.com/

- Install x11-ssh-askpass
- Run PackerSync
- Password field pops up, enter password, but get an error that askpass could not read the keyboard and that something else is possibly using it
- Try to revert changes by running the below as well as uninstalling x11-ssh-askpass:

git config --global url.https://github.com/.insteadOf ssh://git@github.com/

- Packer still thinks it has to be using ssh-askpass to get authentication.

### Actual behaviour
- Every addon displays as "Failed to install username/repository". Expanding for further info gives (first as exmaple):

Errors: Cloning into 'home/mart/.local/share/nvim/site/pack/packer/start/nvim-fugitive'... ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.


### Expected behaviour
- As before tonight, I expected packer to update everything without asking me for authentication - at least not in a way I could see, I don't know if previously it was doing it automatically based on some configuration with my ssh and git which may have now changed.
### packer files

<details>
<summary>Plugin specification file(s)</summary>

Post or link your plugin specification files here, if you aren't able to provide a minimal
reproducer
https://pastebin.com/wF6TDf3W
</details>

<details>
<summary>packer log file</summary>

Post the contents of ~/.cache/nvim/packer.nvim.log here
https://pastebin.com/A2Quy5dt
</details>

<details>
<summary>packer compiled file</summary>

Post the contents of `packer_compiled.vim` here
https://pastebin.com/C7MQmtaA
</details>
rawlingsr commented 10 months ago

I had the same issue, and ended up resorting to commenting out the insteadof section in ".gitconfig".

;  ~/.gitconfig
[init]
    defaultBranch = main
[user]
    email = your email
    name = your name
; [url "ssh://git@github.com/"]
;   insteadOf = https://github.com/
promitheas17j commented 10 months ago

This seems to have solved it for me as well. It seems that when running

git config --global url.ssh://git@github.com/.insteadOf https://github.com/

those lines are added, but when reverting the changes by running

git config --global url.https://github.com/.insteadOf ssh://git@github.com/

they are not removed. Thank you!