a month ago - last edited 3 weeks ago
Hello Community & Experts,
I have a problem related to the deployment of my service.
The Hana Cloud is already linked via the instance mapping and the deployment has already been deployed once.
Now I get sporadically the following error, no matter if it's a fresh deployment or just an update:
2024-04-19T07:54:11.965+0000 [APP/PROC/WEB/0] STDOUT [cds] - loaded model from 1 file(s):
2024-04-19T07:54:11.965+0000 [APP/PROC/WEB/0] STDOUT ../deps/0/node_modules/@sap/cds-mtxs/db/t0.cds
2024-04-19T07:54:11.970+0000 [APP/PROC/WEB/0] STDOUT [mtx] - retrieving { tenants: [ 't0' ] } { uncached: [ 't0' ] }
2024-04-19T07:54:12.176+0000 [APP/PROC/WEB/0] STDOUT [mtx] - GET https://service-manager.cfapps.eu10.hana.ondemand.com/v1/service_offerings { params: { fieldQuery: "catalog_name eq 'hana'" } }
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR /home/vcap/deps/0/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js:70
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR cds.error(_errorMessage(e, 'getting', tenant), { status: e.status ?? 500 })
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR ^
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR Error: Error getting tenant t0: Could not find service offering with catalog_name eq 'hana'
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at get (/home/vcap/deps/0/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js:70:9)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async Object.acquire (/home/vcap/deps/0/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js:58:16)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async ApplicationService.<anonymous> (/home/vcap/deps/0/node_modules/@sap/cds-mtxs/srv/plugins/hana.js:63:38)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async next (/home/vcap/deps/0/node_modules/@sap/cds/lib/srv/srv-dispatch.js:68:17)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async ApplicationService.handle (/home/vcap/deps/0/node_modules/@sap/cds/lib/srv/srv-dispatch.js:66:10)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async /home/vcap/deps/0/node_modules/@sap/cds-mtxs/srv/plugins/common.js:67:23
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async module.exports.resubscribeT0IfNeeded (/home/vcap/deps/0/node_modules/@sap/cds-mtxs/srv/plugins/common.js:65:5)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async cds.emit (/home/vcap/deps/0/node_modules/@sap/cds/lib/index.js:13:62)
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR at async cds_server (/home/vcap/deps/0/node_modules/@sap/cds/server.js:40:3) {
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR status: 500
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR }
2024-04-19T07:54:12.246+0000 [APP/PROC/WEB/0] STDERR Node.js v18.19.1
This is my configuration of the MTA YAML File:
_schema-version: "3.1"
ID: myservice
version: 0.0.5
description: "CAP: Message Master Data Service"
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm install --include=dev
- npx cds build --production
modules:
# --------------------- APP ROUTER ------------------------
- name: myservice
# ------------------------------------------------------------
type: approuter.nodejs
path: app/router
build-parameters:
builder: custom
commands: []
ignore: [ '.DS_Store', 'node_modules/', 'default-env.json', 'manifest*.yml' ]
parameters:
app-name: myservice-${space}
app-domain: ${app-name}.${default-domain}
keep-existing-routes: true
disk-quota: 256M
memory: 256M
properties:
TENANT_HOST_PATTERN: "^(.*)-${default-uri}"
requires:
- name: myservice-srv-api
group: destinations
properties:
name: srv-api # must be used in xs-app.json as well
url: ~{srv-url}
forwardAuthToken: true
- name: myservice-auth
- name: myservice-destination
provides:
- name: myservice-router
properties:
app-protocol: ${protocol}
app-url: ${default-url}
app-uri: ${default-uri}
app-domain: ${app-domain}
application: ${app-name}
# --------------------- SERVER MODULE ------------------------
- name: myservice-srv
# ------------------------------------------------------------
type: nodejs
path: gen/srv
build-parameters:
builder: npm
ignore:
- '.DS_Store'
- 'node_modules/'
- 'default-*.json'
- 'manifest*.yml'
parameters:
app-name: myservice-srv-${space}
app-domain: ${app-name}.${default-domain}
buildpack: nodejs_buildpack
memory: 256MB
disk-quota: 2024MB
keep-existing-routes: true
requires:
- name: myservice-auth
- name: myservice-api-auth
- name: myservice-db
- name: myservice-destination
provides:
- name: myservice-srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
srv-name: ${app-name}
app-domain: ${app-domain}
# ----------- MTX MODULE ----------
- name: myservice-mtx
# ------------------------------------------------------------
type: nodejs
path: gen/mtx/sidecar
build-parameters:
builder: npm-ci
ignore:
- '.DS_Store'
- 'node_modules/'
- 'default-*.json'
- 'manifest*.yml'
parameters:
app-name: myservice-mtx-${space}
memory: 128M
disk-quota: 512MB
properties:
appName: ~{myservice-router/application}
approuterUri: ~{myservice-router/app-uri}
appDomain: ~{myservice-router/app-domain}
brokerName: ~{myservice-sb-srv/app-name}
brokerUrl: ~{myservice-sb-srv/srv-url}
tenantSeparator: '-'
requires:
- name: myservice-srv-api
- name: myservice-sb-srv
- name: myservice-auth
- name: myservice-db
- name: myservice-registry
- name: myservice-destination
- name: myservice-service-manager-admin
- name: myservice-router
provides:
- name: myservice-mtx-api
properties:
mtx-url: ${default-url}
# ----------- BROKER MODULE (OSBAPI Implementation) ----------
- name: myservice-sb
# ------------------------------------------------------------
type: nodejs
path: broker
build-parameters:
builder: custom
commands:
[]
ignore:
- '.DS_Store'
- 'node_modules/'
- 'default-*.json'
- 'manifest*.yml'
parameters:
app-name: myservice-sb-${space}
memory: 128MB
disk-quota: 512MB
properties:
SBF_ENABLE_AUDITLOG: false
SBF_CATALOG_FILE: ./catalog.json
SBF_CATALOG_SUFFIX: ${space}-${org}
SBF_SERVICE_CONFIG:
myservice-api:
extend_credentials:
shared:
apiUrl: ~{myservice-srv-api/srv-url}
extend_xssecurity:
per_plan:
default:
authorities:
- $XSMASTERAPPNAME.plan_default
extend_catalog:
metadata:
displayName: Message Service API (${org} - ${space})
SBF_BROKER_CREDENTIALS_HASH: >
{
"broker-user": "<Broker-Hash-PW>"
}
requires:
- name: myservice-api-auth
- name: myservice-srv-api
provides:
- name: myservice-sb-srv
properties:
app-name: ${app-name}
srv-url: ${default-url}
resources:
# ----------------- XSUAA - Service -------------------------
- name: myservice-auth
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
properties:
xsuaa-app: ${xsuaa-app}
XSAPPNAME: ${xsuaa-app}
parameters:
service: xsuaa
service-name: ${space}-myservice-auth
service-plan: application
path: ./xs-security.json
xsuaa-app: myservice-${space}-${org}
config:
xsappname: ${xsuaa-app}
tenant-mode: shared
requires:
- name: myservice-router
# ----------------- XSUAA - Broker ----------------------------
- name: myservice-api-auth
# -------------------------------------------------------------
type: org.cloudfoundry.managed-service
properties:
xsuaa-app: ${xsuaa-app}
parameters:
service: xsuaa
service-name: ${space}-myservice-api-auth
service-plan: broker
xsuaa-app: myservice-api-${space}-${org}
config:
xsappname: ${xsuaa-app}
# ----------------------- HDI SERVICE ------------------------
- name: myservice-db
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: service-manager
service-name: ${space}-myservice-db
service-plan: container
service-tags:
- "hana"
properties:
hdi-service-name: ${service-name}
# ----------------- DESTINATION SERVICE ----------------------
- name: myservice-destination
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service-plan: lite
service-name: ${space}-myservice-destination
service: destination
# -------------- SERVICE MANAGER SERVICE ADMIN ---------------
- name: myservice-service-manager-admin
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: service-manager
service-name: ${space}-myservice-service-manager-admin
service-plan: subaccount-admin
# ----------------------- MTX SERVICE ------------------------
- name: myservice-registry
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
requires:
- name: myservice-auth
- name: myservice-mtx-api
- name: myservice-router
parameters:
service: saas-registry
service-name: ${space}-myservice-registry
service-plan: application
config:
xsappname: ~{myservice-auth/xsuaa-app}
appName: ~{myservice-auth/xsuaa-app}
displayName: 'Message Service (${org} - ${space})'
description: >
A service to get the Message + Texts.
category: 'Custom'
appUrls:
getDependencies: ~{myservice-mtx-api/mtx-url}/-/cds/saas-provisioning/dependencies
onSubscription: ~{myservice-mtx-api/mtx-url}/-/cds/saas-provisioning/tenant/{tenantId}
onSubscriptionAsync: true
onUnSubscriptionAsync: true
onUpdateDependenciesAsync: true
callbackTimeoutMillis: 300000 # Increase if your deployments are taking longer than that
appPlans:
- name: default
description: Default plan
Did anybody had those type of issue yet?
I have opened a Ticket on SAP side and I think I got a solution.
Try to add in the package.json's the following configuration:
Don't forget to put it in both package.json's:
- package.json of the whole projekt
- package.json in the mtx/sidecar (if you are using it)
"requires": {
"db": {
"kind": "hana",
"vcap": {
"label": "sm",
"plan": "container"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have created an open ticket directly with SAP.
Once this is resolved, I will post the possible solution here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The issue may be that you have two service-manager instances bound to the sidecar app. CAP is not consistent in choosing one or the other for db service. You could tag the right one as db or hana to make the choice clear to CAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where do I have to add it?
In the package.json?
If yes in the one from the sidecar or the one directly from the service?
Is the structure then like that?
"cds": {
"profile": "mtx-sidecar",
"requires": {
"[production]": {
"auth": "xsuaa",
"db": {
"kind": "hana",
"vcap": {
"plan": "container"
}
},
"multitenancy": true
}
}
}
}
Perhaps you can confirm that the issue is indeed the second service-manager instance. Selecting between multiple bound service instances is currently not straight forward in CAP. But when I tried, both tag and plan appeared to yield the desired result. Before spending time on fixing that it would be good to confirm that the that problem to solve is indeed that. For example, does the error disappear if you unbind the second instance from sidecar and restart it? What is the order of bound services in VCAP_SERVICES, which plan comes first?
I guess you are right, if there are two service-managers the service sometimes hangs up.
I deployed it now 3 times completly new and also tried to update the service and I had no problems overall.
So I think that this could be a possible solution.
Maybe I should open a ticket on this point.
What do you think?
Only in the sidecar. The service is starting without any errors.
Service Startup:
2024-04-24T13:51:02.130+0000 [API/13] STDOUT Starting app with guid 16f17faa-fc97-4f74-8876-9b595e2847a6
2024-04-24T13:51:02.329+0000 [CELL/0] STDOUT Cell 72db40ae-8192-4f77-a8b5-be35f6790509 creating container for instance 44349cac-e1ab-441e-64c2-4411
2024-04-24T13:51:02.821+0000 [CELL/0] STDOUT Security group rules were updated
2024-04-24T13:51:02.884+0000 [CELL/0] STDOUT Cell 72db40ae-8192-4f77-a8b5-be35f6790509 successfully created container for instance 44349cac-e1ab-441e-64c2-4411
2024-04-24T13:51:03.279+0000 [CELL/0] STDOUT Downloading droplet...
2024-04-24T13:51:11.408+0000 [CELL/0] STDOUT Downloaded droplet (173.4M)
2024-04-24T13:51:11.408+0000 [CELL/0] STDOUT Starting health monitoring of container
2024-04-24T13:51:11.469+0000 [APP/PROC/WEB/0] STDOUT Invoking pre-start scripts.
2024-04-24T13:51:11.674+0000 [APP/PROC/WEB/0] STDOUT Invoking start command.
2024-04-24T13:51:12.116+0000 [APP/PROC/WEB/0] STDOUT > kronesdigitalmeda@0.0.5 start
2024-04-24T13:51:12.116+0000 [APP/PROC/WEB/0] STDOUT > cds-serve
2024-04-24T13:51:12.468+0000 [APP/PROC/WEB/0] STDOUT [cds] - loaded model from 1 file(s):
2024-04-24T13:51:12.469+0000 [APP/PROC/WEB/0] STDOUT srv/csn.json
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT [cds] - connect to db > hana {
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT sm_url: 'https://service-manager.cfapps.eu10.hana.ondemand.com',
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT url: 'XXXX',
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT clientid: 'XXXX',
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT clientsecret: '...',
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT xsappname: 'XXXX'
2024-04-24T13:51:12.692+0000 [APP/PROC/WEB/0] STDOUT }
2024-04-24T13:51:12.789+0000 [APP/PROC/WEB/0] STDOUT [cds] - using auth strategy {
2024-04-24T13:51:12.789+0000 [APP/PROC/WEB/0] STDOUT kind: 'xsuaa',
2024-04-24T13:51:12.789+0000 [APP/PROC/WEB/0] STDOUT impl: '../deps/0/node_modules/@sap/cds/lib/auth/jwt-auth'
2024-04-24T13:51:12.789+0000 [APP/PROC/WEB/0] STDOUT }
2024-04-24T13:51:12.873+0000 [APP/PROC/WEB/0] STDOUT [cds] - serving cds.xt.ModelProviderService { path: '/-/cds/model-provider' }
2024-04-24T13:51:13.086+0000 [APP/PROC/WEB/0] STDOUT [cds] - serving MessageMasterData {
2024-04-24T13:51:13.086+0000 [APP/PROC/WEB/0] STDOUT impl: 'srv/messagedata-service.js',
2024-04-24T13:51:13.086+0000 [APP/PROC/WEB/0] STDOUT path: '/odata/v4/message-master-data'
2024-04-24T13:51:13.086+0000 [APP/PROC/WEB/0] STDOUT }
2024-04-24T13:51:13.091+0000 [APP/PROC/WEB/0] STDOUT [cds] - server listening on { url: 'http://localhost:8080' }
2024-04-24T13:51:13.091+0000 [APP/PROC/WEB/0] STDOUT [cds] - launched at 4/24/2024, 1:51:12 PM, version: 7.8.2, in: 794.367ms
2024-04-24T13:51:17.935+0000 [CELL/0] STDOUT Container became healthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those are the versions which i use:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.