on 06-07-2021 10:49 AM
Dear colleagues,
I try to setup a very basic multitenancy mta skeleton using the cds-mtx. After reading a while through various sources I came up with two pillars that have to be done:
cds.on('bootstrap', async (app) => {
await cds.mtx.in(app);
const provisioning = await cds.connect.to('Provisioning');
provisioning.impl(require('./provisioning'));
});
None of those two steps works for me, though. For the cds.mtx.in I get the error message
TypeError: cds.mtx.in is not a function
and for the Provisioning I get
Didn't find a configuration for 'cds.requires.Provisioning'<br>
I followed the instructions I found around the CAP documentation and in various places in github.com / github.wdf.sap.corp. I did not find a documentation though that helped me over that cliff.
The repo containing the code is CAP PoC, branch main. As it is you can run cds watch and use the test.http file to do the test calls. Then you can uncomment one by one the offending lines in server.js (line 27 for mtx and lines 28/29 for the Provisioning thing) to see the error.
I'm not used to Javascript, so this might be indeed just a plain beginners error.
Does anybody have a hint for me?
Thanks
Mathias
Hi Mathias,
In your .cdsrc.json, please replace "multiTenancy" by "multitenancy" and also add it to the non-production profile "requires" section.
Here's a minimal example:
"cds": {
"requires": {
"db": {
"kind": "hana",
"model": ["db", "srv"],
"vcap": {"label": "service-manager"}
},
"uaa": {
"kind": "xsuaa"
},
"multitenancy": true
}
}
Best regards,
Steffen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steffen,
yep, step forward, it gets loaded - cool, thanks!
Just to bring an error message up, though:
[cds] - serving SidecarProvisioningService { at: '/mtx/v1/internal/provisioning' }
[ERROR] Property 'user' should be a non-empty string
That leads me there:
function _getServiceCredentials() {
const cds = require('../../cds');
if (!cds.env.requires.db) {
support(ERRORS.hanaServiceMissing, logger);
throw new Error('HANA credentials could not be found.');
}
if (!cds.env.requires.db.credentials) {
support(ERRORS.hanaCredentialsMissing, logger);
throw new Error('HANA credentials could not be found.');
}
return cds.env.requires.db.credentials;
}
Okay, it's looking for a requires.db, some credentials, and specifically for a managed-hana instance manager as one can see by the options it requires. I have been told that this is obsolete as it is a HaaS item and on SAP HANA Cloud we work with the service-manager, plan = container.
Heading over to the Help I read that the service SAP HANA Schemas & HDI Containers (hana) is required. This one does not have the URLs needed for the instance management, they are just part of the lib. So, heading over to the App Managed SAP HANA Schemas & HDI Containers I read that this is the Hana service - and, as expected, this one has the URL entries.
Now I'm completely confused. Are HANA Cloud and HaaS handled different or ist it just fine for mtx if I add the latter service or is there another setting I'm missing?
Thanks
Mathias
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.