Application call fails with "name or service not known" error
search cancel

Application call fails with "name or service not known" error

book

Article ID: 372288

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

A customer application was unable to make API calls to another application. Application (Java) logs show errors like the following:

Name or service not known [java.net.UnknownHostException: null: Name or service not known, at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method), 

...

...

reactor.core.Exceptions$ReactiveException: java.net.UnknownHostException: null: Name or service not known

Cause

Customer is attempting to call the app with a DNS name that is not mapped to the application route.

Resolution

The errors show that the name being used for the application is not recognized. If you are using the DNS name "dns-name.example.com", that must be mapped in DNS as a CNAME pointing to the route that is assigned to the app. The route can be retrieved using the "cf app <appname>" command.