# ansible-vault fails if vault-pass is passed when env variable defined

**URL:** <https://forum.ansible.com/t/ansible-vault-fails-if-vault-pass-is-passed-when-env-variable-defined/29928>\
**Category:** Ansible Developer\
**Created:** [March 20, 2019, 7:46pm UTC](https://forum.ansible.com/t/ansible-vault-fails-if-vault-pass-is-passed-when-env-variable-defined/29928 "2019-03-20T19:46:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alb0t](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@Alb0t](https://forum.ansible.com/u/Alb0t)\
**Post date:** [March 20, 2019, 7:46pm UTC](https://forum.ansible.com/t/ansible-vault-fails-if-vault-pass-is-passed-when-env-variable-defined/29928/1 "2019-03-20T19:46:15Z")

</div>

I spent about 4 hours trying to figure out what was going on here.  
This is the command I was using:  
ansible-vault encrypt\_string --vault-pass ~/blah/vault\_key

Every time I ran this, I was greeted with an error:  
`ERROR! The vault-ids default,default are available to encrypt. Specify the vault-id to encrypt with --encrypt-vault-id`

Turns out, I had to unset my vault-pass env variable for this to work:  
ANSIBLE\_VAULT\_PASSWORD\_FILE=~/blah/vault\_key

unset ANSIBLE\_VAULT\_PASSWORD\_FILE

It would have saved me a lot of time if the error message actually said what the vault-id path was, which i thought was different than a vault-pass for some reason, or if the system just de-duplicated the multiple vault-keys.

So I guess what I’m asking is, is there someone that wants to help prevent another person from wasting hours of their time on this? 🙂
