# ansible-vault create foo.yml returns \[Errno 2\] No such file or directory

**URL:** <https://forum.ansible.com/t/ansible-vault-create-foo-yml-returns-errno-2-no-such-file-or-directory/15479>\
**Category:** Ansible Project\
**Created:** [June 17, 2014, 9:58am UTC](https://forum.ansible.com/t/ansible-vault-create-foo-yml-returns-errno-2-no-such-file-or-directory/15479 "2014-06-17T09:58:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_S](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Patrick\_S](https://forum.ansible.com/u/Patrick_S)\
**Post date:** [June 17, 2014, 9:58am UTC](https://forum.ansible.com/t/ansible-vault-create-foo-yml-returns-errno-2-no-such-file-or-directory/15479/1 "2014-06-17T09:58:17Z")

</div>

Hi,

I’m running version 1.6.2 and when going through the documentation and copying the ansible-vault create example:

`

```auto
ansible-vault create foo.yml

```

`

The following is returned:

`

ansible-vault create foo.yml  
Vault password:  
Confirm Vault password:  
ERROR: [Errno 2] No such file or directory

`

When running the encrypt command, on the other hand, it is able to encrypt the file.  
Sadly, from the encrypted state, then running the edit command returns the usual ‘[Errno 2]’ error.

Any help is greatly appreciated. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 17, 2014, 7:14pm UTC](https://forum.ansible.com/t/ansible-vault-create-foo-yml-returns-errno-2-no-such-file-or-directory/15479/2 "2014-06-17T19:14:21Z")

</div>

Hmm, that’s curious.

Do you have permissions on the current directories and such?

Anyway, 1.6.3 is the latest release version - let us know if the problem exists there.

---

<div class="post-metadata">

**Author:** ![Patrick\_S](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Patrick\_S](https://forum.ansible.com/u/Patrick_S)\
**Post date:** [June 17, 2014, 10:04pm UTC](https://forum.ansible.com/t/ansible-vault-create-foo-yml-returns-errno-2-no-such-file-or-directory/15479/3 "2014-06-17T22:04:28Z")

</div>

Hi,

It turns out that when I echo’d $EDITOR in Ubuntu nothing was aliased. Running EDITOR=/usr/bin/vim resolved the issue.

The error message put me on the wrong tracks in the sense that ‘No file or directory’ is not quite the same as something such as ‘No default editor set’.

I hope this helps others.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 18, 2014, 3:44pm UTC](https://forum.ansible.com/t/ansible-vault-create-foo-yml-returns-errno-2-no-such-file-or-directory/15479/4 "2014-06-18T15:44:50Z")

</div>

Ok please make sure there’s a github ticket filed on this one and we can look at better error reporting when EDITOR is not set.

Thanks!
