Register Login

sapcontrol Error: FAIL: HTTP error, HTTP/1.1 401 Unauthorized

Updated May 18, 2018

Error while executing sapstartsrv

FAIL: HTTP error, HTTP/1.1 401 Unauthorized

The sapstartsrv provides two ways of authenticating it's requests:

- HTTP Basic authentication
- Trusted connects

If you don't pass any credentials to the sapcontrol command, it tries to use the trusted connection functionality but if it fails, it will fall back to the basic HTTP authentication and it will fail by the lack of credentials. Possible reasons for this to fail are:

a) sapstartsrv was not able to create the /tmp/.sapstream5$$13 file because someone else already created and it's not owned by the adm of this system.

b) /tmp/.sapstream5$$13 file was deleted after the sapstartsrv started.

c) the commands are not executed with the same adm user.

On Windows platforms the file is located at: .pipesapcontrol_$$.

$$ stands for the instance number.

2) You experience errors like this one when executing a protected method although you provided the user and password correctly:

FAIL: Invalid Credentials

3) You receive a connection refused like this one when executing a sapcontrol function:

FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()

4) Other problems.


  • 28 Jan 2016 4:56 pm Sugandh Best Answer


    a) remove the file manually and after performing this, restart the sapstartsrv service. (sapcontrol -nr -function RestartService)

    b) Disable any cleanups that can be made on /tmp and restart sapstartsrv.

    c) run everything as adm

    2) Possible reasons for this and solutions for this are:

    - Verify permissions of sapuxuserchk as per SAP Note 927637.

    - Check if this user is not a domain user (NIS,ADS) rather than a shadow user.

    - See the log files of PAM on the operating system level (on UNIX). In a few cases the sapstartsrv is trying to authenticate the user at OS level, but the PAM service is not permitting the access.

    3) Check if the sapstartsrv is really started up and running fine. Another reason could be the one described in SAP Note 1348820.

    4) Check if it's not already a known problem at SAP Note 877795 and take a look at the trace file sapstartsrv.log.