Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fauxhai.fetch is giving JSON::ParserError: error #324

Open
Deepak1100 opened this issue Aug 23, 2018 · 5 comments
Open

Fauxhai.fetch is giving JSON::ParserError: error #324

Deepak1100 opened this issue Aug 23, 2018 · 5 comments

Comments

@Deepak1100
Copy link

Deepak1100 commented Aug 23, 2018

    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)
@coderanger
Copy link
Collaborator

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?

@Deepak1100
Copy link
Author

@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.

@coderanger
Copy link
Collaborator

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)?

@Deepak1100
Copy link
Author

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.

@oscar123mendoza
Copy link
Contributor

I got around this error by simply creating the /etc/chef/ohai/plugins directory and leaving it empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants