Kleopatra: No error is given when decrypted file can not be saved due to full disk
Testing, NormalPublic

Assigned To
None
Authored By
ebo
Wed, Aug 5, 2:53 PM

Description

What I did: Decrypt a large file on Windows when the disk was almost full.

I got a success message and the option to save the file, but the audit log showed gpgs error "no space left on device":


At this point an empty temp folder exists at C:\Users\g10code.WIN-TEST3\AppData\Local\Temp\kleopatra-OYvbNE

Klicking "Save all" only closes the dialog window, nothing is saved.

Debugview:

7367	1240.416479	6052	kleopatra.exe	org.kde.pim.kleopatra: Task:  "5G.txt.gpg wird entschlüsselt …"  has no total progress set. 
7368	1241.148996	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  32  total:  1000
7369	1242.150701	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  90  total:  1000
7370	1243.156215	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  180  total:  1000
7371	1244.162297	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  269  total:  1000
7372	1245.153271	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  365  total:  1000
7373	1246.162428	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  454  total:  1000
7374	1247.154104	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  539  total:  1000
7375	1248.160666	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  636  total:  1000
7376	1249.150869	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  718  total:  1000
7377	1250.155709	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  809  total:  1000
7378	1251.161219	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  900  total:  1000
7379	1252.153211	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  979  total:  1000
7380	1252.424423	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  1000  total:  1000
7381	1252.431178	6052	kleopatra.exe	org.kde.pim.kleopatra: GpgME::DecryptionResult(
7382	1252.431178	6052	kleopatra.exe	 error:                GpgME::Error(0 (Erfolg))
7383	1252.431178	6052	kleopatra.exe	 fileName:             5G.txt
7384	1252.431178	6052	kleopatra.exe	 unsupportedAlgorithm: <null>
7385	1252.431178	6052	kleopatra.exe	 isWrongKeyUsage:      0
7386	1252.431178	6052	kleopatra.exe	 isDeVs:               0
7387	1252.431178	6052	kleopatra.exe	 isBetaCompliance:     0
7388	1252.431178	6052	kleopatra.exe	 legacyCipherNoMDC:    0
7389	1252.431178	6052	kleopatra.exe	 symkeyAlgo:           AES256.OCB
7390	1252.431178	6052	kleopatra.exe	 recipients:
7391	1252.431178	6052	kleopatra.exe	GpgME::DecryptionResult::Recipient(
7392	1252.431178	6052	kleopatra.exe	 keyID:              F4FD55519F948049
7393	1252.431178	6052	kleopatra.exe	 shortKeyID:         9F948049
7394	1252.431178	6052	kleopatra.exe	 publicKeyAlgorithm: ECDH
7395	1252.431178	6052	kleopatra.exe	 status:             GpgME::Error(0 (Erfolg)))
7396	1252.431178	6052	kleopatra.exe	)
7397	1252.431178	6052	kleopatra.exe	GpgME::VerificationResult(
7398	1252.431178	6052	kleopatra.exe	 error:      GpgME::Error(0 (Erfolg))
7399	1252.431178	6052	kleopatra.exe	 fileName:   5G.txt
7400	1252.431178	6052	kleopatra.exe	 signatures:
7401	1252.431178	6052	kleopatra.exe	)
7402	1252.431230	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  1000  total:  1000
7403	1252.431326	6052	kleopatra.exe	org.kde.pim.kleopatra: Collection Progress:  1000  total:  1000
7404	1252.441866	6052	kleopatra.exe	org.kde.pim.kleopatra: All done

The same behavior can be seen in vsd3.3.7, too.

Expected behavior: Error message in the Kleopatra window, no "Save" button.

Details

Version
Gpg4win-5.0.1 + VSD 3.3.7

Event Timeline

ebo triaged this task as Normal priority.Wed, Aug 5, 2:53 PM
ebo created this task.

Hmm, gpg reports that the decryption was okay:

2026-08-05 14:30:08 gpgme[6052.20f0]   _gpgme_io_read: check: [GNUPG:] PROGRESS C:/Users/g10code.WIN ? 5123 51
2026-08-05 14:30:08 gpgme[6052.20f0]   _gpgme_io_read: check: 23 MiB<LF>
2026-08-05 14:30:08 gpgme[6052.20f0]   _gpgme_io_read: check: [GNUPG:] DECRYPTION_OKAY<LF>
2026-08-05 14:30:08 gpgme[6052.20f0]   _gpgme_io_read: check: [GNUPG:] GOODMDC<LF>
2026-08-05 14:30:08 gpgme[6052.20f0]   _gpgme_io_read: check: [GNUPG:] END_DECRYPTION<LF>

and then reports a failure (33554433 is GPG_ERR_GENERAL)

2026-08-05 14:30:08 gpgme[6052.20f0]   _gpgme_io_read: check: [GNUPG:] FAILURE gpg-exit 33554433<LF>

Hmm, gpgme has this comment for the function that parses the FAILURE status:

/* Parse a FAILURE status line and return the error code.  ARGS is
 * modified to contain the location part.  Note that for now we ignore
 * failure codes with a location of gpg-exit; they are too trouble
 * some.  Instead we should eventually record that error in the
 * context and provide a function to return a fuller error
 * description; this could then also show the location of the error
 * (e.g. "option- parser") to make it easier for the user to detect
 * the actual error. */

i.e. this FAILURE is explicitly ignored. Looks like this was done to fix a problem with the verification of multiple signatures: rMb99502274ae5: core: Tweak STATUS_FAILURE handling.

I guess the fix is to emit a better FAILURE status at the location the disk-full error occurred.

Kleopatra now verifies that the decrypted file really exists if GpgME reports successful decryption. While this is very helpful for users it's merely a workaround. It would still be best that gpg (and gpgsm) report errors in a way that GpgME doesn't ignore.

ikloecker mentioned this in Unknown Object (Maniphest Task).Mon, Aug 10, 9:38 AM
pl13 mentioned this in Unknown Object (Maniphest Task).Mon, Aug 17, 9:19 AM
pl13 changed the task status from Open to Testing.Tue, Aug 18, 1:24 PM
pl13 moved this task from Backlog to WIP on the gnupg26 board.
pl13 mentioned this in Unknown Object (Maniphest Task).Mon, Aug 24, 9:36 AM

That Kleopatra notices a missing file can already be tested. A better error should be shown once GnuPG 2.5.22 (not yet released) is included in Gpg4win.