Skip to content

HANA fails to stop with 401 Unauthorized error

December 17, 2023
SAP

Troubleshoot and resolve HANA shutdown issues with our guide on handling the 401 Unauthorized error efficiently

Symptom

  • HANA DB cannot be stopped neither from the HANA Studio nor from the database server
  • You get error “FAIL: HTTP error, HTTP/1.1 401 Unauthorized” in the database server

Environment

  • SAP S4/HANA 1610
  • SAP HANA 1.0
  • sapstartsrv 7.00 PL 45

Reproducing the Issue

  1. Open HANA Studio
  2. Under Systems, right-click on the database
  3. Configuration and Monitoring
  4. Stop System 

OR:

  1. Logon to the database server with the <sid>adm user
  2. Run command “HDB stop”

Cause

  • The HANA database fails to stop because file /tmp/.sapstream5<NR>13 is missing
  • This file could be missing, for example, when the Unix sapstartsrv unintentionally deletes it while trying to stop the ABAP instance
  • The issue affects to sapstartsrv releases < 7.00 patch level 48 and is documented in point #6 of SAP Note 877795

Resolution

For a permanent solution upgrade the sapstartsrv to a release ≥ 7.00 patch level 48.

For a workaround until the sapstartsrv is upgraded follow these steps:

  1. Make sure the file is missing with command “ls -la /tmp/.sapstream5<NR>13”
  2. If missing, then run “HDB proc” and take note of the sapstartsrv process id (PID)
  3. Kill the sapstartsrv with command “kill -2 <PID of sapstartsrv>”
  4. Run again “ls -la /tmp/.sapstream5<NR>13”, the file should now be there
  5. Stop the database