I can't encrypt the directory

tar -czf - Mistere | gpg --symmetric --cipher-algo AES256 -o mis.tar.gz.gpg

gpg: problem with the agent: Inappropriate ioctl for device
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of ‘[stdin]’ failed: Operation cancelled
tar: -: Wrote only 8192 of 10240 bytes
tar: Error is not recoverable: exiting now

Is the gpg-agent running for the user?