Request not sent to uri=url : java.net.UnknownHostException: api-gateway-ea-dev.americancentury.com

Pavan_Snow_1
Kilo Guru

Hello Community,

I am facing issue on integration. I had the implemented the Outbound integration(Oauth Type) with POST method.

Using Mid server sending data to third party system . Here instead of sending bulk data i am iterating the rest message for each 5 records.

for example if it has 50 records i am pushing to rest message on 10 times. But some reason after pushing few records i am getting below error.

Error

Request not sent to uri= https://api-gateway-ea-dev.instancename.com/ea-okta/users : java.net.UnknownHostException: api-gateway-ea-dev.instancename.com

 

 

1 REPLY 1

Mark Manders
Mega Patron

This is a hard one to trouble shoot, because it can be a lot of things. A response from a SN-GPT is below. Can you check on these, so we can at least limit the possible causes and pinpoint more?

 

The issue you're facing, where the request fails after pushing a few records and you receive an "UnknownHostException" error, can arise due to several factors when integrating with third-party systems via a MID server. Here's a breakdown of potential causes and troubleshooting steps:

 

1. DNS Resolution Issue
The "UnknownHostException" indicates that the MID server is unable to resolve the hostname `api-gateway-ea-dev.instancename.com`. This could be due to:

- **DNS Configuration**: The MID server might not have proper DNS configurations, and it's unable to resolve the domain name.
- **Solution**: Check the MID server's DNS settings to ensure that it can resolve external domains. You might need to add the DNS server address in the MID server's configuration file or check network configurations that might be blocking DNS requests.

 

 

2. Network Issues
The MID server might be losing connection intermittently, causing it to fail after sending some data.

- **Solution**:
- **Check MID Server logs**: Inspect the MID server logs for any warnings or errors related to connectivity.
- **Network Connectivity**: Ensure there are no firewalls or security groups that might be throttling or dropping connections after a certain threshold.
- **Proxy Configuration**: If the MID server is behind a proxy, ensure the proxy settings are correctly configured.

 

 

3. **MID Server Timeouts**
If you're sending records in batches, the connection might be timing out between requests, or the MID server might be overwhelmed with too many requests in a short period.

- **Solution**:
- **Increase Timeout**: Consider increasing the timeout settings in your REST Message API or the MID server configuration to allow longer wait times between batch requests.
- **Check Batch Processing**: Verify that the iteration logic you’re using to send data in batches is correctly spaced out, and there are no logic errors causing the process to crash after a few successful records.

 

 

4. **Host Misconfiguration**
The hostname `api-gateway-ea-dev.instancename.com` might be incorrect or unavailable intermittently.

- **Solution**:
- **Verify the Hostname**: Double-check that the hostname is correct and reachable from the network where the MID server resides.
- **Test Outside ServiceNow**: Test the hostname outside of ServiceNow using `ping` or `curl` from the machine where the MID server is installed. If the hostname cannot be resolved outside ServiceNow, the problem is likely with the network or DNS configuration.

 

 

 

5. **API Gateway Limits**
The third-party system (API gateway) could be limiting the number of requests or rate-limiting the connections.

- **Solution**: Contact the API provider to ensure that they are not rate-limiting requests from your MID server. If rate-limiting is in place, consider adding delays between requests or using a bulk push method if the API supports it.

 

 

Next Steps
- **MID Server Logs**: Check the MID server logs in the ServiceNow instance (`MID Server > Servers > <your MID server> > Logs`) for any network-related errors or timeouts.
- **Check API Logs**: If the third-party system provides logging or metrics for incoming requests, review them to see if it provides any clues on why the request might be failing after some records.

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark