1

enter image description here

I get the following error in deep dive 9 and even the blog series step 7. The issue comes only when I make the backend service secure. If I do the steps only till the approuter, the application loads without any issue. Can you suggest what could be the reason?

Regards Arun.

Attaching the logs:

cf logs --recent approuter-exchangerate

   2018-05-03T14:05:05.23+0530 [RTR/6] OUT approuter-exchangerate-i038900trial.cfapps.sap.hana.ondemand.com - [2018-05-03T08:35:05.232+0000] "GET / HTTP/1.1" 302 0 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "10.0.136.2:43942" "10.0.137.2:65215" x_forwarded_for:"203.13.146.100, 10.0.136.2" x_forwarded_proto:"https" vcap_request_id:"f2fb8e59-7317-44bf-5c4a-e008c818f936" response_time:0.002824438 app_id:"6a6ee132-1c31-40b3-bb45-098ce441ecde" app_index:"0" x_b3_traceid:"f3cd3d8a7f9e5068" x_b3_spanid:"f3cd3d8a7f9e5068" x_b3_parentspanid:"-"
   2018-05-03T14:05:05.23+0530 [RTR/6] OUT
   2018-05-03T14:05:05.41+0530 [APP/PROC/WEB/0] OUT #2.0#2018 05 03 08:35:05:411#+00:00#INFO#/Auth/OAuth2#########7gXqF9n7LAceovZ9Ol2ZojAlJlJ4GobV######jgq9z03j#PLAIN##sending redirect to https://i038900trial.authentication.sap.hana.ondemand.com/oauth/authorize?response_type=code&client_id=sb-exchangerate-i038900trial!t2096&redirect_uri=https%3A%2F%2Fapprouter-exchangerate-i038900trial.cfapps.sap.hana.ondemand.com%2Flogin%2Fcallback#
   2018-05-03T14:05:05.41+0530 [RTR/7] OUT approuter-exchangerate-i038900trial.cfapps.sap.hana.ondemand.com - [2018-05-03T08:35:05.409+0000] "GET /index.html HTTP/1.1" 302 0 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "10.0.136.2:57012" "10.0.137.2:65215" x_forwarded_for:"203.13.146.100, 10.0.136.2" x_forwarded_proto:"https" vcap_request_id:"a8b923f0-ecb8-403a-4231-0ec1c522be38" response_time:0.006628218 app_id:"6a6ee132-1c31-40b3-bb45-098ce441ecde" app_index:"0" x_b3_traceid:"1f1cb639f34a713b" x_b3_spanid:"1f1cb639f34a713b" x_b3_parentspanid:"-"
   2018-05-03T14:05:05.41+0530 [RTR/7] OUT
   2018-05-03T14:05:17.47+0530 [RTR/7] OUT approuter-exchangerate-i038900trial.cfapps.sap.hana.ondemand.com - [2018-05-03T08:35:17.193+0000] "GET /login/callback?code=OTHZw1jZ98 HTTP/1.1" 302 0 0 "https://i038900trial.authentication.sap.hana.ondemand.com/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "10.0.136.2:38156" "10.0.137.2:65215" x_forwarded_for:"203.13.146.100, 10.0.136.2" x_forwarded_proto:"https" vcap_request_id:"1603e250-a88f-4737-6d16-2eec8a900de8" response_time:0.27849157 app_id:"6a6ee132-1c31-40b3-bb45-098ce441ecde" app_index:"0" x_b3_traceid:"1a3c5fefd1a296bf" x_b3_spanid:"1a3c5fefd1a296bf" x_b3_parentspanid:"-"
   2018-05-03T14:05:17.47+0530 [RTR/7] OUT
   2018-05-03T14:05:17.67+0530 [RTR/0] OUT approuter-exchangerate-i038900trial.cfapps.sap.hana.ondemand.com - [2018-05-03T08:35:17.644+0000] "GET /index.html HTTP/1.1" 404 0 0 "https://i038900trial.authentication.sap.hana.ondemand.com/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "10.0.136.2:53492" "10.0.137.2:65215" x_forwarded_for:"203.13.146.100, 10.0.136.2" x_forwarded_proto:"https" vcap_request_id:"7e0acbe6-2b0b-4d4c-5cd4-b39878f8369c" response_time:0.034361005 app_id:"6a6ee132-1c31-40b3-bb45-098ce441ecde" app_index:"0" x_b3_traceid:"e11dc7908395d90a" x_b3_spanid:"e11dc7908395d90a" x_b3_parentspanid:"-"
   2018-05-03T14:05:17.67+0530 [RTR/0] OUT

cf logs --recent exchangerate

   2018-05-03T14:05:17.68+0530 [RTR/2] OUT exchangerate-i038900trial.cfapps.sap.hana.ondemand.com - [2018-05-03T08:35:17.676+0000] "GET /index.html HTTP/1.1" 404 0 0 "https://i038900trial.authentication.sap.hana.ondemand.com/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "10.0.136.4:55766" "10.0.138.31:62268" x_forwarded_for:"203.13.146.100, 10.0.136.2, 52.58.183.15, 10.0.136.4" x_forwarded_proto:"https" vcap_request_id:"89b449c3-c177-4720-4639-c06e7c067c15" response_time:0.003352738 app_id:"2a48d2f8-b417-4a4f-b380-931f55cd2bf5" app_index:"0" x_b3_traceid:"e11dc7908395d90a" x_b3_spanid:"e11dc7908395d90a" x_b3_parentspanid:"-"
   2018-05-03T14:05:17.68+0530 [RTR/2] OUT
Alexander Dümont
  • 903
  • 1
  • 5
  • 9
Arun
  • 61
  • 1
  • 3
  • “only when I make the backend service secure”. Could you please elaborate? Also, when you say doesn’t launch, I assume you mean the service hasn’t started. Does the service create any logs? What do they say? – Timir May 01 '18 at 03:33
  • In the blog https://blogs.sap.com/2017/07/18/step-7-with-sap-s4hana-cloud-sdk-secure-your-application-on-sap-cloud-platform-cloudfoundry/, it works till the steps before "securing the backend microservice". Post that when i login I get the HTTP 404 error as mentioned in the earlier screen shot. Both services (approuter and backend microservice are already uploaded though). – Arun May 01 '18 at 03:40
  • This is something you will need to debug further. There’s no readymade answer, because one or more of several issues could have occurred. When debugging, you will want to check if your application server is reachable from your laptop or wherever your browser is running. Does ping work? Has the application started listening on port 443? Does the application stop after running for a while? Do the application logs say port conflict or configuration error? – Timir May 01 '18 at 03:51
  • Please issue a `cf logs --recent ` after you called your URL and post it here. Please make sure you remove any sensitive information from the log beforehand. – Philipp Herzig May 02 '18 at 09:09
  • Thanks for posting the logs. Could you please double check that there is really no exception in the log after calling the application? Furthermore, please share your routes and manifest.yml for the exchangerate microservice. – Philipp Herzig May 08 '18 at 22:04

1 Answers1

1

After stumbling over this issue with another user having the same symptoms, my current answer would be that the Spring security dependencies do not fit to each other in the pom.xml of the protected application. For example, the use of the dependencies as described in the blog throw a java.lang.NoClassDefFoundError:org/springframework/core/KotlinDetector upon classloading with Spring version 0.28.6 but they work fine with 0.27.*.

Therefore, please make sure to use the dependencies as described in the blog or add/update the missing/other dependencies as well.

Philipp Herzig
  • 350
  • 6
  • 10