SUSE Support

Here When You Need Us

SAPHanaSR-showAttr fails with error "Error: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()"

This document (000020548) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server for SAP Applications 12
SUSE Linux Enterprise Server for SAP Applications 15

Situation

The SAPHanaSR-showAttr command returns with an error "Error: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()" like:
node1:~ # SAPHanaSR-showAttr
Error: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
node1:~ # 

Resolution

The SAPHanaSR-showAttr command calls /usr/sap/hostctrl/exe/saphostctrl -function ListInstances to get the list of instances and saphostctrl requires sapstartsrv process to run as user sapadm.

Such an error is related to sapstartsrv service not running as user sapadm.
node1:~ # ps -ef | grep -v grep | egrep 'sapstartsrv|hostctrl'
root     12578     1  0 11:29 ?        00:00:00 /usr/sap/hostctrl/exe/saphostexec pf=/usr/sap/hostctrl/exe/host_profile
fu2adm   25487     1  0 Jan11 ?        00:00:25 /usr/sap/FU2/HDB02/exe/sapstartsrv pf=/usr/sap/FU2/SYS/profile/FU2_HDB02_node1 -D -u fu2adm
node1:~ #

In normal circumstances sapstartsrv is recovered by SAPHanaTopology resource.
Whereas in this case SAPHanaTopology resource cannot recover sapstartsrv due to 'Cannot open Profile /usr/sap/hostctrl/exe/host_profile' error:
...
022-01-18T11:16:42.881715+01:00 node1 SAP_00[30863]: Cannot open Profile /usr/sap/hostctrl/exe/host_profile. (Error 10 No child processes) [ntservmainux.cpp 1126]
...
2022-01-18T11:16:43.142249+01:00 node1 pacemaker-execd[21257]:  notice: rsc_SAPHanaTopology_FU2_HDB02_monitor_10000[29348] error output [ start hostcontrol using profile /usr/sap/hostctrl/exe/host_profile ]
2022-01-18T11:16:43.142357+01:00 node1 pacemaker-execd[21257]:  notice: rsc_SAPHanaTopology_FU2_HDB02_monitor_10000[29348] error output [ Error: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen() ]
...

Checking /usr/sap/hostctrl/exe/host_profile existence and permissions shows:
node1:~ # ls -l /usr/sap/hostctrl/exe/host_profile
-rw------- 1 root root 353 Dec 14 13:46 /usr/sap/hostctrl/exe/host_profile
node1:~ #

As shown above, /usr/sap/hostctrl/exe/host_profile exists, but sapadm user does not have permissions to read the file.

The correct permission must be 644 instead of 600

Please change the permissions by issuing 'chmod 644 /usr/sap/hostctrl/exe/host_profile' in order to give read permission to user sapadm.
node1:~ # ls -l /usr/sap/hostctrl/exe/host_profile
-rw-r--r-- 1 root root 353 Dec 14 13:46 /usr/sap/hostctrl/exe/host_profile
node1:~ #

Checking sapstartsrv service after changing permissions.
node1:~ # ps -ef | grep -v grep |  egrep 'sapstartsrv|hostctrl' 
fu2adm   25487     1  0 Jan11 ?        00:00:25 /usr/sap/FU2/HDB02/exe/sapstartsrv pf=/usr/sap/FU2/SYS/profile/FU2_HDB02_node1 -D -u fu2adm
root     30150     1  0 11:44 ?        00:00:00 /usr/sap/hostctrl/exe/saphostexec pf=/usr/sap/hostctrl/exe/host_profile
sapadm   30333     1  0 11:44 ?        00:00:00 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
root     30636     1  0 11:44 ?        00:00:00 /usr/sap/hostctrl/exe/saposcol -l -w60 pf=/usr/sap/hostctrl/exe/host_profile
node1:~ # 
As seen above sapstartsrv is running as user sapadm.

Checking SAPHanaSR-showAttr command output...
node1:~ # SAPHanaSR-showAttr
Global cib-time                 maintenance 
--------------------------------------------
global Tue Jan 18 11:44:30 2022 false       

Resource              is-managed 
---------------------------------
msl_SAPHana_FU2_HDB02 true       

Hosts clone_state lpa_fu2_lpt node_state op_mode   remoteHost roles                            score site srmode sync_state version                vhost 
---------------------------------------------------------------------------------------------------------------------------------------------------------
node1 PROMOTED    1642502670  online     logreplay node2      4:P:master1:master:worker:master 150   DC1  sync   PRIM       2.00.057.00.1629894416 node1 
node2 DEMOTED     30          online     logreplay node1      4:S:master1:master:worker:master 100   DC2  sync   SOK        2.00.057.00.1629894416 node2 
node1:~ #
As seen above, SAPHanaSR-showAttr command runs successfully.

Cause

Wrong permissions of /usr/sap/hostctrl/exe/host_profile file.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020548
  • Creation Date: 18-Jan-2022
  • Modified Date:19-Jan-2022
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.