# \[SOS\] Error with self-developed shell module

**URL:** <https://forum.ansible.com/t/sos-error-with-self-developed-shell-module/20175>\
**Category:** Ansible Project\
**Created:** [January 12, 2016, 9:42am UTC](https://forum.ansible.com/t/sos-error-with-self-developed-shell-module/20175 "2016-01-12T09:42:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edison\_wang1](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@edison\_wang1](https://forum.ansible.com/u/edison_wang1)\
**Post date:** [January 12, 2016, 9:42am UTC](https://forum.ansible.com/t/sos-error-with-self-developed-shell-module/20175/1 "2016-01-12T09:42:19Z")

</div>

hi,

I wrote a simple shell script and made it as Ansible module with putting it under Library Path. I ran the module and got the failure message. However, I can tell from the output message that the shell module has been run actually. So I don’t understand why Ansible returns such failure message.

**Below has the detail, the OS type of target system is AIX**

_root@b1a52ef5f33f:/usr/share/my\_modules# ansible aix -m getos_  
_9.123.195.164 | **FAILED**! =\> {_  
_“changed”: false,_  
_“failed”: true,_  
_“module\_stderr”: “”,_  
_“module\_stdout”: “AIX lpar1 1 7 00CB4D6E4C00\r\n”,_  
_“msg”: “MODULE FAILURE”,_  
_“parsed”: false_  
_}_

_root@b1a52ef5f33f:/usr/share/my\_modules# cat getos_  
_#!/bin/sh_

_uname -a_

Meanwhile, I used the test-module utility to test my shell module and see error with “ValueError: No JSON object could be decoded”. So I assume that is the root cause maybe.

root@b1a52ef5f33f:/ansible# hacking/test-module -m /usr/share/my\_modules/getos

- including generated source, if any, saving to: /root/.ansible\_module\_generated
- this may offset any line numbers in tracebacks/debuggers!

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 12, 2016, 2:56pm UTC](https://forum.ansible.com/t/sos-error-with-self-developed-shell-module/20175/2 "2016-01-12T14:56:21Z")

</div>

"AIX lpar1 1 7 00CB4D6E4C00\r\n",

^ that is not JSON, modules MUST return JSON to Ansible.
