Skip to Content
0
Jul 30, 2020 at 04:19 PM

Authorization error accessing classic schema from HDI container

488 Views

I am trying to follow the tutorial at,

https://developers.sap.com/tutorials/xsa-create-user-provided-anonymous-service.html#0753e5cd-6c4f-43b2-8225-0886cf87cf80

I am not able to build the DB after creating the synonym to the table in classic schema,

Error: com.sap.hana.di.synonym: The container's object owner "DB_1#OO" is not authorized to access the "PLAIN.PRODUCT_SEGMENT" synonym target. This user needs to be granted "SELECT" ("EXECUTE" for procedures) privileges on the target object. [8250505]
at "src/synonyms/plain.hdbsynonym" (0:0)

I am able to build successfully after creating the hdbgrants file. I do not understand the error, because the synonym and the hdbgrant file give the needed access to the object owner. Also, there is no mention of 'reference' keyword in the help document.

Here's a complete log of the failed build.

8:21:16 PM (Builder) Build of "/HANA_APP/db" started.
8:21:22 PM (DIBuild) Build of "/HANA_APP/db" in progress.
8:21:23 PM (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-e6q72ye2mqupm5ku-HANA_APP-hdi_db' for resource 'XSA_DEV-e6q72ye2mqupm5ku-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.up to date in 0.625s> deploy@ start /hana/shared/HXE/xs/controller_data/executionagent/executionroot/3304bc0a-ae07-4cbb-9512-be499e736958/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-2368462583301604518/db> node node_modules/@sap/hdi-deploy/deploy.js
8:21:25 PM (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 44Using service replacements from environment variable "SERVICE_REPLACEMENTS" with 1 replacementsNo ignore file at /hana/shared/HXE/xs/controller_data/executionagent/executionroot/3304bc0a-ae07-4cbb-9512-be499e736958/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-2368462583301604518/db/.hdiignore.Collecting files...No .hdiconfig found in cfg/, using the one in src.Collecting files... ok (0s 5ms)4 directories collected10 files collected0 reusable modules collectedTarget service: XSA_DEV-e6q72ye2mqupm5ku-HANA_APP-hdi_dbSession variable APPLICATION is set to "SAP_HDI/development/HANAExpress".Previous build with request ID 478 finished at 2020-07-30 13:48:00.621086000 with status Finished and message: Make failed (4 errors, 1 warnings): tried to deploy 1 files, undeploy 0 files, redeploy 0 dependent files.Processing revoke files...Processing revoke files... ok (0s 0ms)Processing grants files... Processing "cfg/plain.hdbgrants"...  Using grantor service "ServiceName_1" of type "sql" Processing "cfg/plain.hdbgrants"... okProcessing grants files... ok (0s 71ms)Preprocessing files...Preprocessing files... ok (0s 0ms)Connecting to the container "DB_1"...Connecting to the container "DB_1"... ok (0s 23ms)Locking the container "DB_1"...Locking the container "DB_1"... ok (0s 277ms)Synchronizing files with the container "DB_1"...Synchronizing files with the container "DB_1"... ok (0s 790ms)1 modified or added files are scheduled for deploy based on delta detection0 deleted files are scheduled for undeploy based on delta detection (filtered by undeploy whitelist)0 files are scheduled for deploy based on explicit specification0 files are scheduled for undeploy based on explicit specificationDeploying to the container "DB_1"...
8:21:28 PM (DIBuild)  Starting make in the container "DB_1" with 1 files to deploy, 0 files to undeploy...   Disabling table replication for the container schema "DB_1"...   Disabling table replication for the container schema "DB_1"... ok  (0s 131ms)  Migrating libraries...   Migrating libraries... ok  (0s 40ms)  Making...    Preparing...    Preparing the make transaction...    Adding "src/synonyms/plain.hdbsynonym" for deploy...    Adding "src/synonyms/plain.hdbsynonym" for deploy... ok  (0s 99ms)   Preparing... ok  (0s 338ms)   Preparing the make transaction... ok  (0s 723ms)   Calculating dependencies...     Expanding...      Expanding "src/synonyms/plain.hdbsynonym"...      Expanding "src/synonyms/plain.hdbsynonym"... ok  (0s 2ms)    Expanding... ok  (0s 88ms)    Precompiling...      Precompiling "src/synonyms/plain.hdbsynonym"...      Precompiling "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"...       Expanded from "src/synonyms/plain.hdbsynonym"      Precompiling "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"... ok  (0s 0ms)     Precompiling "src/synonyms/plain.hdbsynonym"... ok  (0s 3ms)    Precompiling... ok  (0s 21ms)    Merging...      Merging "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"...       Expanded from "src/synonyms/plain.hdbsynonym"      Merging "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"... ok  (0s 0ms)     Precompiling "$synonym.config/PRODUCT_SEGMENT" (merged)...       Merged from "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"      Precompiling "$synonym.config/PRODUCT_SEGMENT" (merged)... ok  (0s 0ms)    Merging... ok  (0s 136ms)   Calculating dependencies... ok  (0s 339ms)   Processing work list...     Deploying "$synonym.config/PRODUCT_SEGMENT"...      Merged from "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"     Deploying "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"...      Expanded from "src/synonyms/plain.hdbsynonym"     Deploying "src/synonyms/plain.hdbsynonym$PRODUCT_SEGMENT.defaults"... ok  (0s 0ms)    Deploying "$synonym.config/PRODUCT_SEGMENT"... ok  (0s 19ms)    Deploying "src/synonyms/plain.hdbsynonym"...      Error: com.sap.hana.di.synonym: The container's object owner "DB_1#OO" is not authorized to access the "PLAIN.PRODUCT_SEGMENT" synonym target. This user needs to be granted "SELECT" ("EXECUTE" for procedures) privileges on the target object. [8250505]       at "src/synonyms/plain.hdbsynonym" (0:0)    Warning: Worker 2 running the "com.sap.hana.di.synonym" plugin has encountered an error while deploying 1 objects [8212030]    Error: Worker 2 has encountered an error; all remaining jobs will be canceled [8214600]   Error: Processing work list... failed [8212102]   Make failed (4 errors, 1 warnings): tried to deploy 1 files, undeploy 0 files, redeploy 0 dependent files   Error: Making... failed [8211605] Error: Starting make in the container "DB_1" with 1 files to deploy, 0 files to undeploy... failed [8214168]Deployment to container DB_1 failed - error: HDI make failed [Deployment ID: none].Error: HDI make failed(4s 130ms)npm ERR! code ELIFECYCLEnpm 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/3304bc0a-ae07-4cbb-9512-be499e736958/app/META-INF/cache/node8.15/.npm/_logs/2020-07-30T14_51_30_486Z-debug.log
8:21:28 PM (Builder) Build of /HANA_APP/db failed.