[Bug?] Can't update vault entries [ChefDK, Windows 10]

Hello Folks,

I'm new to chef and started to use encrypted data bags to store sensitive information.
In this case I'm storing the mysql password.

Workstation: Windows 10 x64 with ChefDK (Version 1.0.3)
knife.rb: knife[:editor] = "notepad"

I created the vault using this command
knife vault create credentials mysql --admins "cadmin,node1" --mode client -J data_bags/credentials/mysql.json

Verified content using this command
knife vault show credentials mysql

Now I would like to change the stored password.
According to the documentation I should use this command:
knife vault edit [vault] [item]
==>
knife vault edit credentials mysql

This opens my default editor (notepad) and I can change the password.

However: After hitting 'save' and closing notepad the change doesn't get saved
Executing knife vault show credentials mysql results in the same values as before.

The only waring I get is:

WARN: Auto inflation of JSON data is deprecated. Please pass in the class to inflate or use #edit_hash at C:/opscode/chefdk/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `edit_data'

Any ideas what I'm missing?

Thanks in advance.

When you issue your knife vault edit… you need to pass --mode client too ! Or else it will try to edit a local databag instead !

Try that and see if it works

1 Like

Thank you nukepuppy. This solved the problem.

For other people facing the same problem, this was the command that worked:
knife vault edit [vault] [item] --mode client

One final question @nukepuppy:
Can you tell me please how to use this in conjunction with vagrant?
Updating the vault doesn’t seems to effect my files under chef-repo\credentials\ mysql.json and mysql_keys.json.

Maybe the only solution is to manage a separate unencrypted .json-File and pass it to vagrant through .kitchen.yml?

Best regards