Technical Articles
How to check the connectivity to your backend system in Business Application Studio
Updates
- added a troubleshooting section
- explained how to refresh the destination cache
What’s new
Today I learned about a new cool feature that is available with SAP Business Application Studio.
It’s now possible to run curl commands in the terminal window of SAP Business Application Studio to test the connectivity of a destination defined in your SAP Cloud Platform Sub Account.
So if you have destination called S4H_Test in your SAP Cloud Platform (CF) sub account
You can test the access via this destination now from within SAP Business Application Studio.
For this simply open a new terminal window
And enter the following command, where you would have to replace S4H_TEST.dest with <your_destination>.dest in your own sub account.
curl -v -i "S4H_Test.dest/sap/opu/odata/iwfnd/catalogservice;v=2/ServiceCollection?%24top=1"
When successful as shown in the screen shot below you would get a HTTP 200 response and you would be able to have a look at all the http headers that are sent alongside with the request and that are being returned by your backend system.
user: projects $ curl -v -i "S4H_Test.dest/sap/opu/odata/iwfnd/catalogservice;v=2/ServiceCollection?%24top=1" * Expire in 0 ms for 6 (transfer 0x55f75e9e8f50) * Uses proxy env variable no_proxy == 'localhost,127.0.0.1,github.com,.github.com,.npmjs.org,.yarnpkg.com,npm.sap.com,.maven.apache.org' * Uses proxy env variable http_proxy == 'http://127.0.0.1:8887' * Trying 127.0.0.1... * TCP_NODELAY set * Expire in 200 ms for 4 (transfer 0x55f75e9e8f50) * Connected to 127.0.0.1 (127.0.0.1) port 8887 (#0) > GET http://S4H_Test.dest/sap/opu/odata/iwfnd/catalogservice;v=2/ServiceCollection?%24top=1 HTTP/1.1 > Host: S4H_Test.dest > User-Agent: curl/7.64.0 > Accept: */* > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK HTTP/1.1 200 OK
Disclaimer
The development team of SAP Business Application Studio told me that the exact syntax of the placeholder <destination_name>.dest might be subject to changes in the future.
Though there are currently no concrete plans for such changes it cannot be ruled out.
If there are changes, I will update my blog accordingly.
Why is this important?
To see why this is an important and valuable feature we have to take a look what the check connection button brings to the table when checking a connection from SAP Cloud Platform to an SAP ABAP backend now with SAP Business Application Studio and in the past with SAP Web IDE.
Use case 1 – System unavailable
When the system is not available the check connection button will get the following response
In case of using the new feature of testing using curl we get a much more detailed information
GET http://S4H_Test.dest/sap/opu/odata/iwfnd/catalogservice;v=2/ServiceCollection?%24top=1 HTTP/1.1
> Host: S4H_Test.dest
> User-Agent: curl/7.64.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 504 Gateway Timeout
HTTP/1.1 504 Gateway Timeout
Use case 2 – Wrong password in destination
When I enter a wrong password in the definition of my destination it becomes more tricky for the UI developer to find the root cause of this error.
This is because you will get the same popup when testing the destination with the check connection button as you would get it when the password is correct.
Connection to “S4H_Test” established. Response returned: “404: Not found”
When we use curl in a terminal window in SAP Business Application Studio instead we get the following response.
> GET http://S4H_Test.dest/sap/opu/odata/iwfnd/catalogservice;v=2/ServiceCollection?%24top=1 HTTP/1.1
> Host: S4H_Test.dest
> User-Agent: curl/7.64.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 401 Unauthorized
HTTP/1.1 401 Unauthorized
And a large response in html format
<html><head><meta http-equiv=”content-type” content=”text/html; charset=windows-1252″><title>Anmeldung fehlgeschlagen</title><style>body { background: #ffffff; text-align: center; width:100%; height:100%; overflow:hidd
where “Anmeldung fehlgeschlagen” is German and means “Login failed”
Troubleshooting
There is a cache for destinations. I ran into this issue myself and always got an error and it seemed that changes in the destination did not become active.
By running the following command in the terminal window this cache is cleared.
curl localhost:8887/reload
Hello Andre and thank you for this post.
When I test from the cockpit I get this message :
When I do the test in Business Application Studio I get error 500.
Everything seems to be fine in the cloud connector and I did the same configuration that worked in Neo.
Do you have any idea what could be wrong ?
thank you
Hi Louis,
I believe, this was know issue and from 25-Apr-2021 fixes this has been resolved now.
And also the cloud connectors new feature (which was missing ealier in SAP BTP) is added under Connectivity section as shown in below option:
Regards
Saket Amraotkar
Hello,
Thanks for sharing those information.
When I try to execute my UI5 application which call an OData service, the metadata url give me this :
Do you have any idear ?
Regards,
Joseph
Hi,
I get this error when testing the destination:
< HTTP/1.1 503 Service Unavailable
HTTP/1.1 503 Service Unavailable
Regards,
Aidan
Hi Aidan - I get the same. Did you manage to find a solution?
We found that the issue was with out firewall proxy.
By default the proxy intercepts ssl/tls traffic, decrypts it, analyses it, then re-encrypts it with a local domain certificate that all local machines trust. The trouble is it can’t handle client certificates so as a workaround we tell it not to decrypt traffic from these addresses, which allows both client and server to see each others real certificates.
https://help.sap.com/webcomponents/products/SAP%20Business%20Application%20Studio/9d1db9835307451daa8c930fbd9ab264/8509485251814213876223e332bfdcbb.html?locale=en-US
Thanks
Hi Andre, Thanks for the nice blog.
We have configured cloud connector and created destination. Destination check successful and curl command is returning 200 ok status and receiving response but when we use the same destination in the fiori template its prompting for service user and service password again.
Do you have any idea what could be wrong ?
Thanks,
Sam
Hi Andre,
thanks for the blog, currently i am facing one issue of internal error 500 while deploying application from SAP BAS application into S/4 Hana 2021 Onpremise system. I tried the curl command and received the below error message.
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
HTTP/1.1 500 Internal Server Error
The Adt Icf node and repository service has been activated.
Could you please help with the issue.
regards,
Omkar.
Hell Omkar,
i am also facing the same issue.
< HTTP/1.1 503 Service Unavailable
HTTP/1.1 503 Service Unavailable
>
Did you get any resolution on this?
Dear Andre,
thank you for the great blog! we do get the 404 error! but it is not because of the wrong password! we connect BAS with our Bitbucket through cloud connector. on the Cloud connector directly, we can curl to our on premise bitbucket. But on the BAS when we curl our on premise bitbucket the error 404 not found pops up. could you maybe take a look at the output attached? Thank you & BR
I have pinged my BAS colleagues.
Dear Andre,
the problem was that BAS recognizes the on premise git url with port included, in our loadbalancer we added a new rule for the Git onpremise that starts with the Git URL and recognizes all the ports and path afterwards.
thank you
BR Banafsheh
Thank you very much for sharing the solution of your problem !