You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Intermittently getting cannot allocate memory error while decrypting a file via python gnupg package
To Reproduce
Steps to reproduce the behavior:
Initialize the gpg agent and decrypt the file :
gpg_obj = gnupg.GPG(gnupghome=os.path.expanduser('~'))
gpg_obj.encoding = 'utf-8'
gpg_obj.decrypt_file()
Expected behavior
File should get decrypted successfully
Screenshots
Do not have screenshot but exact error is this \ngpg: public key decryption failed: Cannot allocate memory\n[GNUPG:] ERROR pkdecrypt_failed 67141718\n[GNUPG:] BEGIN_DECRYPTION\n[GNUPG:] DECRYPTION_FAILED\ngpg: decryption failed: No secret key\n[GNUPG:] END_DECRYPTION\n
Environment
OS, including version : Ubuntu 20.04.6 LTS
Version of this library: python-gnupg==0.5.0
Version of GnuPG: gpg (GnuPG) 2.2.19, libgcrypt 1.8.5
Additional information
Apologies in advance if any information is sufficient as I am not very used to raising issues , however I saw here that using the option --auto-expand-secmem has solved the issue for lot of people facing the issue. However I could not see anything mentioned about how to use this option via the python gnupg package. And I am facing a critical issue regarding this. It would be great if I can get help reg
How can I use this option in the gnupg package
Is there a way to limit the max memory being used via this option since in the worst I want to avoid this consuming the majority of system's RAM
The text was updated successfully, but these errors were encountered:
Well, how much free memory do you have before running your program? Are you running into problems on your own machine, or a VPS or container somewhere?
The --auto-expand-secmem appears to be a parameter passed to gpg-agent, not gpg, so I'm not sure it'll help you from pytho-gnupg. Did you read the documentation for decrypt_file() carefully? If you did, how is it you "could not see anything mentioned" about passing other arguments?
Does the test suite test_gnupg.py run on the machine in question? You can turn on logging for gnupg and the log will show the exact command lines used to invoke gpg. What happens if you call gpg directly from the command line with the same or equivalent arguments?
In general people haven't reported memory-related problems, and the error you showed is from gpg and not due to python-gnupg. It sounds like it's related to low memory in your environment. I'll mark this as pending and close it soon if I don't see some evidence that the problem is due to python-gnupg.
Describe the bug
Intermittently getting cannot allocate memory error while decrypting a file via python gnupg package
To Reproduce
Steps to reproduce the behavior:
Initialize the gpg agent and decrypt the file :
gpg_obj = gnupg.GPG(gnupghome=os.path.expanduser('~'))
gpg_obj.encoding = 'utf-8'
gpg_obj.decrypt_file()
Expected behavior
File should get decrypted successfully
Screenshots
Do not have screenshot but exact error is this
\ngpg: public key decryption failed: Cannot allocate memory\n[GNUPG:] ERROR pkdecrypt_failed 67141718\n[GNUPG:] BEGIN_DECRYPTION\n[GNUPG:] DECRYPTION_FAILED\ngpg: decryption failed: No secret key\n[GNUPG:] END_DECRYPTION\n
Environment
Additional information
Apologies in advance if any information is sufficient as I am not very used to raising issues , however I saw here that using the option
--auto-expand-secmem
has solved the issue for lot of people facing the issue. However I could not see anything mentioned about how to use this option via the python gnupg package. And I am facing a critical issue regarding this. It would be great if I can get help regThe text was updated successfully, but these errors were encountered: