git-repo icon indicating copy to clipboard operation
git-repo copied to clipboard

repo init provokes No such file or directory

Open jsotogaviard opened this issue 6 years ago • 5 comments

Hello

I have the following error when running repo init in windows + git bash

Any ideas ?

Jonathan

JSoto@PS-TLS-P-1502 MINGW64 ~/dev $ repo init gpg: keyblock resource '/c/Users/JSoto/dev/C:\Users\JSoto/.repoconfig-esrlabs\gnupg/pubring.kbx': No such file or directory gpg: no writable keyring found: Not found gpg: error reading '[stdin]': General error gpg: import from '[stdin]' failed: General error gpg: Total number processed: 0 fatal: registering repo maintainer keys failed

JSoto@PS-TLS-P-1502 MINGW64 ~/dev $ git --version git version 2.19.0.windows.1

JSoto@PS-TLS-P-1502 MINGW64 ~/dev $ python --version Python 2.7.15

jsotogaviard avatar Oct 11 '18 09:10 jsotogaviard

I have faced the same issue with Git new release 2.19.1.windows.1

Actually the gpg version is changed in Git. Till Git 2.18. GPG version 1 was used, but in Git 2.19 GPG V2 uis bundled. repo tool makes use of Git and also uses the gpg bundled with Git.

New gpg tool works only with Git style paths. repo tool creates Windows style the path for GNUPGHOME and GPG concatenates the current working directory to that. So it throws "No Such file or directory".

Uninstall Git 2.19.0.windows.1 and use the older version og Git 2.18.0.windows.1, that will work with git-repo tool.

You can get older version from https://github.com/git-for-windows/git/releases?after=v2.19.0-rc0

hsinghweb avatar Oct 12 '18 04:10 hsinghweb

I have sent a mail to Git for Windows team for the same. Here is the mail:

Hi, I use git-repo which makes use of Git for Windows and also uses the gpg tool bundled in Git for Windows.

I am able to run the git-repo with Git-2.18.0-64-bit.exe, but recently I updated the Git to new release of Git for Windows 2.19.1 and that does not work with git-repo tool. I found that basic issue is not with Git, but with gpg bundled with latest Git version.

I have tested both version for below 4 cases and here are the test results in below table:

Case Test Description Result For Git-2.18.0-64-bit.exe Result For Git-2.19.1-64-bit.exe CASE1: gpg import with default GNUPG Home [Result: SUCCESS for both versions] CASE2: gpg import with setting environment variable for GNUPGHOME and path provided in git style [Result: SUCCESS for both versions] CASE3: gpg import with setting environment variable for GNUPGHOME and path provided in windows style single slash \ is escaped by providing double slash \ [Result: SUCCESS for 2.18.0 but FAILED for 2.19.1] CASE4: gpg import with setting environment variable for GNUPGHOME and path provided in windows style with single slash \ replaced with forward slash / [Result: SUCCESS for 2.18.0 but FAILED for 2.19.1]

I know the gpg version is changed in 2.19 release. But somehow the Git-Repo tool, which I am using, creates GNUPGHOME path as per CASE3 above. So right now I am able to use the tool with older version of Git. It may be issue in future to not upgrade Git. Please see if this makes any sense to fix this thing in gpg.

hsingh@HSINGH-LT MINGW64 /c/gpgTesting $ export GNUPGHOME=C:\gpgTesting\.gnupg

hsingh@HSINGH-LT MINGW64 /c/gpgTesting $ echo $GNUPGHOME C:\gpgTesting.gnupg

hsingh@HSINGH-LT MINGW64 /c/gpgTesting $ gpg --import gpg: keyblock resource '/c/gpgTesting/C:\gpgTesting.gnupg/pubring.kbx': No such file or directory

-- Thanks, Himanshu Singh.

hsinghweb avatar Oct 12 '18 04:10 hsinghweb

Thanks for your help That seems to do the trick ! Best Jonathan

jsotogaviard avatar Oct 12 '18 06:10 jsotogaviard

Another workaround: Copy all executables starting with gpg from a Git for Windows 2.18.0.windows.1 archive to a place on your path before the current 2.19 or later installation.

avonengel avatar Feb 05 '19 08:02 avonengel

Use latest version of git 2.22.0.windows.1 and this issue is resolved.

hsinghweb avatar Jun 11 '19 06:06 hsinghweb