-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hi,
My application is crashing when it is trying to trigger the notification. I am getting the following error:
alertnotification","msg":"Emit failed {\n event: 'Default',\n cause: Error: Unauthorized\n at NotifyToRest.postNotification (/home/vcap/app/node_modules/@cap-js/notifications/srv/notifyToRest.js:34:21)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Promise.all (index 0)\n at async NotifyToRest.handle (/home/vcap/app/node_modules/@sap/cds/lib/srv/srv-dispatch.js:76:21)\n at async ODataRequest.<anonymous> (/home/vcap/app/node_modules/@sap/cds/libx/outbox/index.js:303:14)\n at async ODataRequest.emit (/home/vcap/app/node_modules/@sap/cds/lib/req/context.js:54:9)\n at async ProcessorService.commit (/home/vcap/app/node_modules/@sap/cds/lib/srv/srv-tx.js:139:7)\n at async /home/vcap/app/node_modules/@sap/cds/libx/_runtime/cds-services/adapter/odata-v4/handlers/action.js:61:9 {\n unrecoverable: true\n }\n}"}
Here's my MTA
_schema-version: '3.1'
ID: incident-management
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- rm -rf incident-management-ui-deployer/resources
- npm install --production
- npx -p @sap/cds-dk cds build --production
- mkdir gen/ui-resources
modules:
- name: incident-management-ui-resources
type: com.sap.application.content
path: gen/ui-resources
requires:
- name: incident-management-html5-repo-host
parameters:
content-target: true
build-parameters:
requires:
- name: incident-management
artifacts:
- ./*.zip
target-path: .
- name: incident-management
type: html5
path: app/incidents
build-parameters:
builder: custom
commands:
- npm install
- npx -p @ui5/cli ui5 build --dest ../../gen/app/incidents/dist
--include-task=generateManifestBundle
--include-task=generateCachebusterInfo
- bash -c "cd ../../gen/app/incidents/dist && npx bestzip
../incidents.zip *"
supported-platforms:
[]
build-result: ../../gen/app/incidents
- name: incident-management-portal-content-deployer
type: com.sap.application.content
path: packages/deploy-int/portal-content
requires:
- name: incident-management-portal
parameters:
content-target: true
service-key:
name: incident-management-portal-deploy-key
config:
content-endpoint: developer
- name: incident-management-auth
- name: incident-management-html5-repo-host
- name: incident-management-ui-resources
- name: incident-management-approuter
type: nodejs
path: packages/deploy-int/approuter
parameters:
memory: 128M
requires:
- name: incident-management-auth
- name: incident-management-portal
- name: incident-management-html5-repo-runtime
- name: srv-api
group: destinations
properties:
forwardAuthToken: true
strictSSL: true
name: srv-api
url: '~{srv-url}'
- name: incident-management-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
build-parameters:
builder: npm
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires:
- name: incident-management-db
- name: incident-management-auth
- name: incident-management-destination
- name: incident-management-alerts
- name: incident-management-db-deployer
type: hdb
path: gen/db
parameters:
buildpack: nodejs_buildpack
requires:
- name: incident-management-db
- name: notification-content-deployment
type: nodejs
path: gen/srv
parameters:
no-route: true
no-start: true
memory: 500MB
disk-quota: 500MB
tasks:
- name: notification-content-deployment
command: "node node_modules/@cap-js/notifications/lib/content-deployment.js"
memory: 500MB
disk-quota: 500MB
requires:
- name: incident-management-destination
- name: incident-management-auth
- name: incident-management-db
- name: incident-management-alerts
resources:
- name: incident-management-portal
type: org.cloudfoundry.managed-service
parameters:
service-plan: standard
service: portal
- name: incident-management-html5-repo-runtime
type: org.cloudfoundry.managed-service
parameters:
service-plan: app-runtime
service: html5-apps-repo
- name: incident-management-html5-repo-host
type: org.cloudfoundry.managed-service
parameters:
service-plan: app-host
service: html5-apps-repo
- name: incident-management-db
type: com.sap.xs.hdi-container
parameters:
service: hana
service-plan: hdi-shared
- name: incident-management-auth
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
path: ./xs-security.json
config:
xsappname: incident-management-${org}-${space}
tenant-mode: dedicated
- name: incident-management-destination
type: org.cloudfoundry.managed-service
parameters:
service: destination
service-plan: lite
- name: incident-management-alerts
type: org.cloudfoundry.managed-service
parameters:
service: alert-notification
service-plan: lite
Metadata
Metadata
Assignees
Labels
No labels