Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Overview

The SAP HANA cockpit (the cockpit) is built as an SAP HANA extended application services, advanced model (XSA) solution and a such, administrators can examine the XSA logs to find out details about any problems encountered while operating the cockpit.

This document covers how to use the XSA Logs application on the Cockpit Manager to troubleshoot problems in a visual way. If you would like to view the log files in the command line, this documents also includes how to log in as the XSA user, different ways of using the xs logs command, and other xs commands that users might find helpful when trying to identify the source of a problem in the cockpit.

XSA Logs Application

With the release of SAP HANA Cockpit SP 08, users can now use the XSA Logs application to retrieve the XSA log entries. Make sure that your cockpit user has the following two roles:

  • Cockpit Administrator
  • Space Auditor

For more information about how to assign the Space Auditor role and how to use the XSA Logs application, please refer to the guide "View Logs to Troubleshoot the Cockpit" available on the SAP Help Portal.

 Sample Log Outputs

If you are experiencing a reproducible error, such as a timeout or access error, you can use the XSA Logs application to tail the logs of the relevant app, reproduce the error on your cockpit and see if any error messages appear in the logs.

  • For example, when you access the Alerts app with a database user which does not have permission to this app, the following errors appear under the application cockpit-hdb-svc:

  • When you try to start a system without having entered the SAP Control credentials, the following errors appear under the application cockpit-hdb-svc:

  • When you access the SQL Analyzer with an unauthorized database user, the following errors appears under the application cockpit-web-app. Notice that the search bar is used to filter all the errors related to the SQL Analyzer:

Understanding Which App is Related to Which Component of Cockpit 

As a general guide, you can use the table below for deciding which application logs you need to check when you encounter a problem. 

If you encounter issues with…

View the application log for…

Corresponding cockpit area on the XSA Logs app

Resource registration, resource group management, cockpit user management, or other cockpit manager issues

  • cockpit-admin-web-app
  • cockpit-adminui-svc
  • cockpit-persistence-svc
Resource Management

Displaying or retrieving data, or issues related to specific SAP HANA cockpit applications

  • cockpit-web-app
  • cockpit-hdbui-svc
  • cockpit-hdb-svc
  • cockpit-landscape-svc
  • cockpit-persistence-svc
Specific SAP HANA applications

Collections (for example, if you notice that information in Aggregate Health Monitor, or in the alerts does not appear accurate)

  • cockpit-collection-svc
  • cockpit-hdb-svc
  • cockpit-persistence-svc
Collections

Components in the SQL Analyzer

  • sqlanlz-ui
  • sqlanlz-svc

SQL Analyzer

Components in the Database Explorer

  • hrtt-service
Database Explorer

General errors in the user interface, such as with graphs, list views, or filters.

  • sapui5_fesv2
Generic User Interface Areas

Components of the audit log

  • auditlog-db
  • auditlog-server
  • auditlog-broker
  • auditlog-odata
  • auditlog-ui
Audit Log

Logging in as the XSA User

Besides using the XSA Logs application to retrieve logs in a more visualized way, there is also an option to use the command line to retrieve logs.

Since cockpit is an XSA application, the first step to troubleshooting problems is to login to XSA as the XSA admin user to your machine. 

Step 1) SSH into your machine, and switch to the <sid>adm user with the su - <sid>adm command.

    • The default sid (system id) for cockpit is H4C but if it was changed during setup, it may be different.
    • You will be prompted for a password at this point. If you have not changed the password of the <sid>adm, then the password will be the master password specified during installation.

Step 2) Login to XSA using the script /hana/shared/<SID>/xs/bin/xs-admin-login

    • Once again, you must replace the <SID> in the above command to the one of your system.
    • You will be prompted for the COCKPIT_ADMIN user’s password here. If nothing has been changed since installation, then the password will be the same as the master password specified during installation.
    • If you run into trouble while logging in to the XS space using the above script, you can alternatively access it by following the steps outlined in this article.
    • Below is a sample output of the /hana/shared/<SID>/xs/bin/xs-admin-login script.
