sapmentors / cap-community

SAP CAP Community
MIT License
97 stars 26 forks source link

Fallback to lookup destination with the name of the configured data source doesn't work when deployed to HANA XSA #48

Open gregorwolf opened 4 years ago

gregorwolf commented 4 years ago

Hello CAP Team,

the documentation Configuring Required Services - For HTTP-Based Consumption states:

If the destination is omitted, the runtime looks for a destination with the name of the configured data source.

But my sample project controller-api that I have to deploy to a HANA XSA returns the following error:

(9223372036854775784)[1583215124568][APP/9-0] ERR [ERROR] In production mode it is required to set `options.destination`
(9223372036854775785)[1583215124568][APP/9-0] ERR at new RestClient (/node_modules/@sap/cds-rest/lib/client/Client.js:67:13)

when I leave out the destination in the package.json. With the following configuration the destination is at least called:

      "controller-config": {
        "kind": "rest",
        "credentials": {
          "requestTimeout": 10000,
          "destination": "controller-config"
        },
        "pool": {
          "min": 1,
          "max": 10
        }
      }

Best regards Gregor