Search code examples
s4sdk

Unable to fetch the metadata : Failed to execute OData Metadata request. error after deploying s4sdk to cloud foundry


I am getting the below response while calling /businesspartners api after deploying s4sdk app to cf. enter image description here

I was able to test this app by deploying locally (after ALLOW_MOCKED_AUTH_HEADER: true), so i deployed the appl'n to cloud foundry, and tried using destinations service(insted of env), below are the steps that i followed.

step 1: Set up the cloud connector enter image description here

step 2: Create service instance of xsuaa and destinations enter image description here

step 3: Refer this in app yaml file enter image description here

step 4: Push the package to cloud. (mvn clean package; cf push) enter image description here

step 5: Now i went ahead and configured destinations; (app>> service instance>>destinations) enter image description here

Here i couldn't test the connectivity, when i pressed "check connection" i was getting the below error: enter image description here How do i test this connection?

step 6: With the belief that the connection is working i went ahead and restarted the app, and started testing api's. the app was up but when i was getting above(fig.1) error.

step 7: Tried looking at the logs, and notices the below to errors enter image description here

could anyone help over here to resolve this issue..?

  1. Tried with setting "ALLOW_MOCKED_AUTH_HEADER" -> same two issue
  2. Tried removing properties in destinations, but same errors.
  3. Could not try with destinations variable in CF, as our S4 system is not publicly opened, so tried it locally it works.
  4. Tried with Neo, it works both locally and on cloud.
  5. But after pushing to CF, couldn't manage to run

Thanks, Girish


Solution

  • You additionally need to bind your application to an instance of the connnectivity service on Cloud Foundry to communicate via the Cloud Connector. This is mentioned, albeit a bit hidden, in the error message "Failed to get connectivity service credentials: no service binding found".

    1. Create a service instance with cf create-service connectivity lite my-connectivity.
    2. Add the name of this instance to the section services in your manifest.yml file.

    If you still face issues afterwards, please also try to remove the proxyPort and proxyHost properties from your destination. Those should not be required.

    For more details about on-premise connectivity on SAP Cloud Platform Cloud Foundry, consult the following blog post.