h4cadm@<hostname>:/usr/sap/H4C/HDB96> /hana/shared/H4C/xs/bin/xs-admin-login
Enter password for XSA admin user 'COCKPIT_ADMIN':

API_URL: https://<hostname>:39630
USERNAME: COCKPIT_ADMIN
Authenticating...
ORG: HANACockpit
SPACE: SAP
API endpoint: https:// <hostname> :39630 (API version: 1)
User: COCKPIT_ADMIN
Org: HANACockpit
Space: SAP

Step 3) To see a list of currently running apps, execute the xs apps command.

    • This provides a list of the XSA apps in system, and related information such as their current status, memory usage, URL and more. 
    • Check that apps related to the problem you are troubleshooting are STARTED and not in the STOPPED status.
      • If an app is currently stopped and you wish to start it, you can execute the xs start <app name> command.
      • Likewise, you can restart an app using the xs restart <app name> command or stop an app using the xs stop <app name> command.
    • Below is a sample output of the xs apps command.
h4cadm@<hostname>:/usr/sap/H4C/HDB96> xs apps
Getting apps in org "HANACockpit" / space "SAP" as COCKPIT_ADMIN...
Found apps:
name                       requested state    instances    memory       disk            urls
----------------------------------------------------------------------------------------------------------------------
auditlog-db                 STOPPED 0/1 1.00 GB <unlimited> <none>
auditlog-server            STARTED 1/1 256 MB <unlimited> https:// <hostname> :51002
auditlog-broker             STARTED 1/1 64.0 MB <unlimited> https:// <hostname> :51003
deploy-service          STARTED 1/1 280 MB <unlimited> https:// <hostname> :51004
component-registry-db      STOPPED 0/1 16.0 MB <unlimited> <none>
product-installer        STARTED 1/1 256 MB <unlimited> https:// <hostname> :51005
auditlog-odata              STARTED 1/1 256 MB <unlimited> https:// <hostname> :51007
auditlog-ui                 STARTED 1/1 1.00 GB <unlimited> https:// <hostname> :51008
hrtt-service                STARTED 1/1 512 MB <unlimited> https:// <hostname> :51009
sqlanlz-svc                STARTED 1/1 256 MB <unlimited> https:// <hostname> :51010
sqlanlz-ui                  STARTED 1/1 128 MB <unlimited> https:// <hostname> :51011
hrtt-core                  STARTED 1/1 512 MB <unlimited> https:// <hostname> :51012
sapui5_fesv2               STARTED 1/1 256 MB <unlimited> https:// <hostname> :51015
cockpit-persistence-svc     STARTED 1/1 768 MB <unlimited> https:// <hostname> :51017
cockpit-hdb-svc             STARTED 1/1 768 MB <unlimited> https:// <hostname> :51018
cockpit-collection-svc      STARTED 1/1 512 MB <unlimited> https:// <hostname> :51016
cockpit-hdbui-svc          STARTED 1/1 128 MB <unlimited> https:// <hostname> :51020
cockpit-landscape-svc       STARTED 1/1 128 MB <unlimited> https:// <hostname> :51019
cockpit-web-app             STARTED 1/1 512 MB <unlimited> https:// <hostname> :51021
cockpit-adminui-svc         STARTED 1/1 128 MB <unlimited> https:// <hostname> :51022
cockpit-admin-web-app        STARTED 1/1 128 MB <unlimited> https:// <hostname> :51023

Using the XS Logs Command

The xs logs command allows users to see the logs of cockpit apps. Executing the xs logs command by itself will tail the logs for an app. If necessary, options can be included to modify what is shown on screen.

To see a list of all options associated with the xs logs command, execute the xs help logs command. Some useful options include:

    • Dumping recent logs (--recent)

    • Dumping all logs (--all)
    • Dumping a specific number of previous log entries (--last <num>)
    • Dumping logs since or until a specific timestamp (--since <timespec>, --till <timespec>)
    • Filtering logs based on type (ERR, TRC, SYS, LOG etc.) (--type <type>)
    • Filtering logs based on source (API, APP, STG, etc.) (--source <source>) 
    • Filtering by instances (--instance <instance>)

These can be combined to show a filtered view of the logs on screen.

