All skills
secondsky avatar

/sap-hana-cli

@620a19a
by Eddiesecondsky/sap-skills456 stars
120

Assists with SAP HANA Developer CLI (hana-cli) for database development and administration. Use when: installing hana-cli, connecting to SAP HANA databases, inspecting database objects (tables, views, procedures, functions), managing HDI containers, executing SQL queries, converting metadata to CDS/EDMX/OpenAPI formats, managing SAP HANA Cloud instances, working with BTP CLI integration, or troubleshooting hana-cli commands. Covers: 91 commands, 17+ output formats, HDI container management, cloud operations.

Use this Skill: https://skilld.dev/gh/secondsky/sap-skills/sap-hana-cli

This session only. Nothing lands on disk.

referencestroubleshooting.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

SAP HANA CLI - Troubleshooting Guide

Source: https://github.com/SAP-samples/hana-developer-cli-tool-example

Common issues, diagnostic commands, and solutions.


Diagnostic Commands

Connection Status

hana-cli status

Verify current connection is active.

Privilege Error Analysis

hana-cli privilegeError [guid]

Aliases: pe, getInsufficientPrivilegeErrorDetails

Diagnoses specific privilege errors using the error GUID.

System Procedure: SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS

User Inspection

hana-cli inspectUser [user]

View user metadata and privileges.


Common Issues

Connection Problems

Error Cause Solution
Connection refused Wrong host/port Verify hostname and port
SSL handshake failed Certificate issue Add --trustStore
Authentication failed Wrong credentials Check user/password
Connection timeout Network issue Check firewall rules
Host not found DNS issue Use IP address

Diagnostic Steps:

# 1. Check current status
hana-cli status

# 2. Test with explicit credentials
hana-cli connect -n "host:443" -u USER -p PASS --encrypt

# 3. Add trust store if needed
hana-cli connect --trustStore /path/to/cert.pem

Permission Errors

Error Cause Solution
Insufficient privilege Missing role Grant required roles
Object not found Wrong schema Check schema name
Access denied Object ownership Check privileges

Diagnostic Steps:

# 1. Get error GUID from error message
# 2. Analyze with privilegeError
hana-cli privilegeError <guid>

# 3. Check user details
hana-cli inspectUser

# 4. Review available roles
hana-cli roles

HDI Container Issues

Error Cause Solution
HDI not activated Service disabled Run activateHDI
Cannot create container No admin rights Get HDI admin role
Container exists Name conflict Use unique name
Cannot drop group Not empty Drop containers first

Diagnostic Steps:

# 1. Check HDI status
hana-cli containers

# 2. Verify admin rights
hana-cli adminHDI

# 3. List container users
hana-cli createContainerUsers -c CONTAINER --list

Cloud Connection Issues

Error Cause Solution
Instance not found Wrong name Verify instance name
Instance stopped Not running Run hanaCloudStart
Service key invalid Expired/revoked Regenerate key
BTP target wrong Wrong subaccount Reconfigure with btp

Diagnostic Steps:

# 1. Check BTP target
hana-cli btpInfo

# 2. List instances
hana-cli hanaCloudInstances

# 3. Start if stopped
hana-cli hanaCloudStart <instance>

# 4. Reconfigure BTP
hana-cli btp

Error Messages Reference

Connection Errors

"ECONNREFUSED"

Error: connect ECONNREFUSED 127.0.0.1:30015

Solution: Check host and port, ensure database is running.

"SSL_ERROR_SYSCALL"

Error: SSL_ERROR_SYSCALL

Solution: Enable encryption with --encrypt or add trust store.

"EHOSTUNREACH"

Error: connect EHOSTUNREACH

Solution: Check network connectivity, VPN if required.

Authentication Errors

"Invalid username or password"

Error: authentication failed

Solution: Verify credentials, check user is not locked.

"User is locked"

Error: user account is locked

Solution: Unlock user via HANA Studio or SQL.

Privilege Errors

"Insufficient privilege"

Error: insufficient privilege: Not authorized

Solution: Use privilegeError with GUID to diagnose, grant required roles.


Credential File Issues

Missing Credentials

# Check file discovery order
ls -la default-env*.json
ls -la .cdsrc-private.json
ls -la .env

Invalid JSON

# Validate JSON syntax
cat default-env.json | python -m json.tool

Wrong Credentials Priority

Remember the priority order:

  1. default-env-admin.json (with --admin)
  2. .cdsrc-private.json (cds bind)
  3. .env file
  4. --conn parameter
  5. default-env.json
  6. ~/.hana-cli/default.json

System Resource Issues

Reclaim Resources

# Reclaim storage space
hana-cli reclaim

Executes:

  • ALTER SYSTEM RECLAIM LOB SPACE
  • ALTER SYSTEM RECLAIM LOG
  • ALTER SYSTEM RECLAIM DATAVOLUME 105 DEFRAGMENT

Check Storage

# View data volumes
hana-cli dataVolumes

# View disk info
hana-cli disks

Debug Mode

Enable debug output:

# Set DEBUG environment variable
DEBUG=* hana-cli <command>

# Or use --debug flag if available
hana-cli <command> --debug

Reporting Issues

# Open issue on GitHub
hana-cli issue

Opens browser to create GitHub issue with:

  • Version information
  • Environment details
  • Steps to reproduce

Getting Help

In-CLI Help

hana-cli --help
hana-cli <command> --help

Documentation

hana-cli readMe
hana-cli openReadMe  # Opens in browser

Changelog

hana-cli changeLog
hana-cli openChangeLog  # Opens in browser

*Reference: https://github.com/SAP-samples/hana-developer-cli-tool-example*

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive documentation and MCP integration for the SAP HANA Developer CLI. It follow security best practices for credential management by advising the use of environment variables and gitignore for configuration files. All external downloads and package installations refer to official SAP tools and standard development utilities.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    4/17 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 620a19a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 months ago
Other metadata
metadata
{
  "maintainer": "Eduard Jiglau",
  "maintainer_email": "hello@sap-ai-skills.com",
  "website": "https://sap-ai-skills.com",
  "version": "2.4.1",
  "last_verified": "2025-11-26"
}

README badge

README badge for secondsky/sap-skills/sap-hana-cli