1

I am using the Java SDK 2 (version 2.17.51), and when attempting a simple listContacts request, I get the following:

software.amazon.awssdk.services.sesv2.model.SesV2Exception: 
The request signature we calculated does not match the 
signature you provided. Check your AWS Secret Access Key 
and signing method. Consult the service documentation for 
details.

This same key works fine when calling getContact, and is also used with other modules (e.g. S3) without problems, and the associated user has "Full Access" for SES. If I just remove the credentials, I get a different error (software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from any of the providers) so finding the credentials doesn't seem to be the issue.

EDIT: adding the code (Scala)


    val client = sesv2.SesV2Client.builder()
      .region(Region.US_EAST_1)
      .build()

    val topic =
      TopicFilter.builder()
        .topicName("mytopic")
        .build()

    val filter =
      ListContactsFilter.builder()
        .topicFilter(topic)
        .build()

    val request = 
      ListContactsRequest.builder()
        .contactListName("mylist")
        .pageSize(10000)
        .filter(filter)
        .build()

    val contacts = client.listContacts(request).contacts
mitchus
  • 4,677
  • 3
  • 35
  • 70
  • please post your code – smac2020 Oct 02 '21 at 21:50
  • @smac2020 updated. It's plain scala code, no fancy implicits or anything – mitchus Oct 03 '21 at 11:29
  • @mitchus did you ever solve this? Having the exact same issue. Created a question here https://stackoverflow.com/questions/73059306/how-to-fix-aws-403-error-check-your-aws-secret-access-key-and-signing-method-w. Would greatly appreciate a solution if you found one! – After_Sunset Jul 24 '22 at 11:08
  • @After_Sunset no, I had an open ticket with aws support for months, but it never got solved. – mitchus Jul 25 '22 at 15:57
  • @mitchus got it thank u for reply. I also opened a ticket. Thats pretty sad, this seems like critical functionality. I know it is for me at least. – After_Sunset Jul 25 '22 at 19:17
  • How did you end up going about listing out your contacts? – After_Sunset Jul 27 '22 at 00:33
  • @After_Sunset If I remember correctly, I used the async version instead, which did not suffer from this issue – mitchus Jul 27 '22 at 20:22

0 Answers0