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

Install script abort when turn off shallow clone #674

Closed
2 tasks done
FangLin2001 opened this issue Apr 21, 2023 · 29 comments
Closed
2 tasks done

Install script abort when turn off shallow clone #674

FangLin2001 opened this issue Apr 21, 2023 · 29 comments
Labels
bug Something isn't working has:repro This issue contains reproducing steps platform:windows

Comments

@FangLin2001
Copy link

Version confirmation

  • Confirm

Following prerequisites

  • Confirm

Neovim version

be set as backup by install script

Operating system/version

Win10 22H2 19045.2846

Terminal name/version

None

$TERM environment variable

No response

Branch info

main (Default/Latest)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

Just run the install script in PowerShell 7

Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ayamir/nvimdots/HEAD/scripts/install.ps1'))

select No as 'git clone' preferences

Expected behavior

set 'git clone' preferences correctly

Actual behavior

_abort -Msg "Failed during: $WithCmd" -Type "InvalidResult"
image

Additional information

I encountered tons of errors when executing the install script, most of which disappeared after repeated execution and manual installation of dependencies.

@FangLin2001 FangLin2001 added the bug Something isn't working label Apr 21, 2023
@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

i guess a lot of your programs are out-ot-date? maybe try update those programs first? (git for example)

run: winget update --all

@CharlesChiuGit CharlesChiuGit added needs:response Waiting for reply from the author invalid:install Issues caused by incomplete installation and removed bug Something isn't working labels Apr 21, 2023
@CharlesChiuGit
Copy link
Collaborator

Also I suspect u didn't config your git -> github properly. did u choose ssh install instead of https install?

@ayamir
Copy link
Owner

ayamir commented Apr 21, 2023

Yes, I can confirm it before, but I forgot to report it.

@CharlesChiuGit
Copy link
Collaborator

hmmm, but i never ran into this error, no matter I choose shallow clone for not.

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

from the install.ps1, it's using https to clone this repo, maybe this cause some proxy issues?

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

@FangLin2001 @ayamir can u check if directly cloning this repo via https works on windows with terminal proxies configed?

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

side note: @Jint-lzxy i have an idea, can we live query the branch tags and let users decide which branch they want to install?1

curl -L https://api.github.com/repos/ayamir/nvimdots/branches | jq '.[].name'

圖片

curl -L https://api.github.com/repos/ayamir/nvimdots/branches | grep name

btw my grep is an alias to ugrep

圖片

Footnotes

  1. https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28

@FangLin2001
Copy link
Author

FangLin2001 commented Apr 21, 2023

i guess a lot of your programs are out-ot-date? maybe try update those programs first? (git for example)

run: winget update --all

Also I suspect u didn't config your git -> github properly. did u choose ssh install instead of https install?

Nothing better after i update a particular WindowsSDK and i make sure my git works well. I can git fetch/clone any other repo.

@FangLin2001 @ayamir can u check if directly cloning this repo via https works on windows with terminal proxies configed?

It's OK to git clone https://github.com/ayamir/nvimdots.git in my device, btw i keep FastGithub running throughtout the installation. (https://github.com/dotnetcore/FastGithub)
But now i encounter npm UNABLE_TO_VERIFY_LEAF_SIGNATURE error again and this problem seems only depend on net condition. God bless it would be fine somehow.
Maybe using VSCode is the final solution.

@CharlesChiuGit
Copy link
Collaborator

But now i encounter npm UNABLE_TO_VERIFY_LEAF_SIGNATURE error again and this problem seems only depend on net condition. God bless it would be fine somehow.

try this: npm config set strict-ssl false

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

Maybe using VSCode is the final solution.

🥺🥺🥺😭😭😭

@FangLin2001
Copy link
Author

try this: npm config set strict-ssl false

Already tried and not works. But NodeJS dependency check have worked well and done in one of my attempts.
Still error in git clone preference setting.

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

I still think it's related to the GFW, since I never ran into errors like this. (based in Taiwan)

