Encryption failed with following error: Status = -1

Hi,

I’m not sure is this a right forum for this topic(in case it isn’t - I’m sorry I posted it here).
My problem is next:
When i try to encrypt a large file, the PGP encryption service returned Status cdode withvalue of -1; Is there are any limitation for size of file? Or webMethods Integration Server ran out of memory when encrypting such large file?

Thanks, Aleks!

There is no such limitation with PGP encryption. Check your logic and if you are doubting on memory issue then increase your IS memory and try.

Assuming you’re using the OpenPGP package from wM, there are a couple of possibilities that come to mind:

  • The JVM is running out of memory. If you’re using pub.openpgp:encrypt then gnupg writes the encrypted data to memory. I think the default settings use ASCII armor, which is just base-64 encoding which balloons the size of the file dramatically. Use pub.openpgp:encryptFile to avoid the memory constraint.

  • As you probably know, the underlying service makes an OS command-line call. The default timeout is 30 seconds. For a large file you may be running into this timeout.

HTH

Hi,

I’m using pub.openpgp:encryptFile. My file is a pretty large: it is about 2Gb.

When you said ‘the underlying service makes an OS command-line call (default timeout is 30 seconds)’, do you mean that encryptFile service make some calls to windows API in the background? ANd, is there a way to increase default timeut?

Thanks a lot, Aleks!

The encryptFile service uses a Java class named CommandRunner to make the command-line call. It uses other classes provided by the JVM to do the work. (Windows API calls are undoubtedly made at some point, but that’s way down in the JVM internals.)

Follow the chain of service calls in encryptFile. It calls wm.openpgp:execPGP which calls wm.openpgp:execPGPs. There is an undeclared input parameter named “timeout” which can be used to specify the number of seconds to wait. Put a variable with that name into the pipeline before calling encryptFile and it will get picked up by execPGPs.

You’ll want to confirm it is indeed a timeout that is the issue. Try to encrypt the file outside of IS, using gnupg or whatever, to see how long that takes to get a frame of reference.

thanks, Reamon!

I put timeout = 1000 , and run encryptFile. I managed to successfully encrypt the file (2.5 GB), and it takes about 12 mins.
Also, I enrypted the same file outside of IS, using gnupg (gpg --encrypt -r “x” “filename”), and it took about 10 mins.

So, it seems that is really timeout issue. Will it be any disadvantages if I put timeout = 1000?
On the other hand, I also managed to encrypt the file with to= 60s just once… after that, I was getting also Status= -1 even for to=120s and bigger values. Any comments?

Thanks!

The timeout probably won’t be enforced accurately. It will be close but not right on the exact time. Plus, if the machine gets busy doing anything else at all the time to do the encryption will vary.

There won’t be any disadvantage to using 1000, other than an IS thread will be consumed during that wait. It will only consume all 1000 seconds if the call takes longer than that. Since in your test it took about 720s to run, 1000 seems to provide a good buffer time.

thanks!! :slight_smile:

good day to all. just a new webMethods developer.
can you help me on how to replicate a scenario wherein i should force the encryption Status to -1 without hardcoding?

our input files are usually XML files. mostly text.

Thanks in advance

Edson