Symptoms

We are unable to export the GnuPG private key via cPanel’s Encryption module with the following error occurring:

Error: The key failed to load due to an error: The system failed to export the GPG key “$key_id”.

 

Description

This is caused by using a non-default server locale.

We've opened an internal case for our development team to investigate this further. For reference, the case number is  CPANEL-49826. Follow this article to receive an email notification when a solution is published in the product. 

 

Workaround

Set the server locale back to the default with the following:

localectl set-locale LANG=en_US.UTF-8

You will then need to restart systemd-localed.service and cprsvd:

systemctl restart systemd-localed.service
/scripts/restartsrv_cpsrvd --hard


As an alternative, you can also use the UAPI function export_secret_key:

Export GnuPG secret key