错误 — gpg:无法打开'/dev/tty':没有此类设备或地址 — 使用PGP密钥加密/解密时

若要在使用PGP密钥加密或解密时修复错误"gpg: cannot open '/dev/tty': No such device or address",请通过在GPG命令中添加--no-tty跳过系统尝试输出到/dev/tty的步骤。

描述 description

环境

  • Campaign Classic
  • Campaign
  • Campaign Standard

问题/症状

使用encrypt post-process命令或decrypt pre-process命令时出现以下错误。

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

分辨率 resolution

要修复上述错误,您需要绕过系统尝试输出到 /dev/tty 的步骤,文件系统中不存在或 neolane 用户无权访问此目录。在 GPG 命令中,添加 --no-tty 跳过这一步。 示例:

<etl>
    <preProcessCommand command="gpg --decrypt --no-tty --recipient <b></b><b></b> &quot;$fileName&quot;" label="Decryption GPG" name="GPGdecrypt"/>
    <postProcessCommand command="gpg --encrypt --no-tty --recipient <b></b><b>* &quot;$fileName&quot;" label="Encryption GPG" name="GPGencrypt" suffix="gpg"/>
</etl>

原因

发生此错误是因为系统尝试输出到/dev/tty,文件系统中不存在或neolane用户无权访问此目录。

另外,检查密码在 preProcessCommand 中存在与否。如果缺少密码,那么我们也会收到此错误。

<etl>
    <preProcessCommand name="GPGdecrypt" label ="Decryption GPG" command="gpg --decrypt --passphrase passphrase --recipient CampaignOperations@adobe.com &quot;$fileName&quot;"/>
    <postProcessCommand name="GPGencrypt" label ="Encryption GPG" command="gpg --encrypt --recipient comp_ops@xxx.com.au &quot;$fileName&quot;" suffix="gpg"/>
</etl>
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f