fauxhai
fauxhai copied to clipboard
Fauxhai.fetch is giving JSON::ParserError: error
base::default When all attributes are default, on an amazon 2017.09 install packages
Failure/Error: Fauxhai.fetch(host: 'xxxxx')
JSON::ParserError:
416: unexpected token at '-08-23T18:01:08+00:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
{
"dmi": {
},
"languages": {
"perl": {
......
}
'
I think is because of the last single quote.
Installing fauxhai 5.6.0 (was 5.5.0)
There is no quote in the file https://raw.githubusercontent.com/chefspec/fauxhai/master/lib/fauxhai/platforms/amazon/2017.09.json so I'm not sure where that came from, are you sure that isn't just part of the error display?
@coderanger i think you are right the last single is part of error display.(i have updated the error msg) But I have checked the JSON of ohai properties displayed in error and it is valid JSON.
It's pretty rare to use Fauxhai directly, and the fetch API even more rare. What's your use case? Is there possibly something wrong with the network such that it's getting back a proxy error page (which would be HTML)?
I have using many node['ec2'] ohai attributes in my recipe which is causing the test to fail. and to mock those ec2 attributes I am fetching them from dev server. Btw this is the first time I am writing chefspec test and so just wanted to know if this is the way to mock ec2 data.
I got around this error by simply creating the /etc/chef/ohai/plugins directory and leaving it empty