Sample Log Outputs

To find the most recent log entries for an application, execute xs logs --recent <app name>

    • Below is a sample output of the xs logs --recent cockpit-web-app command:
6/2/17 7:11:03.000 PM [RTR] OUT <IP> - - to  <hostname> :51021 "GET /cp/ls/group/GroupsForUserGet HTTP/1.1" 200 sent 334 in 38 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:03.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "GET /cp/ls/group/GroupResourcesGet?groupDesignation=ALL HTTP/1.1" 200 sent 653 in 104 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:05.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "GET /cp/sapui5/resources/sap/ui/core/messagebundle.properties HTTP/1.1" 200 sent 2648 in 29 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:12.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "POST /cp/hdbui/auth/validate HTTP/1.1" 200 sent 29 in 65 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:12.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "POST /cp/ls/user/RemoteCredentialsSet HTTP/1.1" 200 sent 6 in 99 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:12.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "GET /cp/ls/group/GroupsForUserGet HTTP/1.1" 200 sent 334 in 30 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:13.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "GET /cp/ls/group/GroupResourcesGet?groupDesignation=ALL HTTP/1.1" 200 sent 653 in 92 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2
6/2/17 7:11:15.000 PM [RTR] OUT <IP> - - to <hostname> :51021 "GET /sap/hana/cockpit/landscape/js/views/home/SystemPage.view.xml HTTP/1.1" 200 sent 7482 in 7 by 00I-95c80b1d-16f7-480b-a502-25436925c1d2

 

To search the entire log file and display only log entries that are errors, execute xs logs --all --type ERR <app name>

    • Below is a sample of the xs logs --all --type ERR cockpit-admin-web-app command:
Connected, dumping all logs for app "cockpit-admin-web-app"
5/26/17 12:14:25.749 PM [API] ERR Number of running instances for app 'cockpit-admin-web-app' [Org 'HANACockpit', Space 'SAP'] is 0 but should be 1. Trying to adapt number of running instances...
5/29/17 11:46:50.406 AM [API] ERR Number of running instances for app 'cockpit-admin-web-app' [Org 'HANACockpit', Space 'SAP'] is 0 but should be 1. Trying to adapt number of running instances...
5/30/17 5:18:58.896 PM [API] ERR Number of running instances for app 'cockpit-admin-web-app' [Org 'HANACockpit', Space 'SAP'] is 0 but should be 1. Trying to adapt number of running instances...

 

To display logs in a specified time interval that are of a specific type originating from a specific source, execute  xs logs --since YYYY-MM-DD --till YYYY-MM-DD --type <type> --source <source> <app name>

    • Below is a sample output of the xs logs --since 2017-06-01 --till 2017-06-05 --type SYS --source APP cockpit-web-app command:
Connected, dumping all log entries since "6/1/17 12:00:00.000 AM" till "6/5/17 12:00:00.000 AM"
6/1/17 6:25:59.344 PM [APP/1-0] SYS #2.0#2017 06 01 18:25:59:338#+00:00#INFO#/approuter################PLAIN##Application router version 2.7.0#
6/1/17 6:25:59.405 PM [APP/1-0] SYS #2.0#2017 06 01 18:25:59:404#+00:00#INFO#/approuter################PLAIN##Applicaiton router is listening on port: 50018#
6/1/17 9:20:40.528 PM [APP/1-0] SYS #2.0#2017 06 01 21:20:40:527#+00:00#INFO#/Auth/OAuth2#########Gy9RYMEZPG1a8v6JMVyNeuQNxclMEnIL######j3exdbuk#PLAIN##sending redirect to https://mo-44f3e9cc1.mo.sap.corp:39632/uaa-security/oauth/authorize?response_type=code&client_id=sb-cockpit!i1&redirect_uri=https%3A%2F%2Fmo-44f3e9cc1.mo.sap.corp%3A51021%2Flogin%2Fcallback#
6/1/17 9:21:56.983 PM [APP/1-0] SYS #2.0#2017 06 01 21:21:56:981#+00:00#ERROR#/Handler#########Cg3-HWyF73KRWCKOR3jaQ1pf67HCMLpA######j3exeyuk#PLAIN##GET request to /sap/hana/cockpit/landscape/images/SAPlogo@1.5.png completed with status 404 - error during fs.realpath: ENOENT: no such file or directory, lstat '/hana/shared/H4C/xs/ea_data/mo-44f3e9cc1.mo.sap.corp/executionroot/95c80b1d-16f7-480b-a502-25436925c1d2/app/resources/sap/hana/cockpit/landscape/images/SAPlogo@1.5.png'#

 

