0

I am running a decryption process on millions of files and I am using GnuPG for this.

After the job running for couple of minutes it is closing abruptly with the following error:

ERROR: Starksoft.Aspen.GnuPG.GpgException: Error.  Action: Decrypt.  Command args: --passphrase-fd 0 --no-verbose --batch --trust-model always --decrypt  ---> Starksoft.Aspen.GnuPG.GpgException: A time out event occurred while executing the GPG program.
   at Starksoft.Aspen.GnuPG.Gpg.ExecuteGpg(ActionTypes action, Stream inputStream, Stream outputStream)
   --- End of inner exception stack trace ---
   at Starksoft.Aspen.GnuPG.Gpg.ExecuteGpg(ActionTypes action, Stream inputStream, Stream outputStream)
   at Starksoft.Aspen.GnuPG.Gpg.Decrypt(Stream inputStream, Stream outputStream)

I have written a batch job and tried to schedule it, that fails as well after couple of minutes. I don't see a configuration file either in the GnuPG folder if I need to change any timeout settings.

Jens Erat
  • 37,523
  • 16
  • 80
  • 96
HadoopAddict
  • 225
  • 6
  • 18

1 Answers1

0

GnuPG does not timeout. The timeout is triggered by the Starksoft.Aspen GnuPG C# interface you're using. Looking at the code, it seems that the default timeout is 10 seconds and the timeout can be configured through setting the TimeOut property. I'm not used to C# and that framework, but it seems to boil down to something like

gpg.TimeOut = 120000; // Set timeout to 120 seconds

Reading through the MSDN documentation on Process.WaitForExit(Int32), it seems that a timeout value of Int32.MaxValue will disable the timeout entirely:

gpg.TimeOut = Int32.MaxValue; // Disable timeout
Jens Erat
  • 37,523
  • 16
  • 80
  • 96