cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Express: How to debug a SQLScript procedure when called through UI5 module/nodejs module

0 Kudos

Hello,

I currently try to debug a SQLScript procedure when the procedure is called from the UI through a nodejs module.

I the debugger attach options options there is the option "Connection with following attributs" and the values

  • "HANA database user name"
  • "Application user name"

I assume the "HANA database user name" is the user from the environment of the node module:

xs env <node module name>:

"hana" : [ {
      "name" : "XSA_DEV-kifpjs1yx3zmy7s9-xccelo-hdi-container",
      "label" : "hana",
      "tags" : [ "hana", "database", "relational" ],
      "plan" : "hdi-shared",
      "credentials" : {
        "schema" : ".......",
        "hdi_password" : "........",
        "password" : "..........",
        "driver" : "com.sap.db.jdbc.Driver",
        "port" : "39013",
        "host" : "hxehost",
        "db_hosts" : [ {
          "port" : 39013,
          "host" : "hxehost"
        } ],
        "hdi_user" : "XCCELO_1_C4GGEY9MYHE64ZZTYOHJYE1W5_DT",
        "user" : "XCCELO_1_D0JHPO5OLKLVNC323YG43GWBZ_RT",
        "url" : "jdbc:sap://hxehost:39013/?currentschema=XCCELO_1"
      }
    } ],

Here "user" : "XCCELO_1_D0JHPO5OLKLVNC323YG43GWBZ_RT"

And the "Application user name" is the name of the user which is loggged on to the UI (in my case XSA_DEV).

When I try this options I get the error:

An error occurred when setting the user name: Error in attaching external session: 55 - you are not authorized to attach to a connection that belongs to this HANA user

Is my assumption for the "HANA database user name" right?

What HANA authorizations have to be assigned to which user ?

Where can I assign this authorizations ?

Which user should I use to assign the authorizations ?

Thanks

Achim

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Solution

The privilege "ATTACH DEBUGGER" have to be assigned to the "Debugger-User" by the

NodeJS module runtime user (above "XCCELO_1_D0JHPO5OLKLVNC323YG43GWBZ_RT").

The name of the DEBUGGER_USER can be seen in the "Debugger Attach Options".

  • In WEB IDE Database Explorer open the procedure for debugging.
  • In the "Debugger Attach Options" click button "ChooseConnection(s)". In the popup you can see the user name of the HANA runtime user which is used by the debugger.

In the WEBIDE database explorer create a new database connection to the HANA Database for the NodeJS module runtime user. Open a SQL console for the new database connection and call

GRANT ATTACH DEBUGGER TO <DEBUGGER_USER>;

Open the "Debugger Attach Options" again and specify the NodeJS module runtime user in the input field "Hana database user name".

Now the debugger stops at breakpoints when the procedure is called indirect by a SAPUI5 app.

jmalla
Contributor
0 Kudos

Hi achim-vogel64 - I tried this but it did not work.

When I get the user from the xs env nodeapp:

"hdi_user" : "SAP_AD_HDB_1_006J49J3XJGJ6FSKNWKB5TPOZ_DT",

"user" : "SAP_AD_HDB_1_1A778UE240HFZ58VDLJ4AZHRY_RT",

But in the debugger options, i see them run as: SAP_AD_HDB_1_CONKGU06ET1CCQKSGFVXXS6RB_RT

I granted:

GRANT ATTACH DEBUGGER TO SAP_AD_HDB_1_CONKGU06ET1CCQKSGFVXXS6RB_RT;

I tried both and running the nodejs service - but it does not stop. Do we need to specify anything for the application user name - i did pass XSA_DEV? Once I get this working, I will write a Blog.

Thanks,

Jay