folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
14.47k stars 348 forks source link

bug: cannot use lazy.nvim behind corporate proxy #1239

Closed py9mrg closed 8 months ago

py9mrg commented 9 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.4

Operating system/version

Windows 10 22H2

Describe the bug

Hello,

In order to be able to use git on the command line (powershell on either Windows Terminal or Wezterm), I have to set my .gitconfig as either:

[http]
  sslBackend = schannel

or

[http]
  sslBackend = openssl
  sslCAInfo= location of pem file

Either will work to allow me to git clone repos onto my system. However, lazy.nvim seems to be conflicting with something because I get a load of errors. (This is whether using lazy.nvim within my neovim config, or whether using LazyVim).

If I use the first .gitconfig the errors are about schannel (e.g. ... schannel: failed to receive handshake ...). If I use the second .gitconfig I get certificate errors (e.g. ... SSL dertificate problem: unable to get local issuer certificate). So it seems like it's respecting the .gitconfig but something is going wrong.

Strangely, Mason is installing the language servers fine and - as I mentioned above - git clone on the command line works fine. Any ideas how I can fix this, please?

Thanks.

Steps To Reproduce

  1. Install git on Windows
  2. Install Neovim
  3. Clone LazyVim repo (to show this is not a conflict with my specific configuration)
  4. Run nvim and watch the errors
  5. Also running :Lazy then Sync shows the same errors

Expected Behavior

No conflict between Lazy and git when I can use git fine on the command line.

Repro

N/A problem arise with fresh LazyVim install.

Edit: this issue does not seem to arise when using Neovim and lazy.nvim via WSL.

py9mrg commented 9 months ago

I think I have found the root of the cause. I had installed git using scoop. When I install "normally" the problems mostly go away. It's still a bit janky because I had to sync a few times because the error still happened a bit intermittently, but that seems to have mostly fixed it.

py9mrg commented 9 months ago

Ooops, sorry, that wasn't the cause after all. I still have loads of issues syncing and now it doesn't work at all - even using a "normal" git install. No idea how it managed to work that one time but it's back to not working again.

py9mrg commented 9 months ago

Update to this topic:

If I run Sync or capital U update then I still get this error - but only on some plugins (and not the same ones every time), But when I went to each failed update and pressed small u to update just that - each went fine.

It seemed to me, therefore, that it's a concurrency issue. Sure enough, if I set concurrency = 1 in the config then I have no issues. Of course, updating takes ages then - but at least it works.

It's still not clear to me why using lazy.nvim with native nvim has a concurrency problem on Windows, but using it with nvim in WSL doesn't.

folke commented 8 months ago

no idea. That concurrency issue is just Windows being Windows. Not a lazy issue

bdinesh commented 6 months ago

Update to this topic:

If I run Sync or capital U update then I still get this error - but only on some plugins (and not the same ones every time), But when I went to each failed update and pressed small u to update just that - each went fine.

It seemed to me, therefore, that it's a concurrency issue. Sure enough, if I set concurrency = 1 in the config then I have no issues. Of course, updating takes ages then - but at least it works.

It's still not clear to me why using lazy.nvim with native nvim has a concurrency problem on Windows, but using it with nvim in WSL doesn't.

@py9mrg I'm also facing this issue. Can you please let me know where should I add concurrency=1?

py9mrg commented 6 months ago

@bdinesh it's in config.lua - it'll be set to nil, change it to 1. It should work (mostly) fine then. You'll get occasional issues but it's a lot easier to run sync a few times / manually do U for the few that cause a problem than to do all of them. The joys of windows - it'll work fine as is in wsl!

bdinesh commented 6 months ago

Thanks @py9mrg didn't find config.lua file under appdata\local\nvim folder. Should we create one and add this setting?

py9mrg commented 6 months ago

No, it's in the lazyvim folders (not top level). I forget the exact path and am on my phone but it'll either be in the location you mentioned or nvim-data.

bdinesh commented 6 months ago

found it at AppData\Local\nvim-data\lazy\lazy.nvim\lua\lazy\core

Skarian commented 4 months ago

found it at AppData\Local\nvim-data\lazy\lazy.nvim\lua\lazy\core

I can confirm that changing the concurrency setting here to 1 resolved issues I was facing on Windows.

niklassemmler commented 1 month ago

Thanks! This helped me as well on OSX behind a corporate proxy.

Rijom commented 1 month ago

I just encountered the same issue. This helped. Maybe this could be somehow configured automatically for windows?