# Eda-server not importing runbooks on project import/sync

**URL:** <https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962>\
**Category:** Get Help\
**Tags:** ansible-rulebook, eda-operator, eda-server, awx\
**Created:** [October 25, 2023, 7:07pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962 "2023-10-25T19:07:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![watsonb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/watsonb/32/309_2.png) [@watsonb](https://forum.ansible.com/u/watsonb)\
**Post date:** [October 25, 2023, 7:07pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/1 "2023-10-25T19:07:12Z")

</div>

Greetings folks,

I’m jumping onto the EDA band wagon. I’ve authored some fairly simple runbooks and a couple of custom event source plugins and all works well on the command-line via `ansible-runbook`. So now I want a server to do this (much like I have an AWX server for scheduled playbook runs).

I found the eda-server-operator project, which seems to function much like the awx-operator project. Using it, I was able to deploy EDA to my existing K8S cluster that runs AWX…nice!

I can login to the GUI and I’ve created various Credentials (for accessing git-based projects and Decision Environment images). I created a couple of Projects (using a credential) and the project successfully “syncs”. I also created a Decision Environment (I assume that is pulled when an activation is triggered?).

Now the last part (the one that isn’t working). I’m trying to create my first Activation. I specify various details, choose the project, etc. There is a drop-down list to pick the rulebook to use (assuming the rulebook comes from the imported Project). However this drop-down is always empty for me. Also, unlike AWX where there was a drop-down with free-form text, there is no free-form text for me to specify which rulebook to use (manually) for this activation.

If I look at the logs of the “default workers” running in the cluster at Project import/sync time, I can see messages like this:

> <https://github.com/ansible/eda-server/blob/05a29ea3f9bf06b051d5e5375cd6f07cc1f14173/src/aap_eda/tasks/project.py#L27C11-L27C12>

The “Task started” / “Task complete” messages happen in under a second, which makes me think something is wrong or being skipped in the import/sync process (just cloning a repo could take a second). Alas, I don’t see anywhere else in the code where logging would show me anything nor do I know how to turn up the logging level.

I fully understand that EDA operator and various sub components (eda-server, eda-ui, etc.) are probably still alpha/beta at this time. Just thought I’d share some feedback, solicit some help, and see if I can help further my understanding and the project itself.

Thanks,

Ben

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [October 26, 2023, 12:33am UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/2 "2023-10-26T00:33:28Z")

</div>

Hi,

EDA Server only searches rulebooks under `rulebooks/` and `extensions/eda/rulebooks` on your project root.

> <https://github.com/ansible/eda-server/blob/05a29ea3f9bf06b051d5e5375cd6f07cc1f14173/src/aap_eda/services/project/imports.py#L184-L187>

Ensure your rulebooks are placed under `rulebooks/` or `extensions/eda/rulebooks` and try again.

See also:

> The rulebooks of a project must be located in the `/rulebooks` folder at the root of the project or at the path defined for Event-Driven Ansible content in Ansible collections: `/extensions/eda/rulebooks` .  
> [Chapter&nbsp;3.&nbsp;Projects Red Hat Ansible Automation Platform 2.4 | Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.4/html/event-driven_ansible_controller_user_guide/eda-projects)

---

<div class="post-metadata">

**Author:** ![watsonb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/watsonb/32/309_2.png) [@watsonb](https://forum.ansible.com/u/watsonb)\
**Post date:** [October 26, 2023, 10:40am UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/3 "2023-10-26T10:40:36Z")

</div>

My project tree structure looks like this:

```auto
.
├── ansible.cfg
├── bindep.txt
├── collections
│ └── requirements.yml
├── extensions
│ └── eda
├── playbooks
│ ├── inventory.yml
│ └── print_alert_details.yml
├── README.md
├── requirements.txt
├── rulebooks
│ ├── new_alert_rulebook_awx_collection.yml
│ ├── new_alert_rulebook_awx_repo.yml
│ ├── new_alert_rulebook_collection.yml
│ └── new_alert_rulebook_repo.yml
└── VERSION.md

```

I’d expect it to pick up four (4) rulebooks in this case, no? For what it’s worth, I used operator version “main” and it has been running for approximately 48 hours.

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [October 26, 2023, 11:59am UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/4 "2023-10-26T11:59:58Z")

</div>

> [@watsonb](#):
>
> I’d expect it to pick up four (4) rulebooks in this case, no?

Correct, your four rulebooks should be detected.

I can’t reproduce your issue on my side with the following fresh setup:

- `quay.io/ansible/eda-server-operator:main`
- `quay.io/ansible/eda-server:main`
- `quay.io/ansible/eda-ui:latest`

This is my log from my default worker:

```bash
2023-10-26 11:50:59,276 INFO default: aap_eda.tasks.project.import_project(project_id=1) (eb64b02f-fb1d-4ddc-9720-57b531876180)
2023-10-26 11:50:59,287 INFO Task started: Import project ( project_id=1 )
2023-10-26 11:51:00,118 INFO Task complete: Import project ( project_id=1 )
2023-10-26 11:51:00,120 INFO default: Job OK (eb64b02f-fb1d-4ddc-9720-57b531876180)
2023-10-26 11:51:00,120 INFO Result is kept for 500 seconds

```

Could you test with my example repository that contains two rulebooks?: `https://github.com/kurokobo/awx-on-k3s`

Also, try super-reloading (Shift + F5) on the page to add rulebook activations, or using incognito tab.

---

<div class="post-metadata">

**Author:** ![watsonb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/watsonb/32/309_2.png) [@watsonb](https://forum.ansible.com/u/watsonb)\
**Post date:** [October 26, 2023, 12:26pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/5 "2023-10-26T12:26:10Z")

</div>

Interesting. I mirrored your repo over to my private GitLab instance and imported it into EDA and I can, in fact, see your two rulebooks available for activations. The one glaring difference I see immediately is that you’ve suffixed your files as `*.yaml` whereas I always use `*.yml`. Is there any content inspection done on the EDA side to see that the content of the rulebook is “valid”?

---

<div class="post-metadata">

**Author:** ![watsonb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/watsonb/32/309_2.png) [@watsonb](https://forum.ansible.com/u/watsonb)\
**Post date:** [October 26, 2023, 1:06pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/6 "2023-10-26T13:06:15Z")

</div>

Alright, I figured it out. Because I had both of these paths in my repo:

1 ./extensions/eda/rulebooks  
2 ./rulebooks

And because #1 was empty, the project import must have skipped #2 given the presence of #1. Seems these paths are mutually exclusive (one OR the other, but not both).

I was using this repo to both develop a custom EDA source plugin and to have some rulebooks for testing (all worked great on the command line). Later I moved my custom source plugins into an Ansible collection (tested with the FQCN of the plugin on the command-line and that worked too). Now that collection is in my custom Decision Environment, so I probably should have cleaned out the `extensions` folder altogether.

Might be worth updating docs to account for this behavior or support discovery of rulebooks from both directories.

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [October 26, 2023, 1:28pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/7 "2023-10-26T13:28:19Z")

</div>

> [@watsonb](#):
>
> Alright, I figured it out. Because I had both of these paths in my repo:
> 
> 1 ./extensions/eda/rulebooks  
> 2 ./rulebooks
> 
> And because #1 was empty, the project import must have skipped #2 given the presence of #1. Seems these paths are mutually exclusive (one OR the other, but not both).

Ah good find, make great sense. Agree, this should be documented, or discovery should be improved. Could you please open new issue for this RFE?

- [Issues · ansible/eda-server · GitHub](https://github.com/ansible/eda-server/issues)

---

<div class="post-metadata">

**Author:** ![watsonb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/watsonb/32/309_2.png) [@watsonb](https://forum.ansible.com/u/watsonb)\
**Post date:** [October 26, 2023, 1:35pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/8 "2023-10-26T13:35:34Z")

</div>

Done.

[https://github.com/ansible/eda-server/issues/465](https://github.com/ansible/eda-server/issues/465)

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [October 27, 2023, 12:22pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/9 "2023-10-27T12:22:16Z")

</div>

An important information is provided by @Alex-Izquierdo on above issue on GitHub, so I’m duplicating his comment here for future references:

> The `/rulebooks` layout originates from the earliest versions of the application. It’s an old path that we’ve kept for backward compatibility. However, it’s slated for deprecation in the future, and we don’t have plans to support both paths concurrently. The only supported path is the ansible-collection official one: `/extensions/eda/rulebooks` and I recommend to migrate your projects accordingly.  
> [discover rulebooks from both paths (or document first path found and implications) · Issue #465 · ansible/eda-server · GitHub](https://github.com/ansible/eda-server/issues/465#issuecomment-1781822029)

---

<div class="post-metadata">

**Author:** ![watsonb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/watsonb/32/309_2.png) [@watsonb](https://forum.ansible.com/u/watsonb)\
**Post date:** [October 27, 2023, 12:25pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/10 "2023-10-27T12:25:39Z")

</div>

Yes, I saw the update. Whilst I don’t necessarily agree with it, it is early yet and won’t impact me too much.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 26, 2023, 12:25pm UTC](https://forum.ansible.com/t/eda-server-not-importing-runbooks-on-project-import-sync/1962/11 "2023-11-26T12:25:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
