UnknownHostException when running stream enrich


#1

Hey,

I am running on AWS and have setup stream enrich but when I run it using:

./snowplow-stream-enrich-0.10.0 --config stream-enrich-config --resolver file:resolver.json

I get this exception:

Exception in thread “main” java.net.UnknownHostException: ip-xx-xx-xx-xx: ip-xx-xx-xx-xx: unknown error
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at com.snowplowanalytics.snowplow.enrich.kinesis.sources.KinesisSource.run(KinesisSource.scala:81)
at com.snowplowanalytics.snowplow.enrich.kinesis.KinesisEnrichApp$delayedInit$body.apply(KinesisEnrichApp.scala:188)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at com.snowplowanalytics.snowplow.enrich.kinesis.KinesisEnrichApp$.main(KinesisEnrichApp.scala:71)
at com.snowplowanalytics.snowplow.enrich.kinesis.KinesisEnrichApp.main(KinesisEnrichApp.scala)
Caused by: java.net.UnknownHostException: ip-xx-xx-xx-xx: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)


#2

Found the solution I had to vim /etc/hosts
And add the line
xx.xx.xx.xx ip-xx-xx-xx-xx localhost