Search code examples
sqlencryptionssisgnupg

GPG Encryption failing in SSMS Job agent and successful in SSIS


I have a encryption job set, it executes just fine in Visual studio but give the following error in SSMS job agent--> Error retrieving emailid@domain.com via WKD:No data gpg skipped: No Data

Using SQL 2017. I tried using CMDEXEC instead of SSIS Package in job settings but it doesn't solve the problem

Arguments:

--quiet --yes --trust-model always --passphrase mypassphrase --recipient XXX@XXX.com  --trust-model always --output D:\Folder\File.csv.gpg --encrypt D:\Folder\file.csv

Error in SSMS Job

Arguments in SSIS


Solution

  • So I was executing job from the proxy account and apparently proxy and own account is different when it comes to gpg key import. Meaning- I had imported keys using gpg/Kleopatra in my desktop using my windows credentials and was calling the job with my proxy account from job agent. Hence the proxy account was not able to access the keys. This is what solved my problem- https://superuser.com/questions/1176705/windows-account-cant-see-gpg-key#new-answer