<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
We are trying to use SOPS+GPG to encrypt/decrypt yaml files and we have written some go wrapper using sops library to perform the required encryption/decryption. However when trying to execute this code the gpg library seems to be failing at keygeneration most
of the time with the following error.</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<pre><code><span style="font-family: "Courier New", monospace;">failed to encrypt new data key with master key "681E3A89EB1DAFD36EB883120A73BB48E26694D8": could not encrypt data key with PGP key: golang.org/x/crypto/openpgp error: key with fingerprint 681E3A89EB1DAFD36EB883120A73BB48E26694D8 is not available in keyring and could not be retrieved from keyserver; GPG binary error: </span><span style="font-family: "Courier New", monospace; background-color: rgb(255, 255, 0);">gpg binary failed with error: exit status 2, gpg: 681E3A89EB1DAFD36EB883120A73BB48E26694D8: skipped: No public key</span><br><br><span style="font-family: Arial, Helvetica, sans-serif;">​Seems like it is unable to fetch the public key, we are executing the code locally, so we are using the local public and private keys only.<br><br>Though we can list the public key locally, we keep getting the above error quite frequently. However, the encryption/decryption is happening successfully the other times.<br><br>Kindly let us know if we are missing anything.<br><br>We are facing this error only with gpg 2.1.x version, gpg 1.4.x version seems to be working fine.</span></code></pre>
<br>
</div>
<div>
<div id="Signature">
<div>
<div style="font-family:"Arial Black",Arial,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<span style="font-family:Arial,Helvetica,sans-serif">Thank you in advance!<br>
</span></div>
<div style="font-family:"Arial Black",Arial,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Arial Black",Arial,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<span style="font-family:Arial,Helvetica,sans-serif">Best Regards</span></div>
<div style="font-family:"Arial Black",Arial,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<span style="font-family:Arial,Helvetica,sans-serif">Sirisha Gopigiri</span></div>
</div>
</div>
</div>
</body>
</html>