[SOLVED] Issuing a GPG key with kleopatra is returning a general error

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
I have been trying to issue a GPG key with Kleopatra but everytime it returns the same error

Could not create key pair: General error

Looking closer at the logs I am getting
command 'GENKEY' failed: End of file
2022-06-26 19:29:52 gpg-agent[9617] DBG: chan_10 -> ERR 67125247 End of file <GPG Agent>
2022-06-26 19:29:52 gpg-agent[9617] Assuan processing failed: Broken pipe

There isn't much to go on the internet about this "assuan broken pipe". Any help is much appreciated.

I can create a gpg key manually but I would rather automate the task since I do have to create a lot keys due to my line of work..

As per arch wiki gnupg I have added in my .zshrc profile but to no avail.

export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null

gpg.conf is confured with the below

use-agent
pinentry-mode loopback

And gpg-agent.conf is configured as follow

allow-loopback-pinentry
pinentry-program /usr/bin/pinentry

I did try to use pinentry-tty and qt but same result. I decided to post as I am out of ideas.
 
Last edited:


captain-sensible

Well-Known Member
Joined
Jun 14, 2019
Messages
2,856
Reaction score
1,931
Credits
17,660
I don't think this is going to help but a mention on keys for others

. I have had a couple of gpg issues with pacman from official repositories and noted in: /etc/pacman.conf :
Code:
 # NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.




Also a couple of issues with keys for software on AUR; in the case of the AUR i used skip key on sa couple of occasions and all went well
 
Last edited:
OP
I

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
Thanks for your reply but still getting the same error. I believe Kleopatra is causing the issue as I can manually issue a key with no issue.
2022-06-26 19:37:24 gpg-agent[9617] command 'GENKEY' failed: End of file
2022-06-26 19:37:24 gpg-agent[9617] DBG: chan_10 -> ERR 67125247 End of file <GPG Agent>
2022-06-26 19:37:24 gpg-agent[9617] Assuan processing failed: Broken pipe
 

captain-sensible

Well-Known Member
Joined
Jun 14, 2019
Messages
2,856
Reaction score
1,931
Credits
17,660
anything in the logs, i was just scrolling to see if your installing with pacman. last ditch any issues with poor flacky internet ?
 

captain-sensible

Well-Known Member
Joined
Jun 14, 2019
Messages
2,856
Reaction score
1,931
Credits
17,660
i just installed it no problem.

Code:
[[email protected]:~]$ sudo pacman -S  kleopatra                            (06-26 18:30)
[sudo] password for andrew:
resolving dependencies...
looking for conflicting packages...

Package (6)         New Version  Net Change  Download Size

extra/kitemmodels   5.95.0-1       1.09 MiB       0.62 MiB
extra/kmime         22.04.2-1      0.74 MiB       0.26 MiB
extra/kpimtextedit  22.04.2-1      2.22 MiB       0.72 MiB
extra/libkleo       22.04.2-1      2.97 MiB       0.96 MiB
core/qgpgme         1.17.1-1       1.09 MiB       0.23 MiB
extra/kleopatra     22.04.2-1     12.14 MiB       2.89 MiB

Total Download Size:    5.67 MiB
Total Installed Size:  20.24 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 kleopatra-22.04.2-...     2.9 MiB  3.13 MiB/s 00:01 [----------------------------] 100%
 libkleo-22.04.2-1-...   985.3 KiB  10.7 MiB/s 00:00 [----------------------------] 100%
 kpimtextedit-22.04...   732.3 KiB  9.66 MiB/s 00:00 [----------------------------] 100%
 kitemmodels-5.95.0...   637.0 KiB  9.72 MiB/s 00:00 [----------------------------] 100%
 kmime-22.04.2-1-x86_64  264.3 KiB  7.59 MiB/s 00:00 [----------------------------] 100%
 qgpgme-1.17.1-1-x86_64  233.5 KiB  6.33 MiB/s 00:00 [----------------------------] 100%
 Total (6/6)               5.7 MiB  4.27 MiB/s 00:01 [----------------------------] 100%
(6/6) checking keys in keyring                       [----------------------------] 100%
(6/6) checking package integrity                     [----------------------------] 100%
(6/6) loading package files                          [----------------------------] 100%
(6/6) checking for file conflicts                    [----------------------------] 100%
(6/6) checking available disk space                  [----------------------------] 100%
:: Running pre-transaction hooks...
(1/1) etckeeper: pre-transaction commit
:: Processing package changes...
(1/6) installing qgpgme                              [----------------------------] 100%
(2/6) installing kitemmodels                         [----------------------------] 100%
Optional dependencies for kitemmodels
    qt5-declarative: QML bindings [installed]
(3/6) installing kpimtextedit                        [----------------------------] 100%
(4/6) installing libkleo                             [----------------------------] 100%
(5/6) installing kmime                               [----------------------------] 100%
(6/6) installing kleopatra                           [----------------------------] 100%
:: Running post-transaction hooks...
(1/6) Arming ConditionNeedsUpdate...
(2/6) Updating the MIME type database...
(3/6) Refreshing PackageKit...
(4/6) Updating icon theme caches...
(5/6) Updating the desktop file MIME type cache...
(6/6) etckeeper: post-transaction commit
[[email protected]:~]$
 
OP
I

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
I guess I don't know whats happening. Kleopatra used to work as expected and stopped working. As far as going any further than that, I do not know what is going on. I have been pulling my hair out for the past week figuring out what has happened but to no avail. I will continue issue keys manually as this process work (gnupg) but its very cumbersome..
 
OP
I

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
May be related to this bug on my side gpg-bug2258.
killall gpg-agent
gpg-agent: no process found
gpg-agent --daemon --keep-tty --pinentry-program=/usr/bin/pinentry-curses
pg-agent[100224]: enabled debug flags: ipc
gpg-agent: a gpg-agent is already running - not starting a new one
gpg-agent: secmem usage: 0/32768 bytes in 0 blocks
I suspect this is why Kleopatra is not able to issue new keys but gpg works as expected. I am not certain of it though and most of all don't know how to fix it !!
 
OP
I

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
Some progress - Removing the tick for option 'protect the generated key with a passphrase" allows me to use Kleopatra.. Now need to understand why this option is not working anymore.
 

Lord Boltar

Well-Known Member
Joined
Nov 24, 2020
Messages
1,761
Reaction score
1,176
Credits
13,105
I suspect that the folder ~/.gnupg/*.gpg files had read-only permissions and not read/write

Try to create a gpg key by using following commands
Code:
sudo -s
gpg --gen-key

Then check that folders permission and you can modify it's permission by using following commands so that it will create gpg key successfully.
Code:
sudo -s
chown xxx ~/.gnupg/*.gpg
 
OP
I

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
Ok fix the issue. How; I do not know but here is the steps I took and it is now working. Kleopatra is allowing me to use the option 'protect key with passphrase' and create key with no fail.
in my .zshrc added the below
gpg-agent --options ${HOME}/.gnupg/gpg-agent.conf --daemon`
Also removed the 'pinentry-mode loopback' in ~/.gnupg/gpg.conf.

I add issue with creating keys protected by passphrase using Kleopatra and issue with deleting keys using gpg because of missing pinentry.

Its still a mess but its working now even though I can't really explain what happened between before; which was working with the last config and now; which is working with the current config.

Thanks guys for your time and help
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top