Unknown host exception from AWS Java client?

Does anyone else encounter this exception? We saw this during a stress test last night. The hostname is working properly and properly. It just started throwing this exception last night. Either it was a random DNS failure in the amanzon part, or the Aws SDK for Java does something unexpected at boot.

> Caused by: java.net.UnknownHostException: sdb.amazonaws.com at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:867) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1246) at java.net.InetAddress.getAllByName0(InetAddress.java:1197) at java.net.InetAddress.getAllByName(InetAddress.java:1128) at java.net.InetAddress.getAllByName(InetAddress.java:1064) at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:242) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:130) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:561) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:266) 
+4
source share
2 answers

Modify / etc / hosts as follows:
old
127.0.0.1 localhost localhost.localdomain
new
127.0.0.1 localhost localhost.localdomain add-your-localhost-name-here

+2
source

I encountered the same problem Caused by: java.net.UnknownHostException: ec2.sa-east-1.amazonaws.com when doing lein pallet up to upload files to aws bucket / or when trying to get ips of remote computers.

1. First try

The cleanup project Waiting for a few minutes / hours and then rebooting the lein pallet up -P aws-ec2 with the same aws configuration worked for me.

2. The second attempt,

Run lein pallet up -P aws-ec2 for single groups instead of the entire cluster.

0
source

Source: https://habr.com/ru/post/1401642/


All Articles