GPG pin-entry broken after reinstall

I had to reinstall Manjaro due to data corruption, and now GPG pin-entry is broken. When I try committing with Git, it returns:

error: gpg failed to sign the data
fatal: failed to write commit object

And when I try signing a message, I get:

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

After adding allow-loopback-pinentry to my gpg-agent.conf and

use-agent
pinentry-mode loopback

to my gpg.conf per this post, I’m able to enter my passphrase on the command line but not through a GUI. I can set GPG to cache my passphrase and sign a dummy message on CLI as a workaround for now.

inxi output
System:
  Kernel: 5.15.28-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-5.15-x86_64
    root=UUID=959f67f3-abad-4034-855f-35f5e89d86e7 rw rootflags=subvol=@ quiet
    apparmor=1 security=apparmor
    resume=UUID=2f0a68bc-8e2f-4272-9b67-3a1c4e790a42 udev.log_priority=3
    zswap.compressor=lz4
  Desktop: KDE Plasma 5.24.3 tk: Qt 5.15.3 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: UX430UAR v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: UX430UAR v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: UX430UAR.308 date: 04/17/2019
Battery:
  ID-1: BAT0 charge: 10.1 Wh (59.8%) condition: 16.9/48.9 Wh (34.5%)
    volts: 11.6 min: 11.6 model: ASUSTeK ASUS Battery type: Li-ion serial: N/A
    status: Discharging cycles: 1614
Memory:
  RAM: total: 7.62 GiB used: 6.55 GiB (85.9%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i5-8250U bits: 64 type: MT MCP arch: Coffee Lake
    family: 6 model-id: 0x8E (142) stepping: 0xA (10) microcode: 0xEC
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 942 high: 2088 min/max: 400/3400 scaling:
    driver: intel_pstate governor: powersave cores: 1: 800 2: 800 3: 800 4: 800
    5: 794 6: 700 7: 754 8: 2088 bogomips: 28808
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush clflushopt
    cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts
    epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu fsgsbase fxsr
    ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida intel_pt invpcid
    invpcid_single lahf_lm lm mca mce md_clear mmx monitor movbe mpx msr mtrr
    nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln
    pni popcnt pse pse36 pti pts rdrand rdseed rdtscp rep_good sdbg sep smap
    smep ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow
    tsc tsc_adjust tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave
    xsavec xsaveopt xsaves xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf
    mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: conditional, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel UHD Graphics 620 vendor: ASUSTeK driver: i915 v: kernel
    ports: active: eDP-1 empty: DP-1,HDMI-A-1,HDMI-A-2 bus-ID: 00:02.0
    chip-ID: 8086:5917 class-ID: 0300
  Device-2: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo
    bus-ID: 1-6:102 chip-ID: 13d3:5694 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.3 compositor: kwin_x11 driver: X:
    loaded: modesetting alternate: fbdev,vesa gpu: i915 display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2")
    s-diag: 582mm (22.9")
  Monitor-1: eDP-1 model: BOE Display built: 2016 res: 1920x1080 hz: 60
    dpi: 158 gamma: 1.2 size: 309x173mm (12.2x6.8") diag: 354mm (13.9")
    ratio: 16:9 modes: 1920x1080
  OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.3.7
    direct render: Yes
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl bus-ID: 00:1f.3
    chip-ID: 8086:9d71 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.28-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 02:00.0 chip-ID: 8086:24fd class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 1-8:6 chip-ID: 8087:0a2b class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 238.47 GiB used: 39.96 GiB (16.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: SK Hynix model: HFS256G39TND-N210A
    size: 238.47 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 0P10 scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 148 GiB size: 148 GiB (100.00%) used: 34.68 GiB (23.4%)
    fs: btrfs dev: /dev/sda6 maj-min: 8:6 label: Manjaro
    uuid: 959f67f3-abad-4034-855f-35f5e89d86e7
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%)
    used: 26.2 MiB (10.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: SYSTEM
    uuid: 74BD-17A6
  ID-3: /home raw-size: 148 GiB size: 148 GiB (100.00%)
    used: 34.68 GiB (23.4%) fs: btrfs dev: /dev/sda6 maj-min: 8:6 label: Manjaro
    uuid: 959f67f3-abad-4034-855f-35f5e89d86e7
  ID-4: /run/timeshift/backup raw-size: 148 GiB size: 148 GiB (100.00%)
    used: 34.68 GiB (23.4%) fs: btrfs dev: /dev/sda6 maj-min: 8:6 label: Manjaro
    uuid: 959f67f3-abad-4034-855f-35f5e89d86e7
  ID-5: /var/cache raw-size: 148 GiB size: 148 GiB (100.00%)
    used: 34.68 GiB (23.4%) fs: btrfs dev: /dev/sda6 maj-min: 8:6 label: Manjaro
    uuid: 959f67f3-abad-4034-855f-35f5e89d86e7
  ID-6: /var/log raw-size: 148 GiB size: 148 GiB (100.00%)
    used: 34.68 GiB (23.4%) fs: btrfs dev: /dev/sda6 maj-min: 8:6 label: Manjaro
    uuid: 959f67f3-abad-4034-855f-35f5e89d86e7
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 11 GiB used: 5.26 GiB (47.8%)
    priority: -2 dev: /dev/sda5 maj-min: 8:5 label: N/A
    uuid: 2f0a68bc-8e2f-4272-9b67-3a1c4e790a42
Unmounted:
  ID-1: /dev/sda2 maj-min: 8:2 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
  ID-2: /dev/sda3 maj-min: 8:3 size: 78.42 GiB fs: bitlocker label: N/A
    uuid: N/A
  ID-3: /dev/sda4 maj-min: 8:4 size: 800 MiB fs: ntfs label: RECOVERY
    uuid: 8A2ACFF82ACFDF77
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-6:102 info: IMC Networks USB2.0 HD UVC WebCam type: Video
    driver: uvcvideo interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 500mA
    chip-ID: 13d3:5694 class-ID: 0e02 serial: <filter>
  Device-2: 1-8:6 info: Intel Bluetooth wireless interface type: Bluetooth
    driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 8087:0a2b class-ID: e001
  Device-3: 1-9:7 info: Elan Micro ELAN:Fingerprint type: <vendor specific>
    driver: N/A interfaces: 1 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 04f3:0903 class-ID: 0000
  Hub-2: 2-0:1 info: Super-speed hub ports: 6 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 45.0 C pch: 40.5 C mobo: N/A
  Fan Speeds (RPM): cpu: 3000
Info:
  Processes: 367 Uptime: 1d 23h 20m wakeups: 22943 Init: systemd v: 250
  tool: systemctl Compilers: gcc: 11.2.0 clang: 13.0.1 Packages: pacman: 1376
  lib: 353 flatpak: 0 Shell: Zsh v: 5.8.1 default: Bash v: 5.1.16
  running-in: yakuake inxi: 3.3.13

Add this line to ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/bin/pinentry-qt

You can use other pinentry* program if you want.

Same error

Nvm, I forgot to restart the agent. With this option, it just hangs when I try to sign a message.

Remove pinentry-mode option.

1 Like

I did remove the pinentry loopback options from both files before trying

It now works with use-agent in gpg.conf and pinentry-program /usr/bin/pinentry-qt in gpg-agent.conf. It appears to be fixed after an update

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.