gnupg can not generate or edit keys
Environment:
- Alpine 3.3.3 (Docker)
- gpg 2.1.10-r0
- libgcrypt 1.6.5
- pinentry 0.9.7-r0
gpg fails to create or edit keys:
/# gpg --gen-key
...removed...
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: agent_genkey failed: No such file or directory
Key generation failed: No such file or directory
strace output
...removed...
writev(3, [{"", 0}, {"We need to generate a lot of ran"..., 256}], 2We 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.
) = 256
brk(0) = 0x55ec62739000
brk(0x55ec6273a000) = 0x55ec6273a000
socket(PF_LOCAL, SOCK_STREAM, 0) = 4
stat("/root/.gnupg/S.gpg-agent", {st_mode=S_IFSOCK|0755, st_size=0, ...}) = 0
connect(4, {sa_family=AF_LOCAL, sun_path="/root/.gnupg/S.gpg-agent"}, 26) = 0
read(4, "OK Pleased to meet you, process "..., 1002) = 35
write(4, "RESET", 5) = 5
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
ioctl(0, TIOCGWINSZ, {ws_row=58, ws_col=219, ws_xpixel=0, ws_ypixel=0}) = 0
readlink("/proc/self/fd/0", "/0", 32) = 2
ioctl(0, TIOCGWINSZ, {ws_row=58, ws_col=219, ws_xpixel=0, ws_ypixel=0}) = 0
readlink("/proc/self/fd/0", "/0", 32) = 2
write(4, "OPTION ttyname=/0", 17) = 17
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "OPTION ttytype=xterm", 20) = 20
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "OPTION lc-ctype=C.UTF-8", 23) = 23
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "OPTION lc-messages=C", 20) = 20
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "OPTION allow-pinentry-notify", 28) = 28
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "OPTION agent-awareness=2.1.0", 28) = 28
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "AGENT_ID", 8) = 8
write(4, "\n", 1) = 1
read(4, "ERR 67109139 Unknown IPC command"..., 1002) = 45
write(4, "RESET", 5) = 5
write(4, "\n", 1) = 1
read(4, "OK\n", 1002) = 3
write(4, "GENKEY", 6) = 6
write(4, "\n", 1) = 1
read(4, "S INQUIRE_MAXLEN 1024\nINQUIRE KE"..., 1002) = 39
write(4, "D (genkey(rsa(nbits 4:2048)))\n", 30) = 30
write(4, "END", 3) = 3
write(4, "\n", 1) = 1
read(4, "INQUIRE PINENTRY_LAUNCHED 31\n", 1002) = 29
write(4, "END", 3) = 3
write(4, "\n", 1) = 1
read(4, "ERR 83918929 No such file or dir"..., 1002) = 50
write(2, "gpg: agent_genkey failed: No suc"..., 51gpg: agent_genkey failed: No such file or directory) = 51
write(2, "\n", 1
) = 1
writev(3, [{"Key generation failed: No such f"..., 48}, {"\n", 1}], 2Key generation failed: No such file or directory
) = 49
munmap(0x7f0619ef1000, 32768) = 0
exit_group(2) = ?
+++ exited with 2 +++
(from redmine: issue id 5594, created on 2016-05-18)