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

[BUG] SSH retry can retry on directory created by HTTP try tried first #274

Open
1 task done
mvorisek opened this issue Apr 14, 2023 · 0 comments
Open
1 task done
Labels
Bug thing that needs fixing Needs Triage needs an initial review

Comments

@mvorisek
Copy link

mvorisek commented Apr 14, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

It took me a lot of time to figure out my git/ssh setup problem.

I was getting fatal: destination path 'C:\Users\mvorisek\AppData\Local\npm-cache\_cacache\tmp\git-cloneQLKQWC/.git' already exists and is not an empty directory error.

The error was cause by:

https://github.com/npm/pacote/blob/v15.1.1/lib/git.js#L289

and

https://github.com/npm/pacote/blob/v15.1.1/lib/git.js#L249

retry mechanism which is broken - when the 1st clone (via https) has created the tmp directory, the 2nd clone (via ssh) will fail with the error message above

Expected Behavior

As the retry mechanism seems to be working in properly configured git/ssh setup, I propose to check if the tmp/destination directory is still empty after the 1st try, if not, never retry, and throw the exception from the 1st try.

Steps To Reproduce

You should be able to reproduce with fake git client which will always exit with non-zero code and create some file in the tmp/target directory.

@mvorisek mvorisek added Bug thing that needs fixing Needs Triage needs an initial review labels Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs an initial review
Projects
None yet
Development

No branches or pull requests

1 participant