Skip to Content
Technical Articles
Author's profile photo Henrique Girardi

How to solve NIECONN_REFUSED issues during sapcontrol execution

When you are executing Software Provisioning Manager tool or if you manually run sapcontrol command, you can face an issue like below:

Execution of the command “/usr/sap/<SID>/SYS/exe/sapcontrol -nr 00 -host abcde -function GetInstanceProperties” finished with return code 1. Output:

<date> <time>


FAIL: NIECONN_REFUSED (Connection timed out), NiRawConnect failed in plugin_fopen()

Usually, this issue happens because sapstartsrv is not properly running. Below, you can see some steps to follow in order to solve this issue:

  1. Make sure /usr/sap/sapservices does exist on your system. If not, please follow as described in SAP note below:
    823941  – SAP start service on Unix platforms 
  2. Run command ps -ef | grep sapstartsrv and check if the the service is running for the instance. sapstartsrv must be pointing to the start or instance profile (according to the profile configuration of your system);
  3. If it is running, then manually kill the process;
  4. Make sure the sapstartsrv is properly working by running the command sapstartsrv -h as <sid>adm from kernel directory. If it returns all options from help, it means sapstartsrv command is working. Otherwise, it means it has issues and you must patch your kernel.

  5. If sapstartsrv is properly working, manually run the command above as <sid>adm from kernel directory:
    ./sapstartsrv pf=/sapmnt/<SID>/profile/<start or instance profile> -D

  6. After that, run the command below and check if the issue still persists:
    /usr/sap/<SID>/<instance>/exe/sapcontrol -prot NI_HTTP -nr <inst number> -function GetInstanceProperties

  7. Does the NIECONN_REFUSED error remains? If so, then make sure all hosts are properly set in the /etc/host file.
  8. If no error returns, it means the issue is not occurring any more and you will be able to continue the installer.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Ashutosh Chaturvedi
      Ashutosh Chaturvedi

      Dear Henrique,


      Very nice blog.


      I want to add something more , If we run the below command with -D argument then we will not able to see the exact error with sapstartsrv service.


      ./sapstartsrv pf=/sapmnt/<SID>/profile/<start or instance profile> -D

      If you really want to see the errors which causing problem then we need to run the command without -D argument at os level.

      With Regards

      Ashutosh Chaturvedi

      Author's profile photo Henrique Girardi
      Henrique Girardi
      Blog Post Author

      Hi Ashutosh,


      In fact, my intention was only starting up the sapstartsrv, this is why I recommended putting -D parameter, but thank you for this feedback, I will update the blog



      Henrique Girardi

      Author's profile photo Former Member
      Former Member

      Hi Henrique,


      Very Nice blog..


      I would add 2 more steps between your point no.3 and 4 to make it more useful.


      a) We need to copy the command for sapstartsrv by process viewing

      (ps -ef|grep sapstartsrv) for future.


      b) Check the directory /sapmnt/<SID>/global/sapcontrol for multiple log files having some numbers_portno._<Instance no._hostname

      Those need to be removed for a particular instance which is not getting started or identified.

      And run the earlier copied sapstartsrv command for particular instance.


      In nut shell, there should be only 1 log file for each instance and central services, etc.


      You can also find the exact root cause of the problem with below debug option:


      /usr/sap/<SID>/<instance>/exe/sapcontrol -prot NI_HTTP -nr <inst number> -function GetInstanceProperties -debug




      Manaswi Srivastava

      Author's profile photo Jorge Velásquez
      Jorge Velásquez


      I am having this error and also startsap shows this:



      solmandes:scdadm 84> startsap
      Checking syb Database
      Database is running
      Starting Startup Agent sapstartsrv
      /usr/sap/SCD/SYS/exe/uc/linuxx86_64/startsap: line 3171: 8271 Segmentation fault $_SAPSTARTSRV pf=$_PROFILE -D >> $LOGFILE 2>&1
      FAIL: Timeout
      Startup of Instance Service failed
      See /home/scdadm/startsap_SCS02.log for details


      Any clue?

      Author's profile photo Basis Team
      Basis Team

      Hi Jorge,


      How  did you overcome this issue?



      Manoj Somkuwar

      Author's profile photo Lanlan Meng
      Lanlan Meng

      Very good documentation, I changed the /etc/hosts file and it took me a long time to get it ready. Thanks

      Author's profile photo Hemant Gade
      Hemant Gade

      Very nice and clear explaination.


      Thanks this work out in our scenario




      Author's profile photo Tony Soeun
      Tony Soeun

      Dear All,

      I am the new SAP Hana. Can you help to include Picture of each your step? So it is easy for newest one like me easy to noted.


      Author's profile photo Siddarth Menon
      Siddarth Menon

      Hi everybody! I'm new to SAP S4 HANA, and when I trying switch on the system i get the same message. i would be glad if someone can include Picture of each your step.

      Author's profile photo Sankara Bavirisetti
      Sankara Bavirisetti

      Adding other solutions to resolve “FAIL: NIECONN_REFUSED (Connection timed out), NiRawConnect failed in plugin_fopen()

      1.rename the agent.lock file so a new file can be created – /usr/sap/SID/DVEBMGSXX/log/sapccm4x 2.disable the integrated CCMS Agent included in the sapstartsrv program by adding the following parameter to the instance profile:

      ccms/enable_agent = 0

      After adding the parameter the sapstartsrv for this instance should be restarted in case it is running.

      Thanks, Sankar


      Author's profile photo Tyler Brady
      Tyler Brady

      Very helpful. Thank you!

      Author's profile photo Mohan Bachal
      Mohan Bachal

      It worked like a charm for me today.