sap-tutorials / Issues

Creative Commons Attribution 4.0 International
6 stars 4 forks source link

CAP application with Principal Propagation Destination connection timeout in local run #708

Closed ubheamar closed 1 year ago

ubheamar commented 2 years ago

CAP application with Principal Propagation Destination issue in local run

Hello Team,

I am trying to consume external OData service from the Solution Manager. I am able to consume this external service in the CAP application but it's working from BTP only(after deploying the application on BTP) not locally.

I am getting a connection timeout error for a local run but in BTP external service connection is working fine. I am using the below architecture.

image

error: 'Error during request to remote service: \n' + 'connect ETIMEDOUT 52.86.131.53:20003 error logs:

`cds watch --profile hybrid

cds serve all --with-mocks --in-memory? --profile hybrid watching: cds,csn,csv,ts,mjs,cjs,js,json,properties,edmx,xml,env,css,gif,html,jpg,png,svg... live reload enabled for browsers [bind] - resolving cloud service bindings... [bind] - bound db to Cloud Foundry service deliverydashboard-hdi key deliverydashboard-hdi-key [bind] - bound auth to Cloud Foundry service deliverydashboard-auth key default [bind] - bound connectivity to Cloud Foundry service connect-service key default [bind] - bound destination to Cloud Foundry service dest-service key default

    ___________________________

[cds] - Loading server from { file: 'srv\server.js' } [HPM] Proxy created: / -> http://localhost:4004 [HPM] Proxy rewrite rule created: "^/v2" ~> "" [cds] - model loaded from 6 file(s):

db\data-model.cds srv\cat-service.cds app\services.cds srv\external\ZCDD_CAS_DELIVERY_DASHBOARD.csn node_modules\@sap\cds\common.cds app\dashboard\annotations.cds

[cds] - connect using bindings from: { registry: '~/.cds-services.json' } [cds] - connect to db > hana { database: 'sqlite.db',
database_id: 'df310bd6-4269-4481-b0cd-3f2e8a72b8b4', host: 'df310bd6-4269-4481-b0cd-3f2e8a72b8b4.hana.trial-us10.hanacloud.ondemand.com', port: '443', driver: 'com.sap.db.jdbc.Driver', url: 'jdbc:sap://df310bd6-4269-4481-b0cd-3f2e8a72b8b4.hana.trial-us10.hanacloud.ondemand.com:443?encrypt=true&validateCertificate=true&currentschema=0318FAE5D0BA4F7D9C41E623C57AA66E', schema: '0318FAE5D0BA4F7D9C41E623C57AA66E',

} [cds] - connect to ZCDD_CAS_DELIVERYDASHBOARD > odata-v2 { destination: 'es', path: '/sap/opu/odata/sap/ZCDD_CAS_DELIVERY_DASHBOARD_SRV', forwardAuthToken: true, requestTimeout: 30000 } [cds] - serving CatalogService { path: '/catalog', impl: 'srv\cat-service.js' }

[cds] - server listening on { url: 'http://localhost:4004' } [cds] - launched at 9/23/2022, 10:52:00 PM, in: 1.714s [cds] - [ terminate with ^C ]

[cds] - GET /catalog/ValueHelp [remote] - GET /sap/opu/odata/sap/ZCDD_CAS_DELIVERY_DASHBOARDSRV/ValueHelpSet?$top=1000&$orderby=FieldName%20asc,ID%20asc&$select=FieldName,ID,Value1,Value2,Value3 { headers: { accept: 'application/json,text/plain', 'accept-language': 'en-US,en;q=0.9', 'x-correlation-id': '53f97341-4bd4-477c-954c-f72b49a12422' }, data: undefined } [2022-09-23T17:22:07.133Z] INFO (register-destination): Successfully retrieved destination 'es' from registered destinations. [2022-09-23T17:22:10.367Z] INFO (register-destination): Successfully retrieved destination 'es_' from registered destinations. [remote] - Error: Error during request to remote service: connect ETIMEDOUT 52.86.131.53:20003 at run (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\remote\utils\client.js:297:31) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async RemoteService. (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\remote\Service.js:221:20) at async next (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:75:17) at async RemoteService.handle (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:73:10) at async RemoteService.handle (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\remote\Service.js:272:22)
at async next (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:75:17) at async CatalogService.handle (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:73:10) at async _readCollection (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\cds-services\adapter\odata-v4\handlers\read.js:264:19) at async C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\cds-services\adapter\odata-v4\handlers\read.js:470:16 { statusCode: 502, reason: AxiosError: connect ETIMEDOUT 52.86.131.53:20003 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:130:17) { port: 20003, address: '52.86.131.53', syscall: 'connect', code: 'ETIMEDOUT', errno: -4039, message: 'Error during request to remote service: \n' + 'connect ETIMEDOUT 52.86.131.53:20003', config: { timeout: 30000, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, proxy: false, method: 'get', baseURL: 'http://xxxx.sap.corp:443', url: '/sap/opu/odata/sap/ZCDD_CAS_DELIVERY_DASHBOARD_SRV/ValueHelpSet?$top=1000&$orderby=FieldName%20asc,ID%20asc&$select=FieldName,ID,Value1,Value2,Value3', data: undefined }, request: { method: 'GET', url: 'http://xxxxx.sap.corp:443/sap/opu/odata/sap/ZCDD_CAS_DELIVERY_DASHBOARD_SRV/ValueHelpSet?$top=1000&$orderby=FieldName%20asc,ID%20asc&$select=FieldName,ID,Value1,Value2,Value3', headers: { Accept: 'application/json,text/plain', 'SAP-Connectivity-Authentication': 'Bearer xxx', 'Proxy-Authorization': 'Bearer xxx', 'sap-client': '100', 'accept-language': 'en-US,en;q=0.9', 'x-correlation-id': '53f97341-4bd4-477c-954c-f72b49a12422', 'User-Agent': 'axios/0.27.2' } }, correlationId: '53f97341-4bd4-477c-954c-f72b49a12422' } } [cds] - Error: Error during request to remote service: connect ETIMEDOUT 52.86.131.53:20003 at run (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\remote\utils\client.js:297:31) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async RemoteService. (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\remote\Service.js:221:20) at async next (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:75:17) at async RemoteService.handle (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:73:10) at async RemoteService.handle (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\remote\Service.js:272:22)
at async next (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:75:17) at async CatalogService.handle (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\lib\srv\srv-dispatch.js:73:10) at async _readCollection (C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\cds-services\adapter\odata-v4\handlers\read.js:264:19) at async C:\Amar\Projects\CAPM\deliverydashboard\node_modules\@sap\cds\libx_runtime\cds-services\adapter\odata-v4\handlers\read.js:470:16 { statusCode: 502, reason: AxiosError: connect ETIMEDOUT 52.86.131.53:20003 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:130:17) { port: 20003, address: '52.86.131.53', syscall: 'connect', code: 'ETIMEDOUT', errno: -4039, message: 'Error during request to remote service: \n' + 'connect ETIMEDOUT 52.86.131.53:20003', config: { timeout: 30000, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, proxy: false, method: 'get', baseURL: 'http://xxxx.xxx.sap.corp:443', url: '/sap/opu/odata/sap/ZCDD_CAS_DELIVERY_DASHBOARD_SRV/ValueHelpSet?$top=1000&$orderby=FieldName%20asc,ID%20asc&$select=FieldName,ID,Value1,Value2,Value3', data: undefined }, request: { method: 'GET', url: 'http://xxxxx.xxxw.sap.corp:443/sap/opu/odata/sap/ZCDD_CAS_DELIVERY_DASHBOARD_SRV/ValueHelpSet?$top=1000&$orderby=FieldName%20asc,ID%20asc&$select=FieldName,ID,Value1,Value2,Value3', headers: { Accept: 'application/json,text/plain', 'SAP-Connectivity-Authentication': 'Bearer xxx', 'Proxy-Authorization': 'Bearer xxx', 'sap-client': '100', 'accept-language': 'en-US,en;q=0.9', 'x-correlation-id': '53f97341-4bd4-477c-954c-f72b49a12422', 'User-Agent': 'axios/0.27.2' } }, correlationId: '53f97341-4bd4-477c-954c-f72b49a12422' }, id: '1972045', level: 'ERROR', timestamp: 1663953752530 }`

can anyone help me with this connection? @jung-thomas can you please help me with this issue? I already spent a lot of time.

ubheamar commented 2 years ago

image

ubheamar commented 2 years ago

I followed this note https://launchpad.support.sap.com/#/notes/0003112360 now it's working with BAS local as well. but not working my pc visual studio

MichaelCzcz commented 1 year ago

These GitHub issues are to resolve issues (i.e., problems/errors) with the tutorials. Your question seems more general and likely would get more visibility -- and a better answer -- in the SAP Community's Questions & Answers. You can ask your question at: https://answers.sap.com/index.html This repository is also no longer monitored. If you have an issue with a tutorial, please use the "Feedback" function. Thank you.