SAP-samples / btp-cap-multitenant-saas

Sample project that demonstrates how to setup a multitenant application for a Software-as-a-Service scenario, leveraging the Kyma and Cloud Foundry Runtimes of the SAP Business Technology Platform. Developers learn how to implement their own CAP (mtxs) based SaaS app including an SaaS API and integration with various essential SAP BTP service of...
Apache License 2.0
75 stars 38 forks source link

When deploying to kyma: Error: service hana as replacement for service com-hdi-container undefined #46

Closed corey-aloia closed 4 weeks ago

corey-aloia commented 2 months ago

I wanted to avoid creating an issue, but I am currently stuck. When I subscribe from a consumer tenant, the subscription fails, and in the srv pod, I see the logs:

{"level":"error","logger":"mtx","correlation_id":"f8c173a2-a10d-441d-4ee4-e803c08bc0ad","tenant_id":"51f4f02c-2d87-4475-8a9b-d1090ce7e252","timestamp":"2024-07-03T13:20:39.653Z","msg":"Error: service hana as replacement for service com-hdi-container undefined\n","type":"log"}

When I look at the log file, I see:

VCAP_SERVICES: {
"hana": [
  {

      "driver": "com.sap.db.jdbc.Driver",
      "hdi_p[...]
      "hdi_user": "...",
      "host": "...",
      "p[...]
      "port": "443",
      "schema": "...",
      "url": "...",
      "user": "..."
    },
    "tags": [
      "hana"
    ]
  }
]
Not a hana service or user-provided service with hana tag
}
@sap/hdi-deploy, version 4.9.3 (mode default), server version 4.00.000.00.1715685275 (4.0.0.0), cloud version 2024.2.14, node version 18.20.3, HDI version 1014, container API version 1006
Deployment started at 2024-07-03 13:20:38
Using @sap/hana-client@2.19.21 for connection
Using service replacements from environment variable "SERVICE_REPLACEMENTS" with 1 replacements
No ignore file at /workspace/gen/51f4f02c-2d87-4475-8a9b-d1090ce7e252/.hdiignore.
Collecting files...
Collecting files... ok (0s 24ms)
8 directories collected
276 files collected
0 reusable modules collected
Target service: 51f4f02c-2d87-4475-8a9b-d1090ce7e252
Session variable APPLICATION is set to "SAP_HDI//".
Could not determine status of last build: Could not find any information about the previous deployment.
Processing revoke files...
Processing revoke files... ok (0s 0ms)
Processing grants files...
 Processing "cfg/COM.hdbgrants"...
Deployment ended at 2024-07-03 13:20:39
Error: service hana as replacement for service com-hdi-container undefined

NOTE: I Have removed some potentially sensitive information

I am not sure what the undefined is. The env variable looks like:

SERVICE_REPLACEMENTS=[{ "key" : "com-hdi-container", "service" : "hana" }]

and looks to be correct according to the documentation.

I haven't changed anything locally regarding this. Just build the images, pushed them, and ran the helm install

If get my service isntances and service bindings, it looks like they are all created, and in the UI, I do not see any errors for any subscriptions.

I have also tried to uninstall the application and re-install, but still get the same.

I have re-gone through the documentation, but haven't found anything that I missed. I also don't find help online when googling. If someone here has an idea, that would be great :)

alperdedeoglu commented 2 months ago

I can confirm this issue and I was able to reproduce it, i will now try to understand the root cause and give that a fix. Thanks for reporting @corey-aloia!