keydb_search failed: End of file
erjoalgo opened this issue · 4 comments
erjoalgo commented
I'm unable to list secret keys after ledger-gpg
init:
+ ledger-gpg init 'Ernesto Alfonso <erjoalgo@gmail.com>' --time=0
2023-07-17 00:55:32,314 WARNING This GPG tool is still in EXPERIMENTAL mode, so please note that the API and features may change without backwards compatibility! [__init__.py:118]
2023-07-17 00:55:32,326 WARNING NOTE: in order to re-generate the exact same GPG key later, run this command with "--time=0" commandline flag (to set the timestamp of the GPG key manually). [__init__.py:33]
gpg: inserting ownertrust of 6
gpg: checking the trustdb
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: keydb_search failed: End of file
gpg: error reading key: End of file
Traceback (most recent call last):
File "/home/ealfonso/.local/bin/ledger-gpg", line 8, in <module>
sys.exit(gpg_tool())
File "/home/ealfonso/.local/bin/ledger_agent.py", line 6, in <lambda>
gpg_tool = lambda: libagent.gpg.main(DeviceType)
File "/home/ealfonso/.local/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 331, in main
return args.func(device_type=device_type, args=args)
File "/home/ealfonso/.local/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 198, in run_init
check_call(keyring.gpg_command(['--homedir', homedir,
File "/home/ealfonso/.local/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 104, in check_call
subprocess.check_call(args=args, stdin=stdin, env=env)
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/gpg', '--homedir', '/home/ealfonso/.gnupg/ledger', '--list-secret-keys', 'Ernesto Alfonso <erjoalgo@gmail.com>']' returned non-zero exit status 2.
█[asrock][~][0]$ ledger-gpg --version
ledger-agent=0.9.0 libagent=0.14.7
On the device the version is 0.0.7
erjoalgo commented
+ ledger-gpg init 'test <foo@bar.com>' -v
2023-07-17 01:33:40,094 WARNING This GPG tool is still in EXPERIMENTAL mode, so please note that the API and features may change without backwards compatibility! [__init__.py:118]
2023-07-17 01:33:40,100 INFO device name: ledger [__init__.py:126]
2023-07-17 01:33:40,101 INFO GPG home directory: /home/ealfonso/.gnupg/ledger [__init__.py:131]
2023-07-17 01:33:40,111 WARNING NOTE: in order to re-generate the exact same GPG key later, run this command with "--time=0" commandline flag (to set the timestamp of the GPG key manually). [__init__.py:33]
HID => b001000000
HID <= 010d5353482f504750204167656e7405302e302e3701029000
HID => 8002000115058000000db08f10298c3577a282e23385e36298ab
HID <= 4104aa0c36bcd56100e68030694ea803cc205241cb02568e1eccdc0c01b779678d2bd483e408cf519cb14d013da393d940612087d2db2e318a1ea973287e912af8319000
HID => b001000000
HID <= 010d5353482f504750204167656e7405302e302e3701029000
HID => 80020001150580000011b08f10298c3577a282e23385e36298ab
HID <= 41044443967e0f09a8e42b185683900f4ed62ec2834066d4047b9db70d1abe6657d0b2d32e6f9db1b0ff43721aadfd648c9059bd74ffe407ebc5e6611742cc9653249000
2023-07-17 01:33:45,060 INFO creating new nist256p1 GPG primary key for "test <foo@bar.com>" [__init__.py:62]
2023-07-17 01:33:45,061 INFO please confirm GPG signature on LedgerNanoS for "<gpg://test <foo@bar.com>|nist256p1>"... [client.py:32]
HID => b001000000
HID <= 010d5353482f504750204167656e7405302e302e3701029000
HID => 8008000135058000000db08f10298c3577a282e23385e36298ab846922ac4471823d6221dfc745ea93a604b8538bf10c3be2f1698f72d39ed961
HID <= 30450221008181ff5e621369ba2e803ca26a1650edc398810c393e6f66d7c695c0c7033b5f022071dd6651d045b0f2b7df309d573137cc6b28a5676dec837a558ddd4d49e200369000
2023-07-17 01:33:46,013 INFO please confirm GPG signature on LedgerNanoS for "<gpg://test <foo@bar.com>|nist256p1>"... [client.py:32]
HID => b001000000
HID <= 010d5353482f504750204167656e7405302e302e3701029000
HID => 8008000135058000000db08f10298c3577a282e23385e36298ab99592f37a4e73a9fc1a6451df30a7b28afd3a0faa7ef9df3e55619f63f22a984
HID <= 304402207f2a4a4e6423ef81bfc38e3e474a8b51bbbcf8919f472e5f0c67062bced2deec022005bc6062b9c56f9dcde52a30ce6fa49cf0c969112f86da3eb9f355f7a99e43249000
gpg: keybox '/home/ealfonso/.gnupg/ledger/pubring.kbx' created
gpg: armor header: Version: GnuPG v2
gpg: pub nistp256/DC93A80E01AE00C9 1970-01-01 test <foo@bar.com>
gpg: /home/ealfonso/.gnupg/ledger/trustdb.gpg: trustdb created
gpg: using pgp trust model
gpg: key DC93A80E01AE00C9: public key "test <foo@bar.com>" imported
gpg: no running gpg-agent - starting '/home/ealfonso/.gnupg/ledger/run-agent.sh'
gpg: waiting for the agent to come up ... (5s)
gpg: connection to agent established
gpg: Total number processed: 1
gpg: imported: 1
gpg: inserting ownertrust of 6
gpg: checking the trustdb
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: keydb_search failed: End of file
gpg: error reading key: End of file
Traceback (most recent call last):
File "/home/ealfonso/.local/bin/ledger-gpg", line 8, in <module>
sys.exit(gpg_tool())
File "/home/ealfonso/.local/bin/ledger_agent.py", line 6, in <lambda>
gpg_tool = lambda: libagent.gpg.main(DeviceType)
File "/home/ealfonso/.local/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 331, in main
return args.func(device_type=device_type, args=args)
File "/home/ealfonso/.local/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 198, in run_init
check_call(keyring.gpg_command(['--homedir', homedir,
File "/home/ealfonso/.local/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 104, in check_call
subprocess.check_call(args=args, stdin=stdin, env=env)
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/gpg', '--homedir', '/home/ealfonso/.gnupg/ledger', '--list-secret-keys', 'test <foo@bar.com>']' returned non-zero exit status 2.
Comint exited abnormally with code 1 at Mon Jul 17 01:33:48
romanz commented
Thanks for reporting this issue!
From the logs, it seems that you run GPG 2.2.12 (from 2018).
Could you please check if the error reproduces on later release of GPG (e.g. GPG 2.3.x)?
romanz commented
Ping :)
erjoalgo commented
Thanks, I tested on gpg (GnuPG) 2.2.40
and was able to set up successfully.