git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.41k stars 2.56k forks source link

error writing public keyring '[keyboxd]' #5105

Open mustafa-6379 opened 3 months ago

mustafa-6379 commented 3 months ago

Hi team, I am trying to create and configure Github GPG key on my VDI using Git Bash, While creating new GPG key, I am getting an Error:

"error writing public keyring '[keyboxd]': SQL library used incorrectly Key generation failed: SQL library used incorrectly"

Other Git Support Ticket: https://support.github.com/ticket/personal/0/2931732 Issue Screenshot: github

please help thanks

Setup

$ git --version --build-options

git version 2.45.2.windows.1
cpu: x86_64
built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. All rights reserved.


 - What options did you set as part of the installation? Or did you choose the
   defaults?
Yes Default

One of the following:

type "C:\Program Files\Git\etc\install-options.txt" type "C:\Program Files (x86)\Git\etc\install-options.txt" type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt" type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt" $ cat /etc/install-options.txt

cat /etc/install-options.txt Editor Option: VIM Custom Editor Path: Default Branch Option: Path Option: Cmd SSH Option: OpenSSH Tortoise Option: false CURL Option: OpenSSL CRLF Option: CRLFAlways Bash Terminal Option: MinTTY Git Pull Behavior Option: Merge Use Credential Manager: Enabled Performance Tweaks FSCache: Enabled Enable Symlinks: Disabled Enable Pseudo Console Support: Disabled Enable FSMonitor: Disabled


 - Any other interesting things about your environment that might be related
   to the issue you're seeing?

yes

### Details

 - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

 - What commands did you run to trigger this issue? If you can provide a
   [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)
   this will help us understand the issue.

gpg --full-generate-key


 - What did you expect to occur after running these commands?

execute: gpg --full-generate-key
select 1, enter
add 1024 , enter
Exipry : 40y

Expect key generate for git configuration

 - What actually happened instead?

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: keydb_search failed: Connection timed out
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2056) ...
gpg: keydb_search failed: Connection timed out
gpg: error writing public keyring '[keyboxd]': SQL library used incorrectly
Key generation failed: SQL library used incorrectly

![github](https://github.com/user-attachments/assets/c73b9354-fb90-436c-8901-bfe0148b694e)

 - If the problem was occurring with a specific repository, can you provide the
   URL to that repository to help us with testing?

N/A
dscho commented 3 months ago

I cannot reproduce this issue over here:

$ git version
git version 2.46.0.windows.1

$ gpg --version
gpg (GnuPG) 2.4.5-unknown
libgcrypt 1.9.4-unknown
Copyright (C) 2024 g10 Code GmbH
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /c/Users/me/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

$ gpg --full-generate-key
gpg (GnuPG) 2.4.5-unknown; Copyright (C) 2024 g10 Code GmbH
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (9) ECC (sign and encrypt) *default*
  (10) ECC (sign only)
  (14) Existing key from card
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 1024
Requested keysize is 1024 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 40y
Key expires at Mon Aug  4 13:39:25 2064 WEDT
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.

Real name: x123
Email address:
Comment:
You selected this USER-ID:
    "x123"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: directory '/c/Users/me/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/c/Users/me/.gnupg/openpgp-revocs.d/327A9793FC3A51457BDB9DC6A27AA3D921C8A367.rev'
public and secret key created and signed.

pub   rsa1024 2024-08-14 [SC] [expires: 2064-08-04]
      327A9793FC3A51457BDB9DC6A27AA3D921C8A367
uid                      x123
sub   rsa1024 2024-08-14 [E] [expires: 2064-08-04]

I assume VDI means something like a virtual machine? It is possible, of course, that there is a problem specific to generating the random bytes, but I suspect a different gpg-agent still holding a lock on your database.