Sensu cli stash json error

109 Views Asked by At

I am trying to create a sensu stash using the cli as such:

sensu cli stash create silence/client

This then gives me a json file to create the stash, I put in my requirements as such:

{
  "path": "silence/client",
  "Content-Type": "application/json",
  "content": {
    "reason": "reason here",
    "source": "uchiwa",
    "timestamp": 1493220469
  }
}

But when i save the file i get this error:

JSON::ParserError: A JSON text must at least contain two octets!

I am not too familiar with json, what does this mean?

1

There are 1 best solutions below

0
On

As per this question's answer, your json file may have been empty or malformed somehow.

Currently, if you create an empty or malformed json file for a stash, you get the following output from sensu-cli:

sensu-cli stash create 'silence/test'
The stash you created has invalid JSON.