I was using yadm and got the following error:

gpg: problem with the agent: Inappropriate ioctl for device                                                         │
gpg: error creating passphrase: Operation cancelled                                                                 │
gpg: symmetric encryption of '[stdin]' failed: Operation cancelled                                                  │
ERROR: Unable to write /Users/goliatone/.yadm/files.gpg

Turns out that is a somehow obscure error you get with gpg.

Quick solution:

export GPG_TTY=$(tty)