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“:

# crm resource start apache
# crm status
...
2 nodes configured
5 resources configured

Online: [ deb9-node2 deb9-node1 ]

Full list of resources:

 Master/Slave Set: ms_drbd_drbd1 [drbd_drbd1]
     Masters: [ deb9-node2 ]
     Slaves: [ deb9-node1 ]
 Resource Group: grp_fs-ip-apache
     fs_www     (ocf::heartbeat:Filesystem):    Started deb9-node2
     Service_IP (ocf::heartbeat:IPaddr2):       Started deb9-node2
     apache     (ocf::heartbeat:apache):        Stopped

Failed Actions:
* apache_start_0 on deb9-node2 'invalid parameter' (2): call=155, status=complete, exitreason='none',
    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:

primitive apache apache \
        params configfile="/etc/apache2/apache2.conf" \
        op monitor interval=10 timeout=30 depth=0 \
        op start timeout=40 interval=0 \
        op stop timeout=60 interval=0 \
        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:

# apt-get install -y curl
# crm resource cleanup apache
# crm resource start apache
# crm status
...
 Resource Group: grp_fs-ip-apache
     fs_www	(ocf::heartbeat:Filesystem):	Started deb9-node2
     Service_IP	(ocf::heartbeat:IPaddr2):	Started deb9-node2
     apache	(ocf::heartbeat:apache):	Started deb9-node2

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

$ less /usr/lib/ocf/resource.d/heartbeat/apache
...
        monitor return TRUE if the web server appears to be working.
                For this to be supported you must configure mod_status
                and give it a server-status URL. You have to have 
                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.

Leave a Reply