But I often encounters errors while installing the nvim plugins, but I don't think it's related to the installation script. It's properly lazy.nvim's issue. I need to manually delete the plugins and let lazy re-install it again often times.

@FangLin2001
Copy link
Author

Although I still encounter npm UNABLE_TO_VERIFY_LEAF_SIGNATURE error in NodeJS dependencies check, as i have done it correctly somehow before, i ignore it and select Yes in git clone preference (still error with No). And most of things seems OK if ignoring errors generated by some plugins. Thanks a lot.
Btw, using rsa key with not-empty passphrase would cause git permission deny when cloning lazy at startup.

@Jint-lzxy
Copy link
Collaborator

Can reproduce under specific conditions (sometimes script blocks [used by safe_execute] are not parsed properly, i.e., characters are escaped). Will push a patch asap.

As for the dependency installation issue, probably that is caused by accessing a source through a proxy and the proxy returned a corrupted (or empty) CA Certificate. Will look into this after the first issue is addressed.

@FangLin2001 Will the following code block raise the same issue on your device?

$env:CCLONE_ATTR = ''

try {
	Invoke-Command -ErrorAction Stop -ScriptBlock { git clone --progress -b main "$env:CCLONE_ATTR" 'https://github.com/ayamir/nvimdots.git' }
	if (-not $?) {
		throw
	}
}
catch {
	Write-Error -Message "Command failed." -Category "InvalidResult"
}

@Jint-lzxy Jint-lzxy added bug Something isn't working has:repro This issue contains reproducing steps platform:windows and removed invalid:install Issues caused by incomplete installation labels Apr 21, 2023
@Jint-lzxy
Copy link
Collaborator

i have an idea, can we live query the branch tags and let users decide which branch they want to install?

Hmm but I can't think of a reason why we should implement this - FWIW branch detection based on nvim --version would suffice.

In fact, if ppl really want to customize their clone branch, CCLONE_BRANCH is reserved as a global option for them 😄

$env:CCLONE_BRANCH ??= 'main'

cc @CharlesChiuGit

@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Apr 21, 2023

Btw, using rsa key with not-empty passphrase would cause git permission deny when cloning lazy at startup.

This is expected. Since you need to instruct ssh-agent to store your password in memory after each startup. FYI:

@FangLin2001
Copy link
Author

@FangLin2001 Will the following code block raise the same issue on your device?

$env:CCLONE_ATTR = ''

try {
	Invoke-Command -ErrorAction Stop -ScriptBlock { git clone --progress -b main "$env:CCLONE_ATTR" 'https://github.com/ayamir/nvimdots.git' }
	if (-not $?) {
		throw
	}
}
catch {
	Write-Error -Message "Command failed." -Category "InvalidResult"
}

I check your install.ps1, and obviously your test code block miss a param. In my point of view, the test code block should be like below, which is just like what you guys write in install.ps1.

$env:CCLONE_ATTR = ''
$env:CCDEST_DIR ??= "$env:XDG_CONFIG_HOME\nvim"

try {
    Invoke-Command -ErrorAction Stop -ScriptBlock { git clone --progress -b main "$env:CCLONE_ATTR" 'https://github.com/ayamir/nvimdots.git' "$env:CCDEST_DIR"}
    if (-not $?) {
        throw
    }
}
catch {
    Write-Error -Message "Command failed." -Category "InvalidResult"
}

And in this case, run test.ps1 cause "fatal: Too many arguments.", which is just the same as what i got in my issue. Obviously the problem is that although $env:CCLONE_ATTR == "", "$env:CCLONE_ATTR" was wrongly treated as the first parameter. As a result, $env:CCLONE_ATTR = "" cause error and $env:CCLONE_ATTR = "--depth=1" is right. This problem is clear now.

@Jint-lzxy
Copy link
Collaborator

and obviously your test code block miss a param

It's okay as this issue is not related to those subsequent commands, cloning to the current working directory is sufficient tho.

