Page MenuHome GnuPG

Confusing error messages and loss of keyring if Windows TEMP directory is unaccessible
Open, Needs TriagePublic

Description

I ran into a bit of a corner case bug, but since it resulted in data loss it's probably important to address.

I keep my TEMP directory on a RAM drive in Windows. This works well, but due to a blunder on my part, the drive setup did not survive a recent reboot. As a result, the TEMP directory in Windows became invalid (unmapped drive).

This caused issues with gpg4win resulting in very confusing error messages indicating it "could not connect to the UIServer - check firewall" and "gnupg path not found" with a hint to set GNUPGHOME (which did not help) or reinstalling (which also did not help). Once I figured out the TEMP directory's drive was not accessible and fixed that, it all started working again, however, all keyrings were empty and I had to re-import my keys and fetch public keys that were purged.

I think recovery from an inaccessible TEMP directory should be more graceful than this -- I can see the same issue happening if there is e.g. a filesystem rights/ownership issue on TEMP. At the very least it should prevent data loss -- simply refusing to start with an error explaining it's not accessible should be fine in this case as an inaccessible TEMP would cause issues in other applications as well and it would be good to alert the user of it.

Details

Version
4.3.0