If you are are experiencing a reproducible error, such as a timeout or access error, you can use the xs logs <app name> command to tail the logs of the relevant app, reproduce the error in your cockpit and see if any error messages appear in the logs.

  • For example, the below errors appear when using the xs logs –recent –type ERR cockpit-hdb-svc command and accessing the Alerts page with an unauthorized database user:
Connected, dumping recent logs for app "cockpit-hdb-svc"
1/14/19 3:29:13.744 PM [APP/2-0] ERR   #2.0#2019 01 14 15:29:13.743#+00:00#ERROR#com.sap.hana.cockpit.hdb.api.alert.AlertsDataLib# ###99F3C3F7AC68441D960AA878F422E055##cockpit-hdb-svc#com.sap.hana.cockpit.hdb.api.alert.AlertsDataLib########http-bio-                127.0.0.1-40339-exec-10#PLAIN##com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [258]: insufficient privilege: Not authorized
1/14/19 3:29:13.744 PM [APP/2-0] ERR   #2.0#2019 01 14 15:29:13.744#+00:00#ERROR#com.sap.hana.cockpit.hdb.api.alert.AlertsDataLib# ###A3FF2398162849ABADAA6CCCC0F0DD10##cockpit-hdb-svc#com.sap.hana.cockpit.hdb.api.alert.AlertsDataLib########http-bio-                    127.0.0.1-40339-exec-10#PLAIN## com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [258]: insufficient privilege: Not authorized
1/14/19 3:29:13.744 PM [APP/2-0] ERR   #2.0#2019 01 14 15:29:13.744#+00:00#ERROR#com.sap.hana.cockpit.hdb.api.alert.AlertMonSvc# ###EA18FD79880E4F8B919EA8A7629E760E##cockpit-hdb-svc#com.sap.hana.cockpit.hdb.api.alert.AlertMonSvc########http-bio-12                    7.0.0.1-40339-exec-10#PLAIN## Alert data retrieval failed
1/14/19 3:29:13.763 PM [APP/2-0] ERR   #2.0#2019 01 14 15:29:13.763#+00:00#ERROR#com.sap.hana.cockpit.hdb.api.alert.AlertsDataLib# ###DCC8AB132A09475F916D438FD4296585##cockpit-hdb-svc#com.sap.hana.cockpit.hdb.api.alert.AlertsDataLib########http-bio-                    127.0.0.1-40339-exec-3#PLAIN## Can't determine statistic server status for MDC system
1/14/19 3:29:13.763 PM [APP/2-0] ERR   #2.0#2019 01 14 15:29:13.763#+00:00#ERROR#com.sap.hana.cockpit.hdb.api.alert.AlertMonSvc# ###CD1A3072059D43DDB28B6D2E8A943907##cockpit-hdb-svc#com.sap.hana.cockpit.hdb.api.alert.AlertMonSvc########http-bio-12                    7.0.0.1-40339-exec-3#PLAIN## Alert data retrieval failed

Other XS Commands

You may also find the following commands useful when looking at the log files.

Command

Description

xs set-logging-level

Set the logging level for an app

xs unset-logging-level

Reset the logging level for the given component to its default

xs list-logging-levels

List the manually configured logging levels for an app

To see a full list of other xs commands, execute the xs help -a to see all commands along with a description, or execute xs help <command> to get usage help for a specific command.  A description of commands as well what each parameter means can be found in The XS Command-Line Reference

Related Content

Related Documents

SAP HANA Cockpit Installation and Update Guide

Using XS CLI Commands to Troubleshoot the Cockpit

The XS Command-Line Reference

 

  • No labels