gpg: cannot open ‘/dev/tty’: No such device or address error while encrypting/decrypting using PGP keys

Description

You get the following error while trying to use the encrypt post-process command or the decrypt pre-process command.

gpg: cannot open '/dev/tty': No such device or address

Resolution

This error happens because the system tries to output to /dev/tty which either does not exists in the file system, or the neolane user does not has rights of this directory. In order to fix it, we need to by-pass this step. In the GPG command, add --no-tty to skip this step. For eg:

etl

preProcessCommand command=“gpg --decrypt –no-tty --recipient ******** “$fileName”” label=“Decryption GPG” name=“GPGdecrypt”/
     postProcessCommand command=“gpg --encrypt –no-tty --recipient ******* “$fileName”” label=“Encryption GPG” name=“GPGencrypt” suffix=“gpg”/

/etl

Also plesae check if  --passphrase passphrase in preProcessCommand is present or not . If passphrase is missing then also we can get this error

etl
        preProcessCommand name="GPGdecrypt" label ="Decryption GPG" command="gpg --decrypt --passphrase passphrase --recipient CampaignOperations@adobe.com "$fileName""/
        postProcessCommand name="GPGencrypt" label ="Encryption GPG" command="gpg --encrypt --recipient comp_ops@xxx.com.au "$fileName"" suffix="gpg"/
    /etl

On this page