Skip to main content

Troubleshooting Guide: EC_Request: Failed to requestNetwork \/ HTTP Client

Distributor troubleshooting for 'EC_Request: Failed to requestNetwork' HTTP client errors in Encompass API calls: check network, URL, CORS/API Origins and tokens. v26.01+; API Edit permission to edit origins.

B
Written by Bailey Naas-Thornton

Minimum Version Required: 26.01

Pre-Conditions

  • Must have an active and stable internet connection.

  • Must be using a supported web browser or making an HTTP request via the Encompass SDK/Client.

  • Must have Solution Authentications and API Edit permissions if modifying API Origins.

Steps

  • Verify Network Connectivity: Check for any general network routing failures or packet loss that might be preventing the connection.

  • Validate the Endpoint URL: Confirm that the target endpoint URL is valid, properly formatted, and currently reachable.

  • Check Browser CORS and Security Policies: If the request is being blocked by browser CORS or security content policy restrictions, verify that the external domain making the request has been explicitly allowed. You must add records to the API Origins table under your Application to allow external JavaScript requests.

  • Verify Authentication Tokens: Ensure the authentication bearer token (or API Token) is included in the request, is properly formed, and has not prematurely expired.

  • Monitor Timeout Limits: Check if the HTTP request is timing out before receiving external headers. You may need to increase timeout allowances or investigate backend latency.

  • Inspect Backend Responses: Confirm that the backend system is returning a valid response and not an unparseable or corrupted payload.

  • Contact Support: If the issue persists after completing the above steps, please contact support and provide the following information:

    • Exact error messages or codes encountered.

    • Screenshots or video recordings of the issue (e.g., browser console errors or network tab details).

    • Log files (specify Load Balancer Logs or application network logs if applicable).

    • The exact steps taken by the customer that led to the issue.

    • The date and time the issue was first observed and any recurrence.

    • Any changes made to the system (e.g., API parameter updates, updated tokens) before the issue appeared.

Fields And Definitions

  • CORS (Cross-Origin Resource Sharing): A browser security feature that dictates that JavaScript on a page cannot make a request to a different domain unless the receiving domain explicitly allows it.

  • API Origins: A table in Encompass where API builders add records to authorize specific external domains to communicate with their Encompass API Commands.

  • Endpoint URL: The specific web address or destination that the HTTP client is attempting to reach.

  • Bearer Token: A security key or token used in the HTTP headers to authenticate the request and prove the identity of the caller.

Best Practices

  • Test with API Clients: Before embedding HTTP requests in code, test the target endpoint URL and authentication tokens using a dedicated API client (like Postman) to isolate the connection.

  • Manage API Origins: Remember that by default, if no API Origins are created, only requests from the same Encompass domain are allowed to the API Commands. Add necessary domains proactively during setup.

  • Token Lifecycle Management: Implement a process to regularly rotate and refresh authentication tokens to prevent sudden expiration failures in production environments.

Did this answer your question?