Missing RABL Template


I’m trying to run Ansible roles against a host and getting this error message:

Failed to initialize: RuntimeError - Cannot find rabl template ‘api/v2/hosts/expiration’ within registered (["/usr/share/foreman/app/views"]) view paths!

This is after performing a clean install with foreman-installer.

It appears to be related to another plugin I have, foreman_expire_hosts.

Expected outcome:

The Ansible roles are applied to the host

Foreman and Proxy versions:

Foreman 1.19.0

Foreman and Proxy plugin versions:

foreman-tasks 0.13.4
foreman_ansible 2.2.9
foreman_default_hostgroup 5.0.0
foreman_docker 4.1.0
foreman_expire_hosts 5.1.0
foreman_hooks 0.3.14
foreman_host_extra_validator 0.1.0
foreman_memcache 0.1.1
foreman_monitoring 1.0.1
foreman_openscap 0.10.2
foreman_openscap 1.5.6
foreman_setup 6.0.0
foreman_templates 6.0.3

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)


@paulcalabro: Thanks. Can you please provide the full stack trace of the error message to narrow down the issue? It should be in /var/log/foreman/production.log.

Can you access https://foreman.example.com/api/v2/hosts?per_page=10 without any issue?

1 Like

I have an idea where this might come from. As a workaround, you can comment this line.

This is something we have to fix either in core (that provided the extension point) or the ansible plugin (that renders a rabl template).

1 Like

Thanks for the assist. I’ll spin up another box, try this out, and get back to you.

i commented the line under opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-5.1.0/lib/foreman_expire_hosts/engine.rb out and it still doesnt work

I too facing same issues. We are running
Foreman 1.20.1

ailed to initialize: RuntimeError - Cannot find rabl template ‘api/v2/hosts/expiration’ within registered (["/usr/share/foreman/app/views", “/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-14.0.1/app/views”]) view paths!,

Look like your expire_hosts plugin may be installed incorrectly, since it doesn’t show up in the path. How did you install it?

All plugins got installed along with Foreman (foremaninstaller -i: selected required plugins, including expire)

Yesterday i removed expire plugin and restarted foreman: It was showing error on the front end. SO reinstalled same plugins using following commands
#yum remove tfm-rubygem-foreman_expire_hosts
#yum install tfm-rubygem-foreman_expire_hosts.noarch

But problem not fixed, please help.

I’m having the same issue. Foreman 1.21 katello 3.11 ansible + expire_hosts.
expire_hosts installed with yum, as I do not have that option from foreman-installer.

Did you guys figure out some work-around?

I found some work-around that works for me.
You need to get file expiration.json.rabl from:


and put into /usr/share/foreman/app/views/api/v2/hosts/

You don´t need to download it, search for expiration.json.rabl and once you´ve got it create a soft link to

I´ve done and it works but the timesync role now is complain because “Multiple NTP providers are currently active/enabled”.

Do you know how to forward variables (like -e in command line ) from foreman when you want to run the role?