{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-java/issues/360","labels_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/360/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/360/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/360/events","html_url":"https://github.com/aws/aws-sdk-java/issues/360","id":58066995,"number":360,"title":"S3 V4 Signatures Frankfurt getObjectMetadata","user":{"login":"adrianbk","id":1910629,"avatar_url":"https://avatars.githubusercontent.com/u/1910629?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianbk","html_url":"https://github.com/adrianbk","followers_url":"https://api.github.com/users/adrianbk/followers","following_url":"https://api.github.com/users/adrianbk/following{/other_user}","gists_url":"https://api.github.com/users/adrianbk/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianbk/subscriptions","organizations_url":"https://api.github.com/users/adrianbk/orgs","repos_url":"https://api.github.com/users/adrianbk/repos","events_url":"https://api.github.com/users/adrianbk/events{/privacy}","received_events_url":"https://api.github.com/users/adrianbk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-18T13:24:34Z","updated_at":"2015-02-18T22:47:48Z","closed_at":null,"body":"Is there something different about AmazonS3Client.getObjectMetadata(..) such that V4 signatures are not being sent for HEAD requests?\r\n\r\nI'm using the following code to verify that I can interact with buckets in all regions without setting specific region endpoints but it fails on `getObjectMetadata` for the  EU_Frankfurt region. The strange thing is that only getObjectMetadata fails - creating a bucket, deleting a bucket, get and put work fine. \r\n\r\nI've tried 'SDKGlobalConfiguration.ENABLE_S3_SIGV4_SYSTEM_PROPERTY' but no difference. \r\n\r\nStacktrace below. \r\n\r\nSDK versions: 1.9.19 &1.9.20\r\n```groovy\r\n      AmazonS3Client amazonS3Client = new AmazonS3Client(basicAWSCredentials)\r\n      (Region.values() - [Region.US_GovCloud, Region.CN_Beijing]).each { Region region ->\r\n        String bucketName = \"${BUCKET_NAME}-${region ?: region.name}\"\r\n\r\n        println(\"Creating bucket: ${bucketName}\")\r\n        CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName, region)\r\n        amazonS3Client.createBucket(createBucketRequest)\r\n\r\n        println \"-- uploading\"\r\n        InputStream inputStream = new FileInputStream(file)\r\n        ObjectMetadata metadata = new ObjectMetadata()\r\n        metadata.setContentLength(file.length())\r\n        PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, file.name, inputStream, metadata)\r\n        amazonS3Client.putObject(putObjectRequest)\r\n\r\n        //FAILING HERE FOR EU_Frankfurt\r\n        println \"------Getting object metadata\"\r\n        GetObjectMetadataRequest metadataRequest = new GetObjectMetadataRequest(bucketName,file.name)\r\n        ObjectMetadata objectMetadata = amazonS3Client.getObjectMetadata(metadataRequest)\r\n\r\n        println \"------Getting object\"\r\n        GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName, file.name)\r\n        getObjectRequest.setRange(0, 0);\r\n        S3Object object = amazonS3Client.getObject(getObjectRequest)\r\n        InputStream objectData = object.getObjectContent();\r\n        objectData.close();\r\n\r\n        println \"-- Deleting object\"\r\n        DeleteObjectRequest deleteObjectRequest = new DeleteObjectRequest(bucketName, putObjectRequest.getKey())\r\n        amazonS3Client.deleteObject(deleteObjectRequest)\r\n\r\n        println(\"Deleting bucket: ${bucketName}\")\r\n        DeleteBucketRequest deleteBucketRequest = new DeleteBucketRequest(bucketName)\r\n        amazonS3Client.deleteBucket(deleteBucketRequest)\r\n      }\r\n\r\n```\r\n\r\n\r\n```\r\nCreating bucket: testv4signatures-us-west-1\r\n-- uploading\r\n------Getting object metadata\r\n------Getting object\r\n-- Deleting object\r\nDeleting bucket: testv4signatures-us-west-1\r\nCreating bucket: testv4signatures-us-west-2\r\n-- uploading\r\n------Getting object metadata\r\n------Getting object\r\n-- Deleting object\r\nDeleting bucket: testv4signatures-us-west-2\r\nCreating bucket: testv4signatures-eu-west-1\r\n-- uploading\r\n------Getting object metadata\r\n------Getting object\r\n-- Deleting object\r\nDeleting bucket: testv4signatures-eu-west-1\r\nCreating bucket: testv4signatures-eu-central-1\r\n-- uploading\r\nFeb 19, 2015 12:06:34 AM com.amazonaws.services.s3.AmazonS3Client shouldRetryWithAuthParam\r\nWARNING: Attempting to re-send the request to testv4signatures-eu-central-1.s3-external-1.amazonaws.com with AWS V4 authentication. To avoid this warning in the future, please use region-specific endpoint to access buckets located in regions that require V4 signing.\r\n------Getting object metadata\r\n\r\ncom.amazonaws.services.s3.model.AmazonS3Exception: Bad Request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request; Request ID: 1AD4BF78493A5206), S3 Extended Request ID: 78CyvR+iqPNnh1/UQ/xM/DkcwTCwVtPniVLlvfMyj96djN6sFHh28KE+jFx0TWITDzezDW6+LzQ=\r\n\tat com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1077)\r\n\tat com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:725)\r\n\tat com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:460)\r\n\tat com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:295)\r\n\tat com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3736)\r\n\tat com.amazonaws.services.s3.AmazonS3Client.getObjectMetadata(AmazonS3Client.java:1027)\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-java/issues/comments/74965252","html_url":"https://github.com/aws/aws-sdk-java/issues/360#issuecomment-74965252","issue_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/360","id":74965252,"user":{"login":"adrianbk","id":1910629,"avatar_url":"https://avatars.githubusercontent.com/u/1910629?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianbk","html_url":"https://github.com/adrianbk","followers_url":"https://api.github.com/users/adrianbk/followers","following_url":"https://api.github.com/users/adrianbk/following{/other_user}","gists_url":"https://api.github.com/users/adrianbk/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianbk/subscriptions","organizations_url":"https://api.github.com/users/adrianbk/orgs","repos_url":"https://api.github.com/users/adrianbk/repos","events_url":"https://api.github.com/users/adrianbk/events{/privacy}","received_events_url":"https://api.github.com/users/adrianbk/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T22:47:48Z","updated_at":"2015-02-18T22:47:48Z","body":"Thanks @david-at-aws @hansonchar \r\n\r\nI 'm planning on using virtual-hosted–style urls so that things just work without having to explicitly specify where the bucket resides. i.e. relying on the \"complicated dance to try to figure out what region the bucket is in and then retry the request with a V4 signature\". For now I can avoid using getObjectMetadata and instead do a lightweight getObject (request.setRange(0, 0))\r\n"}}