# Action Plugin \_execute\_module fails with "missing interpreter line"

**URL:** <https://forum.ansible.com/t/action-plugin-execute-module-fails-with-missing-interpreter-line/8690>\
**Category:** Get Help\
**Created:** [September 22, 2024, 5:38pm UTC](https://forum.ansible.com/t/action-plugin-execute-module-fails-with-missing-interpreter-line/8690 "2024-09-22T17:38:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clinta](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/clinta/32/4837_2.png) [@clinta](https://forum.ansible.com/u/clinta)\
**Post date:** [September 22, 2024, 5:38pm UTC](https://forum.ansible.com/t/action-plugin-execute-module-fails-with-missing-interpreter-line/8690/1 "2024-09-22T17:38:25Z")

</div>

I’m trying to create an action plugin, and I’ve simplified it to a very basic demonstration of this issue. When my action module calls another module with `self._execute_module`, the task fails reporting that the module being called `is missing interpreter line`. Here’s a minimal example:

`action_plugins/basic.py`

```python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.action import ActionBase

class ActionModule(ActionBase):
    def __init__ (self, *args, **kwargs):
        super(ActionModule, self). __init__ (*args, **kwargs)

    def run(self, tmp=None, task_vars=None):
        super(ActionModule, self).run(tmp, task_vars)
        return self._execute_module(
            module_name='ansible.builtin.debug',
            module_args={'msg': 'testing'},
            task_vars=task_vars,
        )

```

`test_task.yml`

```yaml
- name: Test action module
  gather_facts: false
  hosts: localhost
  tasks:
    - name: Test action module
      basic: {}

```

And when running this basic task, I get the failure:

```auto
fatal: [localhost]: FAILED! => {
    "msg": "module (ansible.builtin.debug) is missing interpreter line"
}

```

I’ve tried different shebang options in my action plugin with no changes. The error seems to originate from [here](https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/ __init__.py#L1052-L1053), but I’m sure there’s more going on here than I understand, cause this line seems to be looking for a shebang, but none of the built in modules have shebangs.

I’m really at a loss for what’s going on here.

---

<div class="post-metadata">

**Author:** ![flowerysong](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/flowerysong/32/2305_2.png) [@flowerysong](https://forum.ansible.com/u/flowerysong)\
**Post date:** [September 22, 2024, 7:47pm UTC](https://forum.ansible.com/t/action-plugin-execute-module-fails-with-missing-interpreter-line/8690/2 "2024-09-22T19:47:20Z")

</div>

`ansible.builtin.debug` is not a module, it is an action plugin. Try executing an actual module, like `ansible.builtin.ping`.
