# ERROR! Unexpected Exception, this is probably a bug: unhashable type: 'dict'

**URL:** <https://forum.ansible.com/t/error-unexpected-exception-this-is-probably-a-bug-unhashable-type-dict/26543>\
**Category:** Ansible Project\
**Created:** [January 23, 2018, 6:15pm UTC](https://forum.ansible.com/t/error-unexpected-exception-this-is-probably-a-bug-unhashable-type-dict/26543 "2018-01-23T18:15:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timothy.wall](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@timothy.wall](https://forum.ansible.com/u/timothy.wall)\
**Post date:** [January 23, 2018, 6:15pm UTC](https://forum.ansible.com/t/error-unexpected-exception-this-is-probably-a-bug-unhashable-type-dict/26543/1 "2018-01-23T18:15:43Z")

</div>

Running Ansible 2.4.2.0 on OSX 10.13.2 (via macports), python version 3.6.4.

I’m running a playbook of some 100-odd tasks and this error occurs at some point in that operation. I can repeatedly run the playbook and get successively closer to the end.

Some operations must run; if everything is skipped then no error occurs. The stack trace usually seems to point to a handler, but I can’t spot the error.

With “-vvv”:

> the full traceback was:  
> Traceback (most recent call last):  
> File “/opt/local/bin/ansible-playbook”, line 106, in   
> exit\_code = cli.run()  
> File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible/cli/playbook.py”, line 130, in run  
> results = pbex.run()  
> File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible/executor/playbook\_executor.py”, line 154, in run  
> result = self.\_tqm.run(play=play)  
> File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible/executor/task\_queue\_manager.py”, line 290, in run  
> play\_return = strategy.run(iterator, play\_context)  
> File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible/plugins/strategy/linear.py”, line 292, in run  
> results += self.\_wait\_on\_pending\_results(iterator)  
> File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible/plugins/strategy/ **init**.py”, line 586, in \_wait\_on\_pending\_results  
> results = self.\_process\_pending\_results(iterator)  
> File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible/plugins/strategy/ **init**.py”, line 470, in \_process\_pending\_results  
> if handler\_name in self.\_listening\_handlers:  
> TypeError: unhashable type: ‘dict’

It would seem that the error is happening when notifications are collected, e.g. one task after which the failure occurs. Note that this is one task in the middle of several which do the “notify”:

> - name: install hiredis 0.13 shared library  
> become: yes  
> copy: src={{ item.src }} dest={{ item.dest }} mode={{ item.mode }}  
> with\_items:
> - { src: “libhiredis.so.0.13”, dest: “/usr/lib64/”, mode: ‘0755’ }  
> tags: provision, hiredis, redis\_fdw  
> notify:
> - name: restart postgres

The handler definition:

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 23, 2018, 7:15pm UTC](https://forum.ansible.com/t/error-unexpected-exception-this-is-probably-a-bug-unhashable-type-dict/26543/2 "2018-01-23T19:15:31Z")

</div>

You need to drop the `name: ` from your `notify`:

```auto
notify:

- restart postgres

```

---

<div class="post-metadata">

**Author:** ![Tim\_Wall](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@Tim\_Wall](https://forum.ansible.com/u/Tim_Wall)\
**Post date:** [January 23, 2018, 7:51pm UTC](https://forum.ansible.com/t/error-unexpected-exception-this-is-probably-a-bug-unhashable-type-dict/26543/3 "2018-01-23T19:51:22Z")

</div>

Thanks! I was totally blind to that…
