Search code examples
dnsvirtualboxhortonworks-data-platformapache-nifi

UnknownHostException in Nifi GetHttp processor running inside VirtualBox (Hortonworks Sandbox)


I am trying to get data from the following URL: http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=sf-muni&r=M&t=0

I have configured Nifi (that is running on Oracle VirtualBox) GetHttp proccesor URL property to the aforementioned URL, however I am getting following exception:

Caused by: java.net.UnknownHostException: webservices.nextbus.com
  at java.net.InetAddress.getAllByName0(InetAddress.java:1280) ~[na:1.8.0_111]
  at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_111]
  at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_111]

I have used following command on both VM and Host machine.

nslookup webservices.nextbus.com

which outputs following on both VM and Host:

Non-authoritative answer: 
Name:    4yu7q.x.incapdns.net 
Address: 192.230.77.86 
Aliases:  webservices.nextbus.com

I am using Google DNS (inside /etc/resolv.conf I have following)

nameserver 8.8.8.8

Pinging webservices.nextbus.com is also successful

ping webservices.nextbus.com

Pinging 4yu7q.x.incapdns.net [192.230.77.86] with 32 bytes of data:
Reply from 192.230.77.86: bytes=32 time=15ms TTL=56
Reply from 192.230.77.86: bytes=32 time=14ms TTL=56

What could be the cause for the UnknownHostException and how to fix it?


Solution

  • DNS changes weren't picked up from resolv.conf file. Restarting NiFi fixed the issue.