4 weeks 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?
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?
User | Count |
---|---|
72 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.