Fresh build of bitcoind, fresh wallet.
- ran
./bitcoind encryptwallet ...... - restarted bitcoind
- ran
./bitcoind walletpassphrase .... - received
error: {"code":-15,"message":"Error: running with an unencrypted wallet, but walletpassphrase was called."}
Also can dumpprivkey without unlocking the wallet.