[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:


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:
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
 
anything in the logs, i was just scrolling to see if your installing with pacman. last ditch any issues with poor flacky internet ?
 
i just installed it no problem.

Code:
[andrew@darkstar:~]$ 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
[andrew@darkstar:~]$
 
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..
 
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 !!
 
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.
 
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
 
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
 

Staff online

Members online


Top