aws S3 400 Bad Request
<p>I'm attempting to narrow down the following 400 Bad Request error:</p>

<pre><code>com.amazonaws.services.s3.model.AmazonS3Exception: Bad Request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request; Request ID: 7FBD3901B77A07C0), S3 Extended Request ID: +PrYXDrq9qJwhwHh+DmPusGekwWf+jmU2jepUkQX3zGa7uTT3GA1GlmHLkJjjjO67UQTndQA9PE=
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1343)
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:961)
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:738)
    at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:489)
    at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:448)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:397)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:378)
    at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4039)
    at com.amazonaws.services.s3.AmazonS3Client.getObjectMetadata(AmazonS3Client.java:1177)
    at com.amazonaws.services.s3.AmazonS3Client.getObjectMetadata(AmazonS3Client.java:1152)
    at com.amazonaws.services.s3.AmazonS3Client.doesObjectExist(AmazonS3Client.java:1212)
    at com.abcnews.apwebfeed.articleresolver.APWebFeedArticleResolverImpl.makeS3Crops(APWebFeedArticleResolverImpl.java:904)
    at com.abcnews.apwebfeed.articleresolver.APWebFeedArticleResolverImpl.resolve(APWebFeedArticleResolverImpl.java:542)
    at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:54)
    at org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessage(ServiceInvocationHandler.java:322)
    at org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:86)
    at java.lang.Thread.run(Thread.java:662)
</code></pre>

<p>I'm testing something as imple as this:</p>

<pre><code>boolean exists = s3client.doesObjectExist("aws-wire-qa", "wfiles/in/wire.json");
</code></pre>

<p>I manually added the wfiles/in/wire.json file. I get back true when I run this line inside a local app. But inside a separate remote service it throws the error above. I use the same credentials inside the service as I use in my local app. I also set bucket as "Enable website hosting", but no difference. 
My permissions are set as: </p>

<pre><code>Grantee: Any Authenticated AWS User
y List 
y Upload/DeleteView 
y PermissionsEdit Permissions    
</code></pre>

<p>So I thought the error could be related to not having a policy on the bucket and created a policy file on the bucket for GET/PUT/DELETE objects, but I'm still getting the same error. My policy look like this:</p>

<pre><code>{
"Version": "2012-10-17",
"Id": "Policy1481303257155",
"Statement": [
    {
        "Sid": "Stmt1481303250933",
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::755710071517:user/law"
        },
        "Action": [
            "s3:DeleteObject",
            "s3:GetObject",
            "s3:PutObject"
        ],
        "Resource": "arn:aws:s3:::aws-wire-qa/*"
    }
]
}
</code></pre>

<p>I was told it can't be a firewall or a proxy issue. What else I could try? The error is very non-specific. And so far I did only local development, so I have no idea what else can be not set up here. Would much appreciate some help here.</p>