[ClusterLabs] Failed to retrieve meta-data for custom ocf resource

Ken Gaillot kgaillot at redhat.com
Wed Sep 28 17:55:20 EDT 2016


On 09/28/2016 04:04 PM, Christopher Harvey wrote:
> My corosync/pacemaker logs are seeing a bunch of messages like the
> following:
> 
> Sep 22 14:50:36 [1346] node-132-60       crmd:     info:
> action_synced_wait:     Managed MsgBB-Active_meta-data_0 process 15613
> exited with rc=4

This is the (unmodified) exit status of the process, so the resource
agent must be returning "4" for some reason. Normally, that is used to
indicate "insufficient privileges".

> Sep 22 14:50:36 [1346] node-132-60       crmd:    error:
> generic_get_metadata:   Failed to retrieve meta-data for
> ocf:acme:MsgBB-Active
> Sep 22 14:50:36 [1346] node-132-60       crmd:  warning:
> get_rsc_metadata:       No metadata found for MsgBB-Active::ocf:acme:
> Input/output error (-5)
> Sep 22 14:50:36 [1346] node-132-60       crmd:    error:
> build_operation_update: No metadata for acme::ocf:MsgBB-Active
> Sep 22 14:50:36 [1346] node-132-60       crmd:   notice:
> process_lrm_event:      Operation MsgBB-Active_start_0: ok
> (node=node-132-60, call=25, rc=0, cib-update=27, confirmed=true)
> 
> I am able to run the meta-data command on the command line:

I would suspect that your user account has some privileges that the lrmd
user (typically hacluster:haclient) doesn't have. Try "su - hacluster"
first and see if it's any different. Maybe directory or file
permissions, or SELinux?

> node-132-43 # /lib/ocf/resource.d/acme/MsgBB-Active meta-data
> <?xml version="1.0"?>
> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
> <resource-agent name="MsgBB-Active" version="1.0">
> <version>1.0</version>
> 
> <longdesc lang="en">
> MsgBB-Active resource (long desc)
> </longdesc>
> <shortdesc lang="en">MsgBB-Active resource</shortdesc>
> 
> <parameters>
> </parameters>
> 
> <actions>
> <action name="start"        timeout="2" />
> <action name="stop"         timeout="2" />
> <action name="monitor"      timeout="2" interval="1" depth="0" />
> <action name="meta-data"    timeout="5" />
> <action name="validate-all"   timeout="30" />
> </actions>
> </resource-agent>
> 
> node-132-43 # echo $?
> 0
> 
> Resource code here:
> #! /bin/bash
> 
> #######################################################################
> # Initialization:
> 
> : ${OCF_FUNCTIONS=${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs}
> . ${OCF_FUNCTIONS}
> : ${__OCF_ACTION=$1}
> 
> #######################################################################
> 
> meta_data()
> {
>     cat <<END
> <?xml version="1.0"?>
> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
> <resource-agent name="MsgBB-Active" version="1.0">
> <version>1.0</version>
> 
> <longdesc lang="en">
> MsgBB-Active resource (long desc)
> </longdesc>
> <shortdesc lang="en">MsgBB-Active resource</shortdesc>
> 
> <parameters>
> </parameters>
> 
> <actions>
> <action name="start"        timeout="2" />
> <action name="stop"         timeout="2" />
> <action name="monitor"      timeout="2" interval="1" depth="0" />
> <action name="meta-data"    timeout="5" />
> <action name="validate-all"   timeout="30" />
> </actions>
> </resource-agent>
> END
> }
> 
> # don't exit on TERM, to test that lrmd makes sure that we do exit
> trap sigterm_handler TERM
> sigterm_handler() {
>         ocf_log info "They use TERM to bring us down. No such luck."
>         return
> }
> 
> msgbb_usage() {
>             cat <<END
> usage: $0 {start|stop|monitor|validate-all|meta-data}
> 
> Expects to have a fully populated OCF RA-compliant environment set.
> END
> }
> 
> msgbb_monitor() {
>     # trimmed.
> }
> 
> msgbb_stop() {
>     # trimmed.
> }
> 
> msgbb_start() {
>     # trimmed.
> }
> 
> msgbb_validate() {
>     # trimmed.
> }
> 
> case $__OCF_ACTION in
> meta-data)      meta_data
>                 exit $OCF_SUCCESS
>                 ;;
> start)          msgbb_start;;
> stop)           msgbb_stop;;
> monitor)        msgbb_monitor;;
> reload)         ocf_log err "Reloading..."
>                 msgbb_start
>                 ;;
> validate-all)   msgbb_validate;;
> usage|help)     msgbb_usage
>                 exit $OCF_SUCCESS
>                 ;;
> *)              msgbb_usage
>                 exit $OCF_ERR_UNIMPLEMENTED
>                 ;;
> esac
> rc=$?
> ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
> exit $rc
> 
> 
> Thanks,
> Chris




More information about the Users mailing list