cancel
Showing results for 
Search instead for 
Did you mean: 

Error for hdbgrants file.

Ajinkya_Jadhav
Participant
0 Kudos

Hello Experts,

When I am trying to build the hdbgrants file I am getting the below error message.

"Error: There were multiple "." found in name "TEST_PROJECT.TEST_DB.auth.roles::developer". There can only be at most one ".".grantor service: "consumed-db", type: "sql", user: "TESTUSER""

I know the error message is quite clear that it does not accept the "." more than one but in my case the hdbrole created in source container is having the same namespace and its not feasible for us to change the name.

Do we have any solution for this?

PS: I have created the hdbgrants file in src folder, do I have to create the hdbgrants file in cfg folder? If yes, what is the use of the cfg folder, do we have any documentation or blogs ?

Kindly help.

Thank You.

Best Regards,

Ajinkya Jadhav

thomas_jung
Developer Advocate
Developer Advocate

Yes hdbgrants files belong in the cfg folder. That way they are processed before anything in the src folder gets created or adjusted. Also hdbgrants is not technically a development artifact -- IE it doesn't create development objects. Its a configuration artifact as it is only granting access (a configuration task).

However to help your troubleshoot the error I think we are going to need to see what is the content of your hdbgrants, maybe your hdbrole, and maybe a look at your project structure as well. And what are you trying to do here. Grant a role from within this container, from another container, from a repository role, or from a (foreign) schema role?

Ajinkya_Jadhav
Participant
0 Kudos

Hi Thomas,

Thanks for your response.

The basic objective of this is very simple.

We have two tenants in our SAP HANA XSA. Let say T1 and T2. In Tenant T1 we have an schema SOURCE in which we have an Calculation View CV_TEST.

We have a Space S2 mapped on tenant T2 where we have created an MTA project. In DB Module of that project, we want to access the CV_TEST. For that we are using synonyms.

My hdbgrants file is as follows:

{
  "consumed-db": {
    "object_owner" : {
      "container_roles":[ "TEST_PROJECT.TEST_DB.auth.roles::developer"]
    },
    "application_user" : {
      "container_roles":["TEST_PROJECT.TEST_DB.auth.roles::developer"]
    }
  }
}

The role mentioned here is an hdbrole which is as below:

{
   "role": {
     "name": "TEST_PROJECT.TEST_DB.auth.roles::developer",
     "schema_privileges": [
       {
         "privileges": [ "SELECT", "EXECUTE", "INSERT", "UPDATE", "DELETE", "ALTER" ]
       }
     ] 
}
}


<br>

When I build the hdbgrants file, it gives me the error I have mentioned in the question.

Overall, you can say that we want to access the objects from XS Classic schema in our MTA project which resides in different tenants.

NOTE: I got below error when I created the hdbgrants file in cfg folder and build the DB module.

Using service "consumed-db" of type "sql"Error: Cannot read property 'replace' of undefinedgrantor service: "consumed-db", type: "sql", user: "TECHUSER"file name: /hanamnt/SYSTEMID/xs/app_working/HOSTNAME/executionroot/7168554d-d727-4d75-98f0-/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-4037323277619027987/TEST_DB/cfg/external.hdbgrants(0s 200ms)

Thank You.

Accepted Solutions (0)

Answers (0)