Skip to Content
Technical Articles
Author's profile photo Andre Fischer

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

Failure reason: “An error of type NoStackTraceTimeout occurred during check connection!”

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

 

 

 

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Louis-Arnaud BOUQUIN
      Louis-Arnaud BOUQUIN

      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

      Author's profile photo Saket Amraotkar
      Saket Amraotkar

      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

      Author's profile photo Joseph BERTHE
      Joseph BERTHE

      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 :

      Error: self signed certificate in certificate chain
          at TLSSocket.onConnectSecure (_tls_wrap.js:1088:34)
          at TLSSocket.emit (events.js:198:13)
          at TLSSocket._finishInit (_tls_wrap.js:666:8)

      Do you have any idear ?

      Regards,

      Joseph

      Author's profile photo Aidan McNamara
      Aidan McNamara

      Hi,

      I get this error when testing the destination:

      < HTTP/1.1 503 Service Unavailable
      HTTP/1.1 503 Service Unavailable

      Regards,
      Aidan

      Author's profile photo Colin Brain
      Colin Brain

      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

      Author's profile photo Sumankumar Kurimilla
      Sumankumar Kurimilla

      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

       

      Author's profile photo Omkar G
      Omkar G

      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.

      Author's profile photo subrata roy
      subrata roy

      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?

      Author's profile photo Banafsheh Alinejad
      Banafsheh Alinejad

      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

      user: user $ curl -v -i GET https://its.company.com/bitbucket/scm/sap/x.git -u USER
      
      Enter host password for user 'USER':
      
      * 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,.repo-cache.svc.cluster.local'
      
      * Uses proxy env variable http_proxy == 'http://127.0.0.1:8887'
      
      * Trying 127.0.0.1:8887...
      
      * Connected to 127.0.0.1 (127.0.0.1) port 8887 (#0)
      
      * Server auth using Basic with user 'USER'
      
      > GET http://GET/ HTTP/1.1
      
      > Host: GET
      
      > Authorization: Basic YYY
      
      > User-Agent: curl/7.74.0
      
      > Accept: */*
      
      > Proxy-Connection: Keep-Alive
      
      >
      
      * Mark bundle as not supporting multiuse
      
      < HTTP/1.1 500 Internal Server Error
      
      HTTP/1.1 500 Internal Server Error
      
      < Content-Type: text/plain; charset=utf-8
      
      Content-Type: text/plain; charset=utf-8
      
      < X-Content-Type-Options: nosniff
      
      X-Content-Type-Options: nosniff
      
      < Date: Tue, 04 Apr 2023 09:28:40 GMT
      
      Date: Tue, 04 Apr 2023 09:28:40 GMT
      
      < Content-Length: 53
      
      Content-Length: 53
      
      <
      
      dial tcp: lookup GET on 100.64.0.10:53: no such host
      
      * Connection #0 to host 127.0.0.1 left intact
      
      * 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,.repo-cache.svc.cluster.local'
      
      * Uses proxy env variable https_proxy == 'http://127.0.0.1:8887'
      
      * Hostname 127.0.0.1 was found in DNS cache
      
      * Trying 127.0.0.1:8887...
      
      * Connected to 127.0.0.1 (127.0.0.1) port 8887 (#1)
      
      * allocate connect buffer!
      
      * Establish HTTP proxy tunnel to its.company.com:443
      
      * Server auth using Basic with user 'USER'
      
      > CONNECT its.company.com:443 HTTP/1.1
      
      > Host: its.company.com:443
      
      > User-Agent: curl/7.74.0
      
      > Proxy-Connection: Keep-Alive
      
      >
      
      < HTTP/1.0 200 OK
      
      HTTP/1.0 200 OK
      
      <
      
      * Proxy replied 200 to CONNECT request
      
      * CONNECT phase completed!
      
      * ALPN, offering h2
      
      * ALPN, offering http/1.1
      
      * successfully set certificate verify locations:
      
      * CAfile: /etc/ssl/certs/ca-certificates.crt
      
      * CApath: /etc/ssl/certs
      
      * TLSv1.3 (OUT), TLS handshake, Client hello (1):
      
      * CONNECT phase completed!
      
      * CONNECT phase completed!
      
      * TLSv1.3 (IN), TLS handshake, Server hello (2):
      
      * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
      
      * TLSv1.3 (IN), TLS handshake, Certificate (11):
      
      * TLSv1.3 (IN), TLS handshake, CERT verify (15):
      
      * TLSv1.3 (IN), TLS handshake, Finished (20):
      
      * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
      
      * TLSv1.3 (OUT), TLS handshake, Finished (20):
      
      * SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
      
      * ALPN, server did not agree to a protocol
      
      * Server certificate:
      
      * subject: O=GoProxy untrusted MITM proxy Inc; CN=its.company.com
      
      * start date: Jan 1 00:00:00 1970 GMT
      
      * expire date: Dec 31 00:00:00 2049 GMT
      
      * subjectAltName: host "its.company.com" matched cert's "its.company.com"
      
      * issuer: C=IL; O=SAP; OU=DevX; L=Raanana; ST=Israel; CN=Workspace Proxy
      
      * SSL certificate verify ok.
      
      * Server auth using Basic with user 'USER'
      
      > GET /bitbucket/scm/sap/x.git HTTP/1.1
      
      > Host: its.company.com
      
      > Authorization: Basic YYY
      
      > User-Agent: curl/7.74.0
      
      > Accept: */*
      
      >
      
      * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
      
      * Mark bundle as not supporting multiuse
      
      < HTTP/1.1 404 Not Found
      
      HTTP/1.1 404 Not Found
      
      < Cache-Control: private
      
      Cache-Control: private
      
      < Connection: close
      
      Connection: close
      
      < Content-Language: en
      
      Content-Language: en
      
      < Content-Type: text/html;charset=utf-8
      
      Content-Type: text/html;charset=utf-8
      
      < Date: Tue, 04 Apr 2023 09:28:39 GMT
      
      Date: Tue, 04 Apr 2023 09:28:39 GMT
      
      < Ntcoent-Length: 796
      
      Ntcoent-Length: 796
      
      < Server: envoy
      
      Server: envoy
      
      < Transfer-Encoding: chunked
      
      Transfer-Encoding: chunked
      
      < Vary: Accept-Encoding
      
      Vary: Accept-Encoding
      
      < X-Envoy-Upstream-Service-Time: 286
      
      X-Envoy-Upstream-Service-Time: 286
      
      < X-Frame-Options: SAMEORIGIN
      
      X-Frame-Options: SAMEORIGIN
      
      <
      
      * Closing connection 1
      
      * TLSv1.3 (OUT), TLS alert, close notify (256):
      
      <!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1></body></html>
      Author's profile photo Andre Fischer
      Andre Fischer
      Blog Post Author

      I have pinged my BAS colleagues.

      Author's profile photo Banafsheh Alinejad
      Banafsheh Alinejad

      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

      Author's profile photo Andre Fischer
      Andre Fischer
      Blog Post Author

      Thank you very much for sharing the solution of your problem !