cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Activate hdbrole file

Former Member
0 Kudos

Hello experts,

I was following this iot service tutorial

https://www.youtube.com/watch?

v=SigA9SI8Xyc&list=PLkzo92owKnVxzjoxwJdaa400E_UqkzE8J&index=10

When I try to activate the iotaccess.hdbrole file, I have this error:

Error while activating /iotmmsxs/iotaccess.hdbrole:
[iotmmsxs:iotaccess.hdbrole] insufficient privilege: Not authorized at /sapmnt/ld7272/a/HDB/jenkins_prod/workspace/HANA__FA_CO_LIN64GCC48HAPPY_rel_fa~hana1sp12/s/ptime/query/checker/query_check.cc:3713

I followed the solution from this thread to give _SYS_REPO user the access to "SYSTEM", it didn't solve the issue.

Accepted Solutions (0)

Answers (1)

Answers (1)

anton_levin
Advisor
Advisor
0 Kudos

Hello Jonas, I cannot really comment on your direct question but if you are trying to replicate the IoT consumption example with XSODATA/XSJS [1] then please be advised that iotaccess.hdbrole file is not needed anymore with MDC setup. It was removed from the StarterKit resources [2].

Regards, Anton

[1] https://github.com/SAP/iot-starterkit/tree/master/src/apps/xs/consumption

[2] https://github.com/SAP/iot-starterkit/tree/master/src/apps/xs/consumption/iotmmsxs

Former Member
0 Kudos

Hi Anton,

Thank you for the information. I must have followed the old tutorial. Do you know if there any new tutorials for the iot starterkit by any chances?

Thanks,

Jonas

anton_levin
Advisor
Advisor
0 Kudos

StarterKit itself is a tutorial, all use cases are described in READMEs. For example, XSJS/XSODATA case https://github.com/SAP/iot-starterkit/tree/master/src/apps/xs/consumption

0 Kudos

Dear Anton Levin,

After giving iotmmsxs::Basic Application privilege, i am facing same issue. below error:

404 - Not found

We could not find the resource you're trying to access.

It might be misspelled or currently unavailable.

0 Kudos

Dear Anton Levin,

I using below code for hdb role:

role HANA.IoTDemo.IoTApp::iotservice { application privilege: HANA.IoTDemo.IoTApp::Basic; catalog schema "SYSTEM" : SELECT; }

Error while activating /HANA/IoTDemo/IoTApp/iotservice.hdbrole:
[HANA.IoTDemo.IoTApp:iotservice.hdbrole] insufficient privilege: Not authorized at /sapmnt/ld7272/a/HDB/jenkins_prod/workspace/HANA__FA_CO_LIN64GCC48HAPPY_rel_fa~hana1sp12/s/ptime/query/checker/query_check.cc:3716

If i change schema name to _SYS_BIC its activating

role HANA.IoTDemo.IoTApp::iotservice { application privilege: HANA.IoTDemo.IoTApp::Basic; catalog schema "_SYS_BIC" : SELECT; }

File /HANA/IoTDemo/IoTApp/iotservice.hdbrole saved & activated successfully.

Thanks,

anton_levin
Advisor
Advisor
0 Kudos

Hello Pradeep, if you try replicate an XS example from the IoT StarterKit, then I have the same answer I gave on January, 10 to Jonas: ".hdbrole file is not needed anymore" Regards, Anton

0 Kudos

Dear Anton Levin,

I have tried same procedure using below reference.

https://github.com/SAP/iot-starterkit/tree/master/src/apps/xs/consumption

1.xsaccess

{ "exposed" : true, "authentication" : [ { "method" : "Form" } ], "authorization" : [ "iotmmsxs::Basic" ] }

2.xsprivileges

{ "privileges" : [ { "name" : "Basic", "description" : "Basic IoT MMS privilege" } ] }

3.xsjs

var sBody = ''; var oConnection = $.hdb.getConnection(); var sQuery = 'SELECT * FROM "SYSTEM"."T_IOT_DB22E9760F758A2571A5"'; var oResultSet = oConnection.executeQuery(sQuery); for(var i = 0; i < oResultSet.length; i++) { sBody += oResultSet[i].G_DEVICE + ' | ' + oResultSet[i].G_CREATED + ' | ' + oResultSet[i].C_VALUE + ' | ' + oResultSet[i].C_TIMESTAMP + '\n'; } oConnection.close(); $.response.status = $.net.http.OK; $.response.contentType = "text/plain"; $.response.setBody(sBody);

4.xsodata

service { "SYSTEM"."T_IOT_DB22E9760F758A2571A5" key generate local "C_OPCODE"; }

5.Given iotmmsxs::Basic to Application privilege.

After this also i am getting below error while executing.

404 - Not found

We could not find the resource you're trying to access.
It might be misspelled or currently unavailable.

anton_levin
Advisor
Advisor

Were those XS resources activated successfully?

0 Kudos

Dear Anton Levin,

All xs files are saved and activated.

[22:51:19] File /iotmmsxs/.xsaccess saved & activated successfully.

[22:51:29] File /iotmmsxs/.xsprivileges saved & activated successfully.

[22:51:44] File /iotmmsxs/iotservice.xsjs saved & activated successfully.

[22:51:50] File /iotmmsxs/iotservice.xsodata saved & activated successfully.

anton_levin
Advisor
Advisor

.xsapp as well?

0 Kudos

Yes,

[23:13:01] File /iotmmsxs/.xsapp saved & activated successfully.