title: EC2 API Error validating access credential
body: <p>I installed the ec2 api following the amazon guide. I setted up the access id and secret as environment variable.</p>
  
  <p>Here it is my profile:</p>
  
  <blockquote>
    <p>export AWS_ACCESS_KEY=XXXXX </p>
    
    <p>export AWS_SECRET_KEY=XXXXXX </p>
    
    <p>export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre </p>
    
    <p>export EC2_HOME=/usr/local/ec2/ec2-api-tools-1.7.1.0  </p>
    
    <p>export PATH=$PATH:$EC2_HOME/bin</p>
  </blockquote>
  
  <p>Everythings looks configured as asked, but i can't connect to aws.</p>
  
  <p>Here the output of the command ec2-describe-regions in verbose mode:</p>
  
  <pre><code>Client.AuthFailure: AWS was not able to validate the provided access credentials
  ubuntu@ip:~$ ec2dre -v
  Setting User-Agent to [ec2-api-tools 1.7.1.0]
  2014-07-14 19:10:34,898 [main] DEBUG org.apache.http.wire  - &gt;&gt; "POST / HTTP/1.1[\r][\n]"
  2014-07-14 19:10:34,912 [main] DEBUG org.apache.http.wire  - &gt;&gt; "Host: ec2.amazonaws.com[\r][\n]"
  2014-07-14 19:10:34,912 [main] DEBUG org.apache.http.wire  - &gt;&gt; "X-Amz-Date: 20140714T191033Z[\r][\n]"
  2014-07-14 19:10:34,913 [main] DEBUG org.apache.http.wire  - &gt;&gt; "Authorization: AWS4-HMAC-SHA256 Credential=AKIAIT64V5MH2HHF5QZQ/20140714/us-east-1/ec2/aws4_request, SignedHeaders=host;user-agent;x-amz-date, Signature=06920c7d37a24d8244feb630d87310238886294d3ae2ab40f68a362a799d9a62[\r][\n]"
  2014-07-14 19:10:34,913 [main] DEBUG org.apache.http.wire  - &gt;&gt; "User-Agent: ec2-api-tools 1.7.1.0, aws-sdk-java/unknown-version Linux/3.2.0-36-virtual OpenJDK_64-Bit_Server_VM/24.51-b03[\r][\n]"
  2014-07-14 19:10:34,913 [main] DEBUG org.apache.http.wire  - &gt;&gt; "Content-Type: application/x-www-form-urlencoded; charset=utf-8[\r][\n]"
  2014-07-14 19:10:34,913 [main] DEBUG org.apache.http.wire  - &gt;&gt; "Content-Length: 41[\r][\n]"
  2014-07-14 19:10:34,913 [main] DEBUG org.apache.http.wire  - &gt;&gt; "Connection: Keep-Alive[\r][\n]"
  2014-07-14 19:10:34,913 [main] DEBUG org.apache.http.wire  - &gt;&gt; "[\r][\n]"
  2014-07-14 19:10:34,914 [main] DEBUG org.apache.http.wire  - &gt;&gt; "Action=DescribeRegions&amp;Version=2014-06-15"
  2014-07-14 19:10:34,984 [main] DEBUG org.apache.http.wire  - &lt;&lt; "HTTP/1.1 401 Unauthorized[\r][\n]"
  2014-07-14 19:10:35,002 [main] DEBUG org.apache.http.wire  - &lt;&lt; "Transfer-Encoding: chunked[\r][\n]"
  2014-07-14 19:10:35,003 [main] DEBUG org.apache.http.wire  - &lt;&lt; "Date: Mon, 14 Jul 2014 19:18:34 GMT[\r][\n]"
  2014-07-14 19:10:35,003 [main] DEBUG org.apache.http.wire  - &lt;&lt; "Server: AmazonEC2[\r][\n]"
  2014-07-14 19:10:35,010 [main] DEBUG org.apache.http.wire  - &lt;&lt; "[\r][\n]"
  2014-07-14 19:10:35,225 [main] DEBUG org.apache.http.wire  - &lt;&lt; "fe[\r][\n]"
  2014-07-14 19:10:35,225 [main] DEBUG org.apache.http.wire  - &lt;&lt; "&lt;?xml version="1.0" encoding="UTF-8"?&gt;[\n]"
  2014-07-14 19:10:35,225 [main] DEBUG org.apache.http.wire  - &lt;&lt; "&lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;AuthFailure&lt;/Code&gt;&lt;Message&gt;AWS was not able to validate the provided access credentials&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;&lt;RequestID&gt;cd2b128b-3d70-425b-a8a7-4856fd9a6b99&lt;/RequestID&gt;&lt;/Response&gt;"
  2014-07-14 19:10:35,278 [main] DEBUG org.apache.http.wire  - &lt;&lt; "[\r][\n]"
  2014-07-14 19:10:35,279 [main] DEBUG org.apache.http.wire  - &lt;&lt; "0[\r][\n]"
  2014-07-14 19:10:35,279 [main] DEBUG org.apache.http.wire  - &lt;&lt; "[\r][\n]"
  Client.AuthFailure: AWS was not able to validate the provided access credentials
  Request ID: cd2b128b-3d70-425b-a8a7-4856fd9a6b99
  </code></pre>