Symptom
When creating a new connection type "SAP Fieldglass" in SAP Datasphere, error occurs:
Connection "Connection_name" couldn’t be established.
- Data flows can’t be used because of errors in the connection.
- Remote tables can’t be used because of errors in the connection.
Data Flows: Cause: [CloudDataIntegration] Cannot connect to service, because Failed to fetch OAuth2 token! Token endpoint response HTTP/1.1 401
Remote Tables: internal error: Cannot get remote source objects: Could not get tables, Code: 403, SQL State: HY000
Environment
SAP Datasphere
Reproducing the Issue
In DPAgent framework trace, more details about the error are found:
"20XX-XX-XX XX:XX:XX.XXX000000","ERROR","[xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx] Resource | CommonUtilities.logLongString [] - Error occured with URL https://WRONG_URL_ENTERED/api/data_hub/Namespaces","framework.trc"
"2024-XX-XX XX:XX:XX.XXX000000","ERROR","[xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx] DPFramework | WorkerThread.processRequest [] - com.sap.hana.dp.adapter.sdk.AdapterException: org.apache.olingo.client.core.http.OAuth2Exception: Failed to fetch OAuth2 token! Token endpoint response HTTP/1.1 401 Context: org.apache.olingo.client.api.http.HttpClientException: org.apache.olingo.client.core.http.OAuth2Exception: Failed to fetch OAuth2 token! Token endpoint response HTTP/1.1 401 at com.sap.hana.dp.dh.clouddataintegrationadapter.odata.Resource.readEntities(Resource.java:629) at com.sap.hana.dp.dh.clouddataintegrationadapter.odata.Namespaces.getNamespaces(Namespaces.java:35) at com.sap.hana.dp.dh.clouddataintegrationadapter.CloudDataIntegrationSystem.browseNamespaces(CloudDataIntegrationSystem.java:253) at com.sap.hana.dp.dh.clouddataintegrationadapter.CloudDataIntegrationSystem.handleNamespaceCase(CloudDataIntegrationSystem.java:269) at com.sap.hana.dp.dh.clouddataintegrationadapter.CloudDataIntegrationSystem.browse(CloudDataIntegrationSystem.java:217) at com.sap.hana.dp.dh.clouddataintegrationadapter.CloudDataIntegrationAdapter.browseAllNodesFromSystem(CloudDataIntegrationAdapter.java:501) at com.sap.hana.dp.dh.clouddataintegrationadapter.CloudDataIntegrationAdapter.browseMetadata(CloudDataIntegrationAdapter.java:445) at com.sap.hana.dp.adapter.sdk.decorator.AdapterCDCDelegate.browseMetadata(AdapterCDCDelegate.java:78) at com.sap.hana.dp.adapter.framework.core.WorkerThread.processBrowse(WorkerThread.java:1819) at com.sap.hana.dp.adapter.framework.core.WorkerThread.processRequest(WorkerThread.java:281) at com.sap.hana.dp.adapter.framework.core.WorkerThread.run(Worke...","framework.trc"
Cause
API URL is not reachable.
It needs to be adjusted as per Fieldglass URL.
Resolution
Follow steps shared in community blog post: SAP Fieldglass connection in SAP DWC
The report created in Fieldglass needs to be published in SAP Fieldglass Datahub the correct component for this is BNS-FG-REP-WEB. Open a ticket with BNS-FG-REP-WEB to get the report published. The email address fieldglasspmosupport@sap.com is obsolete.
Make sure to:
- Adjust and enter SAP Fieldglass API URL. For instance: https://<SAP Fieldglass domain URL>/api/data_hub
- Select OAuth Grant Type: Client Credentials
- Adjust and enter OAuth Token Endpoint. For instance: https://<SAP Fieldglass domain URL>/api/oauth2/v2.0/token?grant_type=client_credentials&response_type=token
- Use OAuth Response Type: token
- Use OAuth Token Request Content Type: JSON
- Enter Client ID by copying Username generated in Fieldglass
- Enter Client Secret by copying License generated in Fieldglass
See Also
- SAP Datasphere Help Portal SAP Fieldglass Connections
- SAP Datasphere Help Portal Prepare Connectivity to SAP Fieldglass
Keywords
Fieldglass, report, Datasphere , KBA , DS-DI-CON , Connections , Known Error