was wrongly treated as the first parameter.

Great 👍 Many thanks for helping us with the testing. This is consistent with the results on macOS.
Will use array expansion to pass in those parameters instead.

@FangLin2001
Copy link
Author

It's okay as this issue is not related to those subsequent commands, cloning to the current working directory is sufficient tho.

Yes, that doesnt matter much, just error info differs: fatal: repository '' does not exist

@Jint-lzxy
Copy link
Collaborator

Yes, that doesnt matter much, just error info differs: fatal: repository '' does not exist

This is actually one thing, isn't it 😆

@Jint-lzxy
Copy link
Collaborator

@FangLin2001 Quick fix: a26c878. You may need to wait for raw.githubusercontent.com to refresh.

@FangLin2001
Copy link
Author

@FangLin2001 Quick fix: a26c878. You may need to wait for raw.githubusercontent.com to refresh.

I'm forced to use --depth=1 to finish my installation already. So it helps others who want to turn off shallow clone.

@Jint-lzxy
Copy link
Collaborator

I'm forced to use --depth=1 to finish my installation already.

If you still wish a complete clone, you can remove the old installation first:

Remove-Item -Recurse -Force "$env:LOCALAPPDATA\nvim"
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ayamir/nvimdots/HEAD/scripts/install.ps1'))

But partial cloning would suffice for non-development purposes 😄

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

The script still works for me. (duh

圖片

And raw.githubusercontent.com is refreshed for me.
圖片

圖片

@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Apr 21, 2023

Although I still encounter npm UNABLE_TO_VERIFY_LEAF_SIGNATURE error in NodeJS dependencies check

@FangLin2001 Can you try setting $env:NODE_TLS_REJECT_UNAUTHORIZED = 0 (or to $False if 0 isn't recognized) before executing npm install --global neovim tree-sitter-cli? Looks like your proxy failed to return a trustworthy certificate.

However, do note that this method is not secure and is only used to test if the issue is caused by your proxy. Please unset this variable after confirmation: $env:NODE_TLS_REJECT_UNAUTHORIZED = ''

Also you need to explicitly specify your proxy:

npm config set proxy http://<your_proxy_addr>:<proxy_port>
npm config set https-proxy http://<your_proxy_addr>:<proxy_port>

@Jint-lzxy
Copy link
Collaborator

Hmm but I can't think of a reason why we should implement this - FWIW branch detection based on nvim --version would suffice.

In fact, if ppl really want to customize their clone branch, CCLONE_BRANCH is reserved as a global option for them 😄

$env:CCLONE_BRANCH ??= 'main'

cc @CharlesChiuGit in case u missed that :)

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Apr 21, 2023

Hmm but I can't think of a reason why we should implement this - FWIW branch detection based on nvim --version would suffice.
In fact, if ppl really want to customize their clone branch, CCLONE_BRANCH is reserved as a global option for them 😄

$env:CCLONE_BRANCH ??= 'main'

@Jint-lzxy lol I had transfered it to #675 , since I think it's better not to start two conversation in one thread.🤣

@FangLin2001
Copy link
Author

@FangLin2001 Can you try setting $env:NODE_TLS_REJECT_UNAUTHORIZED = 0 (or to $False if 0 isn't recognized) before executing npm install --global neovim tree-sitter-cli? Looks like your proxy failed to return a trustworthy certificate.

You are right as npm install succeed if disabling certificate verification.

@Jint-lzxy
Copy link
Collaborator

You are right as npm install succeed if disabling certificate verification.

I would suggest you contact ur proxy provider since we as users cannot do much to resolve this client-side issue.


Closing as all the mentioned issues have been resolved. If u have any other related questions, feel free to reopen this at any time!

@Jint-lzxy Jint-lzxy removed the needs:response Waiting for reply from the author label Apr 21, 2023
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this issue Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has:repro This issue contains reproducing steps platform:windows
Projects
None yet
Development

No branches or pull requests

4 participants