# Problems finding handler after updating 2.7.10 to 2.8.0

**URL:** <https://forum.ansible.com/t/problems-finding-handler-after-updating-2-7-10-to-2-8-0/30476>\
**Category:** Ansible Project\
**Created:** [June 3, 2019, 12:19pm UTC](https://forum.ansible.com/t/problems-finding-handler-after-updating-2-7-10-to-2-8-0/30476 "2019-06-03T12:19:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan-Philipp\_Bolle](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Jan-Philipp\_Bolle](https://forum.ansible.com/u/Jan-Philipp_Bolle)\
**Post date:** [June 3, 2019, 12:19pm UTC](https://forum.ansible.com/t/problems-finding-handler-after-updating-2-7-10-to-2-8-0/30476/1 "2019-06-03T12:19:05Z")

</div>

Hi,

In my roles I use the following Handler definition:

`

- name: restart prometheus  
include: “roles/common/tasks/restart-service.yml service\_name=prometheus”  
`

This works fine in 2.7.10.

After updating to 2.8.0 I got the following error:

> ERROR! The requested handler ‘restart prometheus’ was not found in either the main handlers list nor in the listening handlers list

I have tried several variants:

`

- name: restart prometheus  
import\_tasks: roles/common/tasks/restart-service.yml  
vars:  
service\_name: prometheus  
`

Same Problem.

If I use a simple debug statement it works:

`

- name: restart prometheus  
debug:  
msg: System {{ inventory\_hostname }} has uuid {{ ansible\_product\_uuid }}

`

I realize that you should avoid dependencies between roles but repeating a block of code over and over doesn’t seem to be a good solution either.

Any idea?

Regards Philipp

---

<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:** [June 3, 2019, 1:48pm UTC](https://forum.ansible.com/t/problems-finding-handler-after-updating-2-7-10-to-2-8-0/30476/2 "2019-06-03T13:48:59Z")

</div>

You have a few issues, one you have already attempted to address.

1. Don’t use `include` as it has behavior that cannot be easily reasoned and understood in many cases
2. A change was made in Ansible 2.8 that is documented in the porting guide, preventing you from using a static include or `import_tasks` as a handler itself. This is described in more detail at [https://docs.ansible.com/ansible/latest/porting\_guides/porting\_guide\_2.8.html#imports-as-handlers](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html#imports-as-handlers)

Effectively, what you need is to switch to `include_tasks`:

- name: restart prometheus  
include\_tasks: roles/common/tasks/restart-service.yml  
vars:  
service\_name: prometheus

---

<div class="post-metadata">

**Author:** ![Jan-Philipp\_Bolle](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Jan-Philipp\_Bolle](https://forum.ansible.com/u/Jan-Philipp_Bolle)\
**Post date:** [June 4, 2019, 6:06am UTC](https://forum.ansible.com/t/problems-finding-handler-after-updating-2-7-10-to-2-8-0/30476/3 "2019-06-04T06:06:20Z")

</div>

Hi Matt  
thanks so much with include\_tasks it works.

Best regards  
Philipp
