0

I am trying to generate a chef-vault in windows workstation and getting below error every time

ERROR: JSON::ParserError: {username: root, password: mypassword} is not valid JSON! $PS C:\Users\09242766> knife vault create passwords root '{"username": "root", "password": "mypassword"}' -A "admin,sanka r" ERROR: JSON::ParserError: {username: root, password: mypassword} is not valid JSON!

What would be the possible issue with this ?

Below are the versions I am using Chef Development Kit Version: 3.3.23 chef-client version: 14.5.33 berks version: 7.0.6 kitchen version: 1.23.2 inspec version: 2.2.112

1 Answers1

1

The "s are being misinterpreted inside the JSON string, but it only seems to be within the knife tool. If you escape them like below, it works fine.

knife vault create passwords root '{\"username\": \"root\", \"password\": \"mypassword\"}'

Alternatively, using the -J flag and supplying a JSON file also works fine.