cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post

APIResponse received a response which is not a valid JSON

Jump to solution

Hello All:

While testing demo-playbook.yml, I get the following error. Any ideas as to why the response is invalid? 

api status -s outout attached

[root@Ansible-Cent Playbooks]# ansible-playbook -C demo-playbook.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [127.0.0.1]

TASK [login] *******************************************************************
ok: [127.0.0.1]

TASK [add host] ****************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Command 'add-host {u'name': u'host_demo_1', u'ip-address': u'1.1.1.1'}' failed with error message: APIResponse received a response which is not a valid JSON.. All changes are discarded and the session is invalidated."}
to retry, use: --limit @/root/cpAnsible/Playbooks/demo-playbook.retry

PLAY RECAP *********************************************************************
127.0.0.1 : ok=2 changed=0 unreachable=0 failed=1

0 Kudos
1 Solution

Accepted Solutions
Admin
Admin

Re: APIResponse received a response which is not a valid JSON

Jump to solution

From the api status output, it looks like the API server crashed for some reason.

If I had to guess, it's because you've configured this VM with only 4GB of RAM.

The stated minimum in the release notes for R80.20.M2 is 6GB of RAM.

I highly recommend more. 

In my own lab, my management VM has 16GB of RAM allocated (but I'm also using SmartEvent).

0 Kudos
2 Replies
Admin
Admin

Re: APIResponse received a response which is not a valid JSON

Jump to solution

From the api status output, it looks like the API server crashed for some reason.

If I had to guess, it's because you've configured this VM with only 4GB of RAM.

The stated minimum in the release notes for R80.20.M2 is 6GB of RAM.

I highly recommend more. 

In my own lab, my management VM has 16GB of RAM allocated (but I'm also using SmartEvent).

0 Kudos

Re: APIResponse received a response which is not a valid JSON

Jump to solution

Thanks Dameon:

Your guess is right, the demo mgr was setup with 4 GB ram.

While, I didn't notice spike in memory on Manager when playbook was run but  after upgrading the memory to 8 GB, the error didn't occur. 

0 Kudos