cancel
Showing results for 
Search instead for 
Did you mean: 

CAP: CDS deploy can't create service key

Hi colleagues,

i follow the WIKI of deploy my service to SAP HANA with CAP.

After i execute cds deploy --to hana:bookstore-hana.

i get the error

[ERROR] [cds.deploy] - Could not create service key bookstore-hana-key. at HanaDeployer._validateServiceKey (C:\Users\D070248\AppData\Roaming\npm\node_modules\@sap\cds-dk\node_modules\@sap\cds\bin\deploy\to-hana\hana.js:146:13) at HanaDeployer._getOrCreateCFService (C:\Users\D070248\AppData\Roaming\npm\node_modules\@sap\cds-dk\node_modules\@sap\cds\bin\deploy\to-hana\hana.js:115:10) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async HanaDeployer.deploy (C:\Users\D070248\AppData\Roaming\npm\node_modules\@sap\cds-dk\node_modules\@sap\cds\bin\deploy\to-hana\hana.js:55:11) at async Object.deploy (C:\Users\D070248\AppData\Roaming\npm\node_modules\@sap\cds-dk\bin\deploy\index.js:83:5)

But in the above the CF to create service key response is:

Creating service key bookstore-hana-key for service instance bookstore-hana as wenhao.wang@sap.com... REQUEST: [2021-04-28T13:17:55+02:00] POST /v2/service_keys HTTP/1.1 Host: api.cf.sap.hana.ondemand.com Accept: application/json Authorization: [PRIVATE DATA HIDDEN] Content-Type: application/json User-Agent: go-cli 6.36.1+e3799ad7e.2018-04-04 / windows {"name":"bookstore-hana-key","service_instance_guid":"5648a880-5ad4-41d7-865f-0de4a60cc221","parameters":{"permissions":"development"}} RESPONSE: [2021-04-28T13:17:57+02:00] HTTP/1.1 201 Created Connection: close Content-Length: 2783 Content-Type: application/json;charset=utf-8 Date: Wed, 28 Apr 2021 11:17:57 GMT Location: /v2/service_keys/a2d2c50a-08a8-410a-85dd-9624890d5a0d Server: nginx Strict-Transport-Security: max-age=31536000; includeSubDomains; preload; X-Content-Type-Options: nosniff X-Ratelimit-Limit: 40000 X-Ratelimit-Remaining: 39894 X-Ratelimit-Reset: 1619611633 X-Vcap-Request-Id: 60aa5c4b-541e-4b4b-4540-463fe89df94f::a35c6e2c-f849-4f7d-ad73-204774607625 { "metadata": { "guid": "a2d2c50a-08a8-410a-85dd-9624890d5a0d", "url": "/v2/service_keys/a2d2c50a-08a8-410a-85dd-9624890d5a0d", "created_at": "2021-04-28T11:17:57Z", "updated_at": "2021-04-28T11:17:57Z" }, "entity": { "name": "bookstore-hana-key", "service_instance_guid": "5648a880-5ad4-41d7-865f-0de4a60cc221", "credentials": { "host": "zeus.hana.canary.eu-central-1.whitney.dbaas.ondemand.com", "port": "44536", "driver": "com.sap.db.jdbc.Driver", "url": "jdbc:sap://zeus.hana.canary.eu-central-1.whitney.dbaas.ondemand.com:44536?encrypt=true&validateCertificate=true¤tschema=72021B6B192A42BE838529668EBF9635", "schema": "72021B6B192A42BE838529668EBF9635", "hdi_user": "72021B6B192A42BE838529668EBF9635_BPIS3LKVLN2T8AZ8M5XBALE8S_DT", "hdi_password":"[PRIVATE DATA HIDDEN]", "user": "72021B6B192A42BE838529668EBF9635_BPIS3LKVLN2T8AZ8M5XBALE8S_RT", "password":"[PRIVATE DATA HIDDEN]", "certificate": "-----BEGIN CERTIFICATE-----\nMIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\nd3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\nQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\nMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\nb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\nCSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\nnh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\nT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\ngdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\nBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\nTLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\nDQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\nhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\nPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\nYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\nCAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n-----END CERTIFICATE-----\n" }, "service_instance_url": "/v2/service_instances/5648a880-5ad4-41d7-865f-0de4a60cc221", "service_key_parameters_url": "/v2/service_keys/a2d2c50a-08a8-410a-85dd-9624890d5a0d/parameters" } } OK

But when i check the service instance the service key is created successful there.

Because the error the framework can't generate default-env.json and i can't continue.

Did anyone know why the service instance & service key is created successful but framework shows error?

I'm not use the trial account.

Thanks and Regards,

Wenhao

iwona_hahn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi wenhao_wang,

Which wiki are you referring to?

Best regards,
Iwona

Hi iwona.hahn ,

i'm following the WIKI https://developers.sap.com/tutorials/cp-cap-java-hana-db.html.

Best Regards,

Wenhao

iwona_hahn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

If your issues still exist, please open an issue here and I will get back to the development colleagues.

Best regards,
Iwona

sergiotarrillo
Product and Topic Expert
Product and Topic Expert

Hi iwona.hahn ,

I also have an issue using this command:

cds deploy --to hana:bookstore-hana

[deploy] -
[deploy] - Using container bookstore-hana
[deploy] - Creating service bookstore-hana - please be patient...
[deploy] - Creating service key bookstore-hana-key - please be patient...
[ERROR] CF-ResourceNotFound: Creation of service key failed (10010)

In the BTP account the service was created but the creation has failed with this error:

Failed to open connection to the database, because of: Failed to get connection for database '08da679b-d5ee-46ac-806e-cb5438c80018' (08da679b-d5ee-46ac-806e-cb5438c80018.hana.trial-us10.hanacloud.ondemand.com:443), because of: SAP DBTech JDBC: Cannot connect to jdbc:sap://08da679b-d5ee-46ac-806e-cb5438c80018.hana.trial-us10.hanacloud.ondemand.com:443 [Object is closed: com.sap.db.jdbc.SecureChannelSession@6553b84 08da679b-d5ee-46ac-806e-cb5438c80018.hana.trial-us10.hanacloud.ondemand.com:443 ConnectionID:0 SessionID:0 on sun.nio.ch.UnixAsynchronousSocketChannelImpl[connected local=/10.132.159.54:43818 remote=08da679b-d5ee-46ac-806e-cb5438c80018.hana.trial-us10.hanacloud.ondemand.com/34.202.189.140:443]].

Regards,

ST

gregorw
Active Contributor

If you're using BTP Trial or Free Tier you have to make sure that you have started your HANA instance.

amitkumar_gupta2
Explorer
0 Kudos

Hi wenhao_wang,

Let me know if you were able to resolve the issue. I am facing the same issue when trying the exercises.

Best Regards,

Amit

Accepted Solutions (0)

Answers (3)

Answers (3)

René
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi everyone,

Please add the dependency from Step 5 before you actually execute cds deploy.

<dependency>

    <groupId>com.sap.cds</groupId>

    <artifactId>cds-feature-hana</artifactId>

</dependency>

That did the trick for me. Will look into the details and edit the tutorial accordingly.

sukai_tian
Explorer
0 Kudos

Please run 'cf-login' to login your CF environment firstly, then run command 'cds deploy --to hana:bookstore-hana'.

gregorw
Active Contributor
0 Kudos

Dear Wenhaou,

the link you provided is pointing to a Tutorial.

Have you checked that your HANA is actually running? In the Trial environment it's shutdown every day.

Best regards
Gregor

Hi Gregor,

thanks for your replay. I'm using a Canary account, it won't shutdown every day.

Best Regards,

Wenhao