{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-java/issues/865","repository_url":"https://api.github.com/repos/aws/aws-sdk-java","labels_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/865/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/865/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/865/events","html_url":"https://github.com/aws/aws-sdk-java/issues/865","id":180709713,"number":865,"title":"InvalidSignatureException calling AWSLambda listFunctions aws-sdk-java/1.11.37","user":{"login":"davidmco65","id":16906571,"avatar_url":"https://avatars.githubusercontent.com/u/16906571?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmco65","html_url":"https://github.com/davidmco65","followers_url":"https://api.github.com/users/davidmco65/followers","following_url":"https://api.github.com/users/davidmco65/following{/other_user}","gists_url":"https://api.github.com/users/davidmco65/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmco65/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmco65/subscriptions","organizations_url":"https://api.github.com/users/davidmco65/orgs","repos_url":"https://api.github.com/users/davidmco65/repos","events_url":"https://api.github.com/users/davidmco65/events{/privacy}","received_events_url":"https://api.github.com/users/davidmco65/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-10-03T18:21:16Z","updated_at":"2016-10-04T21:22:36Z","closed_at":null,"body":"Hi, I'm getting \"Service: AWSLambda; Status Code: 403; Error Code: InvalidSignatureException;...\" error when trying to call listFunctions() using the Java SDK v1.11.37.\r\n\r\n```\r\n        // Create the credentials for all of the clients.\r\n        getLog().info(\"AccessKey: \" + AWSAccessKey);\r\n        BasicAWSCredentials awsCredentials = new BasicAWSCredentials(AWSAccessKey, AWSAccessKey);\r\n\r\n        // Create all of the needed clients.\r\n        getLog().info(\"Getting clients...\");\r\n        AWSLambdaClient lambdaClient = new AWSLambdaClient(awsCredentials);\r\n        AmazonS3Client s3Client = new AmazonS3Client(awsCredentials);\r\n       \tgetLog().info(\"Setting region\");\r\n       \tlambdaClient.setRegion(Region.getRegion(Regions.US_WEST_2));\r\n       \ts3Client.setRegion(Region.getRegion(Regions.US_WEST_2));\r\n        getLog().info(\"Done.\");\r\n        \r\n        // See if the function already exists\r\n        ListFunctionsResult lfRes = lambdaClient.listFunctions();\r\n        List<FunctionConfiguration> functions = lfRes.getFunctions();\r\n        for ( FunctionConfiguration function : functions )\r\n        {\r\n        \tgetLog().info(\"Found existing function: \" + function.getFunctionName());\r\n        }\r\n\r\n```\r\nI can see through logs that I'm providing a valid AccessKey & SecretKey to the AWSLambdaClient.  The listFunctions() call is the one that fails with that exception.\r\n\r\nAny thoughts/help?"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-java/issues/comments/251517732","html_url":"https://github.com/aws/aws-sdk-java/issues/865#issuecomment-251517732","issue_url":"https://api.github.com/repos/aws/aws-sdk-java/issues/865","id":251517732,"user":{"login":"varunnvs92","id":17261531,"avatar_url":"https://avatars.githubusercontent.com/u/17261531?v=3","gravatar_id":"","url":"https://api.github.com/users/varunnvs92","html_url":"https://github.com/varunnvs92","followers_url":"https://api.github.com/users/varunnvs92/followers","following_url":"https://api.github.com/users/varunnvs92/following{/other_user}","gists_url":"https://api.github.com/users/varunnvs92/gists{/gist_id}","starred_url":"https://api.github.com/users/varunnvs92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunnvs92/subscriptions","organizations_url":"https://api.github.com/users/varunnvs92/orgs","repos_url":"https://api.github.com/users/varunnvs92/repos","events_url":"https://api.github.com/users/varunnvs92/events{/privacy}","received_events_url":"https://api.github.com/users/varunnvs92/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T21:22:36Z","updated_at":"2016-10-04T21:22:36Z","body":"You have already provided this data in one of the previous [correspondence](https://github.com/aws/aws-sdk-java/issues/865#issuecomment-251197431). The data in the log you provided is what the service is expecting.\r\n\r\nBut if you enable wire logging and look at the logs, you will see something like this: \r\n\r\n```\r\nDEBUG com.amazonaws.request - Sending Request: GET https://lambda.us-west-2.amazonaws.com /2015-03-31/functions/ Headers: (User-Agent: aws-sdk-java/1.11.37 Mac_OS_X/10.11.6 Java_HotSpot(TM)_64-Bit_Server_VM/25.101-b13/1.8.0_101, amz-sdk-invocation-id: 5f57af8c-98b4-edc6-36a3-d3f49c5c7593, Content-Type: , ) \r\nDEBUG com.amazonaws.auth.AWS4Signer - AWS4 Canonical Request: '\"GET\r\n/2015-03-31/functions/\r\n\r\namz-sdk-invocation-id:5f57af8c-98b4-edc6-36a3-d3f49c5c7593\r\namz-sdk-retry:0/0/500\r\ncontent-type:\r\nhost:lambda.us-west-2.amazonaws.com\r\nuser-agent:aws-sdk-java/1.11.37 Mac_OS_X/10.11.6 Java_HotSpot(TM)_64-Bit_Server_VM/25.101-b13/1.8.0_101\r\nx-amz-date:20161004T211059Z\r\n\r\namz-sdk-invocation-id;amz-sdk-retry;content-type;host;user-agent;x-amz-date\r\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\r\n\r\nDEBUG com.amazonaws.auth.AWS4Signer - AWS4 String to Sign: '\"AWS4-HMAC-SHA256\r\n20161004T211059Z\r\n20161004/us-west-2/lambda/aws4_request\r\n7a186bdc82e4e2550e2f8e2d341eb31af20d88e1d761291b8db99387085f5e93\"\r\n```\r\n\r\nThis is the data what the SDK is sending to the service. My log says **\"AWS4 Canonical Request\"**(indicates request calculated by SDK) but yours says **\"The Canonical String for this request should have been\"**(request the service is expecting). So by comparing the SDK generated request and the request expected by service, we can see what data is different and try to find the reason for this error."}}
{"actor":{"display_login":"varunnvs92"}}