Skip to Content

Background:

 

I had to upgrade the HANA One (Developer Edition) in AWS from Rev 48 to Rev 56 as part of the openSAP Introduction to Software Development on SAP HANA class.

Rev 48 client setup:

My Win7, C:\Windows\system32\drivers\etc\hosts file had the entry, aa.bb.cc.dd     imdbhdb, where aa.bb.cc.dd is the Elastic IP of the HANA Instance in AWS. 

 

I added the system in HANA studio using the entries below:

     Hostname: imdbhdb

     Instance Number: 00

     DB User Name: SYSTEM

     Password: <your password>   

Rev 56 Error:

After the upgrade to Rev 56, the above setup resulted in the Error “Database connection is not available” within a few minutes after adding the system in the HANA Studio.

Problem Analysis:

I activated the JDBC trace as below for Rev 56 (See http://help.sap.com/hana_platform SAP HANA Developer’s Guide):

7-5-2013 1-44-09 PM.jpg

JDBC would initially connect to the HANA server:

new Connection ‘jdbc:sap://imdbhdb:30015’
locale=en_US
user=SYSTEM
password=***

timeout=0
reconnect=true
validateCertificate=false
encrypt=false
HOSTLIST: [imdbhdb:30015,]

After a few minutes, the JDBC connect string would be replaced by the internal IP of the AWS HANA server and the connection would fail: 
new Connection ‘jdbc:sap://10.29.1.187:30015’
locale=en_US
user=SYSTEM
password=***
timeout=0
reconnect=true
validateCertificate=false
encrypt=false
HOSTLIST: [10.29.1.187:30015,]
new RTEException: -813 Cannot connect to host 10.29.1.187:30015 [Connection timed out: connect], -813.
whereAmIjava.lang.Throwable
at com.sap.db.util.Tracer.whereAmI(Tracer.java:348)
at com.sap.db.rte.comm.RTEException.<init>(RTEException.java:66)
at com.sap.db.rte.comm.SocketComm.openSocket(SocketComm.java:125)
at com.sap.db.rte.comm.SocketComm.<init>(SocketComm.java:58)
at com.sap.db.rte.comm.SocketComm$1.open(SocketComm.java:42)
at com.sap.db.jdbc.topology.Topology.getSession(Topology.java:145)
at com.sap.db.jdbc.Driver.openByURL(Driver.java:1016)
at com.sap.db.jdbc.Driver.connect(Driver.java:230)
at com.sap.ndb.studio.jdbc.JDBCPlugin$3.run(JDBCPlugin.java:642)
using null
=> FAILED

Rev 48 JDBC Connect

Rev 56 JDBC Connect

First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’

HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts:

new Connection ‘jdbc:sap://imdbhdb:30015’

HOSTLIST:

[imdbhdb:30015,imdbhdb.sapcoe.sap.com:30015,
10.30.128.6:30015,]

First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts:

new Connection ‘jdbc:sap://10.29.1.187:30015’

HOSTLIST: [10.29.1.187:30015,]

I looked at some of the SQL commands in the JDBC trace files:

SELECT “HOST”,”PORT”,
“SERVICE_NAME”,”ACTIVE_STATUS”,”PROCESS_ID”,
“COORDINATOR_TYPE”,”SQL_PORT” FROM SYS.M_SERVICES

Rev 48 Output

7-5-2013 2-30-05 PM.jpg

Rev 56 Output

7-5-2013 2-31-41 PM.jpg

SELECT “HOST”,”KEY”,”VALUE” FROM SYS.M_HOST_INFORMATION WHERE
UPPER(“HOST”) = ‘IMDBHDB’ AND (UPPER(“KEY”) = ‘SID’ OR UPPER(“KEY”) = ‘SAPSYSTEM’

Rev 48 Output

Rev 56 Output

7-5-2013 2-40-33 PM.jpg

7-5-2013 2-42-06 PM.jpg

SELECT “HOST”,”KEY”,”VALUE” FROM SYS.M_HOST_INFORMATION WHERE UPPER(“KEY”) LIKE ‘NET_%’

Rev 48 Output

Rev 56 Output

7-5-2013 2-19-42 PM.jpg

7-5-2013 2-24-45 PM.jpg

Workaround:

#1) Someone in openSAP forum suggested using hanaserver in the hosts file entry and in adding the system in HANA studio. While this worked, I did not like this option since hanaserver has no relationship to the actual hostname imdbhdb.

#2) I have been suggesting to folks — in the openSAP forum and in the AWS upgrade blog (http://scn.sap.com/docs/DOC-30980) — to use AWS Elastic IP  for hostname in HANA studio while adding the system and to NOT add any entry in the hosts file. While this might be the lesser of the two evils, both options had the yellow-icon problem for the sapstartsrv process in the HANA studio.The SAP HANA Systems (Navigator) tab/view would also say “Some services are not started” (with an yellow icon) or “System state cannot be determined” (with a gray icon) for the system.

Fix:

When you compared the outputs of the SQL commands between Rev 48 and Rev 56 listed above, the only difference is the new key net_publicname added in Rev 56 in the View SYS.M_HOST_INFORMATION.

I had to wait until SPS06 documents were published to see what this new key was.

“Public host name that should be used by client interfaces. Can contain a host name, FQDN or IP address”. (See http://help.sap.com/hana_platform SAP HANA System Views Reference)

The public_hostname_resolution parameter is documented in the SAP HANA Administration Guide (http://help.sap.com/hana_platform). This is a new parameter that has obviously been introduced after Rev 48. The values for this parameter are no,ip,name,fqdn with ip being the default in Rev 56. That is probably why the net_publichostname was set to the internal IP of the AWS HANA Instance. This raises another question as to why this was not set to the public IP (aka AWS Elastic IP) of the AWS Instance. The prudent thing at this point seems to be to disable this feature for the aforementioned reason and for backward compatibility.

Change this parameter value to no (disable feature and use internal hostname) when you are in HANA Studio (configured using the workaround #2 above).

7-5-2013 3-39-09 PM.jpg

7-5-2013 7-51-39 PM.jpg

7-5-2013 7-54-42 PM.jpg

The changed parameters are stored at the OS level as shown below.

7-5-2013 8-02-14 PM.jpg

The original *.ini files are at the OS level as shown below.

7-5-2013 4-53-55 PM.jpg

Let us run the SQL command now.

SELECT “HOST”,”KEY”,”VALUE” FROM SYS.M_HOST_INFORMATION WHERE UPPER(“KEY”) LIKE ‘NET_%’

7-5-2013 3-51-41 PM.jpg

Now the net_publicname is set to imdbhdb.

Delete the system from the HANA studio, add the AWS ELASTIC IP-to-host (imdbhdb) mapping in the hosts file, and re-add the system in the HANA studio using the hostname ibmdbhdb.

7-5-2013 4-05-15 PM.jpg

Now the sapstartsrv process has the green icon as above.

Let us compare the JDBC Connections.

Rev 48 JDBC Connect

Rev 56 JDBC Connect

First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts:

new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST:

[imdbhdb:30015,imdbhdb.sapcoe.
sap.com:30015,10.30.128.6:30015,]

First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’

HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’

HOSTLIST:

[imdbhdb:30015,imdbhdb.sapcoe.sap.com:30015,
10.29.1.187:30015,]

You are done. 🙂

[Please note that I have tested this fix only in AWS. I am not sure if Rev 56 systems hosted by other HANA Cloud hosting providers like CloudShare would have the same issue or if the fix would work if they did.]

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Idi Kurniawan

    I’ve been also struggling with studio Rev 56. I was thinking it was just because of the machine (windows 8) where I installed the studio, but then I see some people are also experiencing the same. Probably someone from developer center needs to comment on this blog.

     

    Thanks Mani for posting this blog. I’ll update once I have the chance to play with your workaround

     

    Regards,

    Idi

    (0) 
      1. Idi Kurniawan

        Yes, Mani. It works. But then, I had to recreate the workspace (delete and create). It didn’t allow to create a workspace with the same name as the previous one, so I had to delete the folder “._SYS_REGI_settings” first, then created a new workspace. I needed to checkout the project as well.

         

        Thanks.

        (0) 
        1. Mani Sekaran Muthu Post author

          Idi, Thanks for testing the fix. I don’t like the idea of deleting “\._SYS_REGI_settings” folder — you could have created a workspace with a different name. You could check out/import the project if the Repository had the latest version. You could also add the project (Create new project accepts an existing project) from your local C: drive and share it.

           

          Regards.

          (0) 
  2. Tom Cenens

    Hi Mani Sekaran Muthu

     

    Thanks for this nicely constructed, clear blog post . It’s still valid by the way, I’m running a Suite on HANA instance on Amazon AWS (REV72) and this came in use handy.

     

    Best regards

     

    Tom

    (0) 

Leave a Reply