Skip to content

repo init error - WindowsError: [Error 2] The system cannot find the file specified #53

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

Open
danregan opened this issue Dec 15, 2016 · 10 comments

Comments

@danregan
Copy link

I'm trying to create a simple proof-of-concept configuration on my Windows 10 system to ensure things are working correctly. (I was able to successfully create a similar setup on an Oracle Linux 7.2 system, but I need this to work for a project that is Windows-based.) I'm using the following repo/git versions:

C:\Users\danielre\AppData\Local\Temp\git\repo>repo --ver
repo version v0.4.20
(from https://github.com/esrlabs/git-repo)
repo launcher version 1.25
(from C:\repo\repo)
git version 2.6.4.windows.1
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)]

C:\Users\danielre\AppData\Local\Temp\git\repo>

When I try to run "repo init", I receive the following error:

C:\Users\danielre\AppData\Local\Temp\git\repo>set REPO_TRACE=1

C:\Users\danielre\AppData\Local\Temp\git\repo>
C:\Users\danielre\AppData\Local\Temp\git\repo>repo init -u file://C:\Users\danielre\AppData\Local\Temp\git\remote\manifest.git
: git config --file C:\Users\danielre/.gitconfig --null --list 1>| 2>|
redirecting to cat
Traceback (most recent call last):
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo/main.py", line 538, in
_Main(sys.argv[1:])
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo/main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo/main.py", line 181, in _Run
portable.NoPager(cmd)
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo\portable.py", line 277, in NoPager
RunWindowsShell(cmd)
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo\portable.py", line 281, in RunWindowsShell
redirect_all(executable)
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo\portable.py", line 288, in redirect_all
p = subprocess.Popen([executable], stdin=subprocess.PIPE, stdout=old_sysout, stderr=old_syserr)
File "C:\Python27\lib\subprocess.py", line 711, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 959, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

C:\Users\danielre\AppData\Local\Temp\git\repo>

I'm not well versed in Python, but looking at the code, it appears to be trying to invoke a command prompt. I've tried from a standard command prompt, one started "as administrator", and from Git BASH, but it doesn't work (With the Git BASH shell, it gives a different error, but I'm not too concerned about it working correctly within this shell specifically -> fatal: 'C:/Program Files/Git/AppData/Local/Temp/git/remote/manifest.git' does not appear to be a git repository)

Any suggestions on what might be causing the error reported from the Windows command prompts?

@mputz86
Copy link

mputz86 commented Dec 17, 2016

Hey @danregan thanks for the interest and report. Does cat work in your terminal? You see the log info "redirecting to cat" and, looking up the failing line of the project (portable.py:288) there is an issue in calling the external program.
So if cat is not available, repo will not work here. You can try repo --no-pager init -u .. to verify this (this should omit the usage of cat).
Thanks :).

@danregan
Copy link
Author

danregan commented Dec 19, 2016 via email

@deeagle001
Copy link

You should use the MinGW bundled with git.
C:\Program Files (x86)\Git\bin is not enough on path.
You have to add the C:\Program Files (x86)\Git\usr\bin as well to have the "cat" and other tools.

@arnonm
Copy link

arnonm commented Aug 30, 2018

I have added usr\bin to the path, and played around with set GIT_CATENATE= to various settings, as well as using --no-pager. All without success.

@grv87
Copy link

grv87 commented Mar 21, 2019

For me, cat built in Git doesn't work.
cat from GnuWin32 works.
less is also required, and Gnuwin32 has it too.

@AttITuder
Copy link

AttITuder commented Mar 23, 2019

I didn't notice any mention of "cat" in the output, but I've attempted with the "--no-pager" option, and this hasn't changed the result.This is my issues:
[new tag] v0.4.9 -> v0.4.9
Traceback (most recent call last):
File "C:\Users\dpc\Desktop\winRepo.repo\repo/main.py", line 538, in
_Main(sys.argv[1:])
File "C:\Users\dpc\Desktop\winRepo.repo\repo/main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "C:\Users\dpc\Desktop\winRepo.repo\repo/main.py", line 181, in _Run
portable.NoPager(cmd)
File "C:\Users\dpc\Desktop\winRepo.repo\repo\portable.py", line 277, in NoPag
er
RunWindowsShell(cmd)
File "C:\Users\dpc\Desktop\winRepo.repo\repo\portable.py", line 281, in RunWi
ndowsShell
redirect_all(executable)
File "C:\Users\dpc\Desktop\winRepo.repo\repo\portable.py", line 288, in redir
ect_all
p = subprocess.Popen([executable], stdin=subprocess.PIPE, stdout=old_sysout,
stderr=old_syserr)
File "C:\Python27\lib\subprocess.py", line 394, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 644, in _execute_child
startupinfo)
WindowsError: [Error 2]

@grv87
Copy link

grv87 commented Mar 23, 2019

Looking in the code, I see that in stable version (1.25) --no-pager option doesn't mean that cat is not used. It just changes the way it is run.

This is not true for master, there --no-pager really turns off cat.

Maybe it is a bug. But why not just install cat and be happy?

@kernel-cyrus
Copy link

I meet the same issue, anyone has solution?

@grv87
Copy link

grv87 commented Oct 3, 2020

@archman86, looks like original Google version supports Windows now. No need to use this fork.

@dongpingwang
Copy link

This issue is still exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants