FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
Hello SAP Experts,
When running HDB(HANA DATABASE) start, the following errors shown below are observed:
FAIL: Timeout
Starting instance using: /usr/sap/<SID>/SYS/exe/hdb/sapcontrol -prot
NI_HTTP -nr 10 -function StartWait 2700 2
Start
FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
OS process list command ps -efH | grep sapstart does NOT return evidence of sapstartservice running
The SAPHOSTAGENT trace file contains entries similar to these:
[Thr 140274172008224] *** ERROR => Connection of channel 10 failed [ServerChanne 67]
[Thr 140274172008224] *** ERROR => Setup of too many communication channels failed. Giving up. [ServerChanne 98]
[Thr 140274172008224] *** ERROR => Channel Accept failed [HostExecServ 242]
[Thr 140274172008224] *** ERROR => Start of HostService failed
When executing the following command ls -lad /tmp, we will see that write permissions are not available for users other than root.
Example output: drwxr-xr-- 52 root root 20480 Timestamp /tmp
The issue can be regenerated by following:
1) Run the HANA DATABASE (HDB) start command.
Alternatively, in order to get the detailed view of the issue, use the strace:
2) Add the following parameters to /usr/sap/hostctrl/exe/host_profile:
service/trace = 3
hostexec/trace = 3
Restart the host agent as:
<sid>adm user
/usr/sap/hostctrl/exe/hostexecstart -restart
3) Now revert the trace level change (remove service/trace = 3 and hostexec/trace = 3 from host_profile)
4) Please restart the host agent
5) Now when you do the analysis of the strace.txt file, following line can be seen:
- connect(3, {sa_family=AF_FILE, path="/tmp/.sapstream51013"}, 22) = -1 EACCES (Permission denied)
The issue you are facing is because the <sid>adm user does not have the permission to write to /tmp. Therefore without this permission, the .sapstream file which is important on Linux in order to create a trusted connection, can't be written and the sapstartservice will not run.