GPG encryption error ...

Hi. I'm hitting issues using gpg to encrypt a text file on Linux.

gpg -c --passphrase 123 --cipher-algo AES256 test
gpg: cancelled by user
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of `test' failed: Operation cancelled

In this case the file test just has a few numbers in it. This is something that has worked in the past so it's a configuration issue but I'm struggling to work out exactly what that issue is.

The daemon is running ...

$pidof gpg-agent
1532011 1504881

I tried setting GPG_AGENT_INFO but it doesn't make a difference

Any ideas of the approach I should take to resolve this?
Many thanks.

How exactly are you running this? Locally or remotely? Over ssh? Through a tunnel?

From this bug:

A work-around may be running it inside a screen session.

Hi. I'm running it locally.

in the end I just used openssl to encrypt/decrypt a txt file and it worked fine:

 
print "abc123" > keyfile
print "testing 123" > plaintext.txt 
openssl aes-256-cbc -a -salt -in plaintext.txt -out plaintext.txt.enc -pass file:keyfile
rm plaintext.txt 
openssl aes-256-cbc -d -a -in plaintext.txt.enc -out plaintext.txt -pass file:keyhole
cat plaintext.txt