Troubleshooting Guide
Common issues and solutions for the MCP Server.
Connection Issues
Zero Results from List Commands
Symptom: Commands like hana_tables, hana_schemas, hana_inspectTable return empty results.
Root Cause: Missing or invalid database connection configuration.
Solution:
Verify Connection Status
bashhana-cli statusShould display your connection details, current schema, and HANA version.
Check default-env.json Exists
bashls -la default-env.jsonIf missing, create it using:
bashhana-cli connect # or hana-cli serviceKey -i <instance-name> -k <key-name>Validate Connection Credentials
json{ "VCAP_SERVICES": { "hana": [{ "name": "my-hana-instance", "tags": ["hana"], "credentials": { "host": "your-host.hanacloud.ondemand.com", "port": "443", "user": "DBADMIN", "password": "YourPassword123!", "encrypt": true, "sslValidateCertificate": true } }] } }Enable Debug Mode
bashhana-cli tables --debugShows connection details, query execution, and timing.
Test Basic Connectivity
bash# For HANA Cloud ping your-host.hanacloud.ondemand.com # Check port accessibility telnet your-host.hanacloud.ondemand.com 443
Connection Timeout
Symptom: Commands fail with "Connection timeout" error after waiting.
Causes:
- Network connectivity issues
- Firewall blocking the connection
- Database instance not running or unresponsive
- Query too large or complex
Solutions:
Verify Network Connectivity
bashping your-host.com telnet your-host.com 443Check Database is Running
bashhana-cli statusIf this fails, the database instance is not running.
Increase Timeout Value
bashhana-cli tables --timeout 600Increases timeout to 10 minutes (default 5 minutes).
Filter Large Result Sets
bash# Instead of listing all tables hana-cli tables --table MY_* --schema SALES # Instead of loading entire table hana-cli sql "SELECT * FROM MY_TABLE LIMIT 1000"Check System Health
bashhana-cli healthCheck hana-cli memoryAnalysis
Authentication Failed
Symptom: "Authentication failed" or "Invalid credentials" error.
Causes:
- Wrong username or password
- User account disabled or expired
- Insufficient database privileges
Solutions:
Verify Credentials
bashhana-cli status --user DBADMIN --password YourPasswordCheck User Account
- Log in to SAP HANA database directly
- Verify user account exists and is active
- Check user privileges (SELECT, INSERT, UPDATE, DELETE)
Reset Password
- In SAP HANA Studio: User → Change Password
- Or via SQL:
ALTER USER <username> PASSWORD <newpassword> FORCE PASSWORD CHANGE
For SAP BTP
- Get fresh service key:
hana-cli serviceKey -i <instance> -k <key> - Credentials may have expired after service key rotation
- Get fresh service key:
SSL Certificate Errors
Symptom: "DEPTH_ZERO_SELF_SIGNED_CERT" or "Certificate verification failed"
Causes:
- Self-signed certificates (common in development)
- Expired certificates
- Certificate not trusted by system
Solutions:
Temporary Fix (Development Only)
json{ "sslValidateCertificate": false }⚠️ Never do this in production!
Permanent Fix
- Update Node.js to latest version
- Install proper SSL certificates
- Contact database administrator
System Time Issues
- Incorrect system clock causes certificate validation failure
- Verify system time:
date - Sync time if needed
Command Execution Issues
Table Not Found Error
Symptom: Error: Table 'MY_TABLE' not found or Table does not exist
Causes:
- Table name is case-sensitive (usually uppercase in HANA)
- Table in different schema than expected
- Table doesn't exist yet
- User doesn't have permission to access table
Solutions:
Check Table Name (Case-Sensitive)
bash# These are different MY_TABLE # Case as stored my_table # Lowercase not found My_Table # Different caseList Available Tables
bashhana-cli tables # or for specific schema hana-cli tables --schema SALESVerify Schema
bash# Check current schema hana-cli status # List all schemas hana-cli schemas # Use fully qualified name hana-cli inspectTable --table MY_TABLE --schema SALESCheck User Permissions
bash# See current user hana-cli inspectUser # Request table access from database administrator
Schema Not Found or Not Accessible
Symptom: Error: Schema '<schema>' does not exist or permission denied
Causes:
- Schema name typo or wrong case
- User doesn't have access to schema
- Schema doesn't exist
Solutions:
List Available Schemas
bashhana-cli schemasCheck Schema Permissions
bashhana-cli status # Shows user and rolesRequest Access
- Contact database administrator
- Ask to grant SELECT privilege on schema
- May need role assignment
File Not Found (Import/Export)
Symptom: Error: File not found or Cannot read file
Causes:
- File path doesn't exist
- Relative path not working as expected
- File permissions issue
- Wrong file format
Solutions:
Verify File Path
bash# Use absolute path hana-cli import --file /absolute/path/to/data.csv # or in current directory ls -la data.csvCheck File Exists and is Readable
bash# Verify file exists test -f data.csv && echo "File exists" || echo "Not found" # Check permissions ls -la data.csv # Should show -rw- (readable)Verify File Format
bash# CSV file file -b data.csv # Should show: ASCII text # Excel file file -b data.xlsx # Should show: Microsoft ExcelCheck File Contents
bash# Show first few lines head -5 data.csv # Check for encoding issues file data.csv
Import Errors and Data Issues
Symptom: Import partially succeeds with some rows having errors.
Causes:
- Data type mismatches
- Invalid values for columns
- Constraint violations (primary key, foreign key)
- File format issues
Solutions:
Preview Before Importing
bashhana-cli import --file data.csv --table MY_TABLE --dryRun trueShows what would be imported without actually importing.
Skip Errors and Continue
bashhana-cli import \ --file data.csv \ --table MY_TABLE \ --skipWithErrors true \ --errorLimit 100Enable Error Logging
bashhana-cli import \ --file data.csv \ --table MY_TABLE \ --saveErrors true \ --errorFile error.logValidate Data Quality
bash# After import hana-cli dataValidator --table MY_TABLE # Check for duplicates hana-cli duplicateDetection --table MY_TABLE # Profile the data hana-cli dataProfile --table MY_TABLEFix Data Issues
- Correct invalid data in source file
- Verify column mappings
- Check data types match table definition
- Review constraints
Performance Issues
Commands Running Slow
Symptom: Commands take longer than expected to complete.
Causes:
- Large datasets being processed
- Complex queries
- Network latency
- Database load/contention
- Missing indexes
Solutions:
Check System Health
bashhana-cli healthCheck hana-cli memoryAnalysisFilter Large Results
bash# Instead of full table hana-cli dataProfile --table BIG_TABLE --limit 10000 # Use schema filter hana-cli tables --schema SALESCheck CPU and Memory
bashhana-cli cpuAnalysis hana-cli memoryAnalysis --sort usedIdentify Expensive Queries
bashhana-cli expensiveStatements --order executionTime --limit 10Review Indexes
bashhana-cli indexTest --table MY_TABLE
Out of Memory Error
Symptom: Error: Out of memory or process crashes.
Causes:
- Processing too much data at once
- Memory fragmentation
- Database memory pressure
Solutions:
Check Available Memory
bashhana-cli memoryAnalysis hana-cli diskSpaceProcess Data in Batches
bashhana-cli import \ --file large_file.csv \ --table MY_TABLE \ --parallel 4 \ --batchSize 1000Increase Available Memory
bashexport NODE_OPTIONS="--max-old-space-size=4096" hana-cli dataProfile --table BIG_TABLEUse Limits and Filters
bash# Profile subset only hana-cli dataProfile --table BIG_TABLE --limit 100000
MCP Server Issues
MCP Server Not Starting
Symptom: Claude Dev can't connect to MCP Server or "Connection refused"
Causes:
- Build not updated
- Wrong path in configuration
- Node.js not installed
- Port conflicts
Solutions:
Rebuild MCP Server
bashcd mcp-server npm run buildVerify Configuration Path
json{ "mcpServers": { "hana-cli": { "command": "node", "args": ["D:/projects/hana-developer-cli-tool-example/mcp-server/build/index.js"] } } }Use absolute path with forward slashes.
Test Server Start
bashnode mcp-server/build/index.jsShould start without errors.
Check Node.js Installation
bashnode --version # Should be v14 or higher
No Commands Available in MCP
Symptom: MCP connects but shows no available commands.
Causes:
- Build failed silently
- TypeScript compilation errors
- Missing dependencies
Solutions:
Check Build Success
bashls -la mcp-server/build/ # Should show many filesCheck for Compilation Errors
bashcd mcp-server npm run build 2>&1 | tee build.log cat build.log | grep -i errorReinstall Dependencies
bashcd mcp-server rm -rf node_modules package-lock.json npm install npm run build
MCP Commands Time Out
Symptom: "Command timeout" when running MCP tools.
Causes:
- Database query taking too long
- Network latency
- Default timeout too short
Solutions:
Increase Timeout
bashhana-cli tables --timeout 600Filter Results
bashhana-cli tables --table MY_* --schema SALESCheck Database Health
bashhana-cli healthCheck
Getting Help
Enable Debug Output
All commands support debug mode:
hana-cli <command> --debugCheck Logs
# View recent logs
tail -100 ~/.hana-cli/logs/latest.log
# Enable verbose logging
export DEBUG=hana-cli:*
hana-cli <command>Community Support
GitHub Issues
- Report bug or request feature
- Include error message, command, and debug output
SAP Community
- SAP HANA Cloud forum
- SAP BTP community
Documentation
Troubleshooting Checklist
When reporting issues, include:
- [ ] Error message (full text)
- [ ] Command that failed
- [ ] Debug output (
--debugflag) - [ ] Operating system and Node.js version
- [ ] MCP Server version
- [ ] Connection details (host, port, schema)
- [ ] Database version
- [ ] Steps to reproduce
Next Steps
- Setup and Configuration - Fix connection issues
- Features Overview - Learn what commands do
- Development Guide - Contribute fixes