cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get Github Sample Extension Georel to Work

mnigbor
Explorer
0 Kudos
529

I am attempting to get a sample S/4HANA Cloud event-driven extension from SAP's GitHub to work. Here's the URL to the repository

While I'm new to S/4HANA Cloud and BTP, I believe my S/4HANA and BTP environments are working. I was hoping to use this application to confirm that I've configured enterprise events correctly.

I was able to get through the first three steps in the Readme file without issue. In step 4, I made the necessary changes to manifest.yaml and service.js and pushed the application to Cloud Foundry. The push worked, but the application crashed during initialization. The log file contains this error:

2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR [ERROR] No amqp10ws credentials found. Hint: You need to bind your app to an Enterprise-Messaging service or provide the necessary credentials through environment variables.
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at _getOpts (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/options-messaging.js:29:11)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at _optionsMessagingAMQP (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/options-messaging.js:48:16)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at optionsMessagingAMQP (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/options-messaging.js:42:15)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at EnterpriseMessagingShared.getClient (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-shared.js:17:25)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at EnterpriseMessagingShared.init (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-shared.js:11:16)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at async Promise.all (index 0)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at async EnterpriseMessagingShared.prepend (/home/vcap/app/node_modules/@sap/cds/lib/srv/srv-handlers.js:23:5)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at async AsyncFunction.connect.to (/home/vcap/app/node_modules/@sap/cds/lib/srv/cds-connect.js:45:3)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at async cds_server (/home/vcap/app/node_modules/@sap/cds/server.js:47:33)
2023-01-09T10:53:21.61-0700 [APP/PROC/WEB/0] ERR at async serve (/home/vcap/app/node_modules/@sap/cds/bin/serve.js:192:18)

The error message is correct. The app is not bound to Event Mesh and no environment variables provide credentials. There's nothing in the Readme.md that says this needs to be done.

I've found where to bind the application to my Event Mesh instance in BTP Cockpit. The binding asks for JSON. The only documentation I can find has two examples but fails to explain the parameters in any way.

The error message says the credentials can be provided via process environment variables. I'd be happy to do this, if I could find any documentation that names the variables.

I didn't post any code because I've made no changes from what's in the repo, except the names of my services and my namespace.

Questions:

  1. Where can I find an explanation of what needs to go into application binding JSON?
  2. What environment variables are needed to provide the necessary credentials?
  3. Has anyone else managed to get this sample to work? If so, did you run into this issue?
View Entire Topic
Tobias_Griebe
Product and Topic Expert
Product and Topic Expert

Hi mnigbor,

You have already referred to the Readme.md file. Actually the first screenshot contains the information to bind your app to the Event Mesh service:

Starting line#10 you provide the service bindings of the app you are going to deploy.
Line#11 is the name of your Event Mesh default plan instance as you can see it from your BTP cockpit (service instances).

Just providing this information will do the service binding when you push the app to BTP. Normally no manual steps are required.

Even for manual service binding, you won't need to provide any JSON. Just follow the dialog (notice that I had already bound my app to the instance called "message_consumer" when taking the screenshot):

Once your app is bound to the service instances you should see the credentials as part of the environment:

The binding contains the same information that you can also get from the service key of your Event Mesh default instance.

I hope this helps to get started.

Best regards,
Tobias

mnigbor
Explorer
0 Kudos

Tobias,

Thank you for the prompt answer. I found a mistake in my manifest.yaml file and the app is now running. Your answer also helped me to understand manual binding better. Also, I edited the original post to remove the redundant link to the Readme file.