cancel
Showing results for 
Search instead for 
Did you mean: 

Tutorial on SAP HANA XS Advanced - need help

Flavio
Active Contributor
0 Kudos

Hello all,

I'm following the tutorial

SAP HANA XS Advanced, Access a classic schema from an HDI container;

and when I reach the end of Step 5, where the db module should be built, I'm getting the following error on invalid user name DB_1#00:

Error: Error executing: GRANT "SELECT","SELECT METADATA" ON SCHEMA "PLAIN" TO "DB_1#OO" WITH GRANT OPTION;
 (nested message: invalid user name: DB_1#OO: line 1 col 55 (at pos 54))

Any clue how to solve it?

Many thanks and best regards,

Flavio

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate

What you have here is a mismatch between HANA Tenants. The XSA space is bound to a particular tenant (show in the XSA Cockpit). When you create the User Provided Service you specify a port. That port controls the which tenant you connect to.

My suggestion is that if you are using a recent version of HANA you can actually leave the host and port out of the user provided service definition. When you don't supply these details, the deployer will automatically fall back to the connection settings of the main container connection. This way you never have a mismatch.

Flavio
Active Contributor
0 Kudos

Hi thomas.jung, thank you for answering.
About your suggestion, I fear I'm forced to enter both the host and port, as they are required fields (I'm on HANA Express 2.0 Rel. 45 SPS 04).
Anyway, as I did already too many attempts, and actually thinking to have in some way compromised the things done so far, I have started everything from scratch.
Now, I've realized that up to Step 5 included, everything run smoothly: built at the end of the step is successful, here the log:

22:29:08 (Builder) Build of "/HANA_APP/db" started.

22:29:17 (DIBuild) Build of "/HANA_APP/db" in progress.

22:29:17 (DIBuild) Service provisioning for module: '/db'
No service instance will be created for the 'CROSS_SCHEMA_PRODUCTS' resource of the 'org.cloudfoundry.existing-service' type.
Service instance 'XSA_DEV-3fcx700vh5sdgvqr-HANA_APP-hdi_db' for resource 'XSA_DEV-3fcx700vh5sdgvqr-HANA_APP-hdi_db' already exists, no operation will be performed.
[INFO] Injecting source code into builder...
[INFO] Source code injection finished
[INFO] ------------------------------------------------------------------------
Your module contains a package.json file, it will be used for the build. 22:29:22 (DIBuild) up to date in 1.035s
> deploy@ start /hana/shared/HXE/xs/controller_data/executionagent/executionroot/726f4dd8-3f76-4b99-bcc4-5444055c454c/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-4352852457050400536/db
> node node_modules/@sap/hdi-deploy/deploy.js 22:29:24 (DIBuild) @sap/hdi-deploy, version 3.10.0 (mode default), server version 2.00.045.00.1575639312 (2.0.45.0), node version 8.15.1, HDI version 4, container API version 44
Using service replacements from environment variable "SERVICE_REPLACEMENTS" with 1 replacements
No ignore file at /hana/shared/HXE/xs/controller_data/executionagent/executionroot/726f4dd8-3f76-4b99-bcc4-5444055c454c/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-4352852457050400536/db/.hdiignore.
Collecting files...
Collecting files... ok (0s 11ms)
2 directories collected
5 files collected
0 reusable modules collected
Target service: XSA_DEV-3fcx700vh5sdgvqr-HANA_APP-hdi_db
Session variable APPLICATION is set to "SAP_HDI/development/HANAExpress".
Previous build with request ID 28 finished at 2020-04-04 20:47:25.952589000 with status Committed and message: Make succeeded (2 warnings): 3 files deployed (effective 5), 0 files undeployed (effective 0), 0 dependent files redeployed.
Processing revoke files...
Processing revoke files... ok (0s 0ms)
Processing grants files...
Processing grants files... ok (0s 0ms)
Preprocessing files...
Preprocessing files... ok (0s 2ms)
Connecting to the container "DB_1"...
Connecting to the container "DB_1"... ok (0s 20ms)
Locking the container "DB_1"...
Locking the container "DB_1"... ok (0s 173ms)
Synchronizing files with the container "DB_1"...
Synchronizing files with the container "DB_1"... ok (1s 40ms)
0 modified or added files are scheduled for deploy based on delta detection
0 deleted files are scheduled for undeploy based on delta detection (filtered by undeploy whitelist)
0 files are scheduled for deploy based on explicit specification
0 files are scheduled for undeploy based on explicit specification Deploying to the container "DB_1"... 22:29:26 (DIBuild) Starting make in the container "DB_1" with 0 files to deploy, 0 files to undeploy...
Enabling table replication for the container schema "DB_1"...
Enabling table replication for the container schema "DB_1"... ok (0s 6ms)
Starting make in the container "DB_1" with 0 files to deploy, 0 files to undeploy... ok (0s 28ms)
Deploying to the container "DB_1"... ok (0s 654ms)
No default-access-role handling needed; global role "DB_1::access_role" will not be adapted
Unlocking the container "DB_1"...
Unlocking the container "DB_1"... ok (0s 1ms)
Deployment to container DB_1 done [Deployment ID: none].(2s 984ms) 22:29:26 (DIBuild) ********** End of /HANA_APP/db Build Log ********** 22:29:26 (DIBuild) Build results link: https://hxehost:53075/che/builder/workspace3fcx700vh5sdgvqr/download-all/d5a16e68-a692-48f9-8b64-349... 22:29:29 (Builder) Build of /HANA_APP/db completed successfully.

