Short tip: Apache and Pacemaker: invalid parameter

Recently I had some issues with a Linux cluster running Corosync, Pacemaker and Apache. I was unable to run the redskin as ressource - starting always failed with "invalid parameter":

 1# crm resource start apache
 2# crm status
 3...
 42 nodes configured
 55 resources configured
 6
 7Online: [ deb9-node2 deb9-node1 ]
 8
 9Full list of resources:
10
11 Master/Slave Set: ms_drbd_drbd1 [drbd_drbd1]
12     Masters: [ deb9-node2 ]
13     Slaves: [ deb9-node1 ]
14 Resource Group: grp_fs-ip-apache
15     fs_www     (ocf::heartbeat:Filesystem):    Started deb9-node2
16     Service_IP (ocf::heartbeat:IPaddr2):       Started deb9-node2
17     apache     (ocf::heartbeat:apache):        Stopped
18
19Failed Actions:
20* apache_start_0 on deb9-node2 'invalid parameter' (2): call=155, status=complete, exitreason='none',
21    last-rc-change='Thu Mar 22 14:41:20 2018', queued=0ms, exec=2811ms

I was pretty sure that the configuration was correct as I have been using it on plenty of systems:

1primitive apache apache \
2        params configfile="/etc/apache2/apache2.conf" \
3        op monitor interval=10 timeout=30 depth=0 \
4        op start timeout=40 interval=0 \
5        op stop timeout=60 interval=0 \
6        meta target-role=Started

After some researches it figured out that the solution was pretty simple: curl was missing. The defined resource included a monitor which was unable to start - therefore it was not started. To fix this, it was sufficient to install the utility:

1# apt-get install -y curl
2# crm resource cleanup apache
3# crm resource start apache
4# crm status
5...
6 Resource Group: grp_fs-ip-apache
7     fs_www (ocf::heartbeat:Filesystem):  Started deb9-node2
8     Service_IP (ocf::heartbeat:IPaddr2): Started deb9-node2
9     apache (ocf::heartbeat:apache):  Started deb9-node2

Having a look at the appropriate control script of the ocf::hearbeat::apache type confirmed my finding:

1$ less /usr/lib/ocf/resource.d/heartbeat/apache
2...
3        monitor return TRUE if the web server appears to be working.
4                For this to be supported you must configure mod_status
5                and give it a server-status URL. You have to have
6                installed either curl or wget for this to work.

It would have been great to have a more obvious error message. On the other hand, it is quite confusing that curl is not pre-installed on Debian - or at least referenced as dependency when installing the resource agents.

Translations: