# Playbook error "... is not JSON serializable"

**URL:** <https://forum.ansible.com/t/playbook-error-is-not-json-serializable/23378>\
**Category:** Ansible Developer\
**Created:** [January 4, 2017, 4:39pm UTC](https://forum.ansible.com/t/playbook-error-is-not-json-serializable/23378 "2017-01-04T16:39:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ep1c\_F4iL](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@Ep1c\_F4iL](https://forum.ansible.com/u/Ep1c_F4iL)\
**Post date:** [January 4, 2017, 4:39pm UTC](https://forum.ansible.com/t/playbook-error-is-not-json-serializable/23378/1 "2017-01-04T16:39:36Z")

</div>

Hi,

I am writing a custom module on **AIX** machines in this case the **SUMA** command.  
I have the following error :

**ansible-playbook test\_suma\_download.yml**  
…  
An exception occurred during task execution. To see the full traceback, use -vvv. **The error was: TypeError: datetime.date(7100, 2, 2) is not JSON serializable**  
fatal: [castor1]: FAILED! =\> {“failed”: true, “msg”: “Unexpected failure during module execution.”, “stdout”: “”}

Here is a snippet of my playbook

`

---

<div class="post-metadata">

**Author:** ![Ep1c\_F4iL](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@Ep1c\_F4iL](https://forum.ansible.com/u/Ep1c_F4iL)\
**Post date:** [January 5, 2017, 9:14am UTC](https://forum.ansible.com/t/playbook-error-is-not-json-serializable/23378/2 "2017-01-05T09:14:31Z")

</div>

`Since then I have tried the following:`

` **rq_name** : 7100-02-02 => `**TypeError: datetime.date(7100, 2, 2) is not JSON serializable**  
` **rq_name** : "7100-02-02" => **OK** `  
` **rq_name** : 7100-02-02-1009 ``=> **OK** `  
` **rq_name** : "```7100-02-02-1009`" ```=\> **OK** ``

The obvious solution is to have ` **rq\_name** declared as string “7100-02-02”``` but I would still be interested in a proper solution **!** ``