Then, I proceeded with Step 6 adding the hdbgrants, with Step 7 adding the synonyms and with Step 8 creating the new HDB CDS artifact: at the subsequent built, the failure:

22:34:40 (Builder) Build of "/HANA_APP/db" started.

22:34:45 (DIBuild) Build of "/HANA_APP/db" in progress.

22:34:45 (DIBuild) Service provisioning for module: '/db'
No service instance will be created for the 'CROSS_SCHEMA_PRODUCTS' resource of the 'org.cloudfoundry.existing-service' type.
Service instance 'XSA_DEV-3fcx700vh5sdgvqr-HANA_APP-hdi_db' for resource 'XSA_DEV-3fcx700vh5sdgvqr-HANA_APP-hdi_db' already exists, no operation will be performed.
[INFO] Injecting source code into builder...
[INFO] Source code injection finished
[INFO] ------------------------------------------------------------------------
Your module contains a package.json file, it will be used for the build.

22:34:47 (DIBuild) up to date in 0.768s

22:34:49 (DIBuild) 
> deploy@ start /hana/shared/HXE/xs/controller_data/executionagent/executionroot/726f4dd8-3f76-4b99-bcc4-5444055c454c/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-3090414225257608106/db
> node node_modules/@sap/hdi-deploy/deploy.js

@sap/hdi-deploy, version 3.10.0 (mode default), server version 2.00.045.00.1575639312 (2.0.45.0), node version 8.15.1, HDI version 4, container API version 44
Using service replacements from environment variable "SERVICE_REPLACEMENTS" with 1 replacements
No ignore file at /hana/shared/HXE/xs/controller_data/executionagent/executionroot/726f4dd8-3f76-4b99-bcc4-5444055c454c/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-3090414225257608106/db/.hdiignore.
Collecting files...
No .hdiconfig found in cfg/, using the one in src.
Collecting files... ok (0s 18ms)
4 directories collected
9 files collected
0 reusable modules collected
Target service: XSA_DEV-3fcx700vh5sdgvqr-HANA_APP-hdi_db
Session variable APPLICATION is set to "SAP_HDI/development/HANAExpress".
Previous build with request ID 34 finished at 2020-04-04 22:29:24.512627000 with status Committed and message: Starting make in the container "DB_1" with 0 files to deploy, 0 files to undeploy... ok.
Processing revoke files...
Processing revoke files... ok (0s 0ms)
Processing grants files...
 Processing "cfg/plain.hdbgrants"...
  Using grantor service "ServiceName_1" of type "sql"
Error: Error executing: GRANT "SELECT","SELECT METADATA" ON SCHEMA "PLAIN" TO "DB_1#OO" WITH GRANT OPTION;
 (nested message: invalid user name: DB_1#OO: line 1 col 55 (at pos 54))
grantor service: "ServiceName_1", type: "sql", user: "SYSTEM"
file name: cfg/plain.hdbgrants
(0s 525ms)
npm ERR! code ELIFECYCLE
npm ERR! errno 1npm ERR! deploy@ start: `node node_modules/@sap/hdi-deploy/deploy.js`
npm ERR! Exit status 1npm ERR! 
npm ERR! Failed at the deploy@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /hana/shared/HXE/xs/controller_data/executionagent/executionroot/726f4dd8-3f76-4b99-bcc4-5444055c454c/app/META-INF/cache/node8.15/.npm/_logs/2020-04-04T22_34_47_909Z-debug.log

22:34:49 (Builder) Build of /HANA_APP/db failed.

Looks like something linked to the grants...

Any ideas?

Thanks again and best regards

Flavio

thomas_jung
Developer Advocate
Developer Advocate

The answer is the same as before. If the technical user isn't found then it's a mismatch between tenants. The hostname and port are not required in the User Provided Service on SPS04. You can just delete those from the User Provided Service.

Flavio
Active Contributor
0 Kudos

Really sorry to bother... just removed port and host from the created User Provided Service:

now, trying to build will give this other error:

Error: Error executing: GRANT "SELECT","SELECT METADATA" ON SCHEMA "PLAIN" TO "DB_1#OO" WITH GRANT OPTION; (nested message: invalid schema name: PLAIN: line 1 col 44 (at pos 43))

that is, no 'invalid user name' anymore, but 'invalid schema name'...

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Schema PLAIN I assume is your existing schema you want to do cross access to from the HDI container. From that error I'm guessing you are still mismatching your HANA Tenants. Now you have the user provided service and HDI container pointing to the same tenant, but this schema PLAIN must be in a different tenant. You can not use cross container access to cross over tenants.