Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with DynamoDB ScanAsync with blazor wasm (.net 8) #3549

Closed
1 task
saikabade opened this issue Nov 12, 2024 · 6 comments
Closed
1 task

Problem with DynamoDB ScanAsync with blazor wasm (.net 8) #3549

saikabade opened this issue Nov 12, 2024 · 6 comments
Labels
bug This issue is a bug. dynamodb module/blazor p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@saikabade
Copy link

saikabade commented Nov 12, 2024

Describe the bug

Unable to fetch dynamoDb table records, getting the error: 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.

Tried various options of passing the accessId and secret with no luck. The exact same code works fine if the project type is changed to either Blazor Web app or Blazor Server.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

fetching records from a dynamoDb table should work in a blazor webAssembly project

Current Behavior

Created a simple Blazor WebAssembly project and tried to connect to aws dynamoDb to fetch records from a dynamoDb table. When executing await client.ScanAsync(request); error is thrown: 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.

Reproduction Steps

  1. Create a new project of type Blazor WebAssembly.
  2. Add nuget package AWSSDK.DynamoDBv2 version 3.7.401.3
  3. write code to connect and fetch the data:
 AmazonDynamoDBClient client = new AmazonDynamoDBClient(awsUSerID,awsSecret, Amazon.RegionEndpoint.USEast1);
 
 AmazonDynamoDBConfig config = new AmazonDynamoDBConfig() { SignatureVersion = "s3v4"};
 // Define the table name
 string tableName = "Employees";
 List<Employee> listOfOnHoldEmails = new List<Employee>();
 
 string filterExpression = "attribute_exists(#attrName2) AND #attrName2 = :attrValue";
 ScanRequest request = new ScanRequest
 {
     TableName = tableName,
     ExpressionAttributeNames = new Dictionary<string, string>
     {
         { "#attrName1", "Id" },
         { "#attrName2", "Name" },
         
     },
     ExpressionAttributeValues = new Dictionary<string, AttributeValue>
     {
         { ":attrValue", new AttributeValue { S = "testVal" } }
     },
     FilterExpression = filterExpression,
     ProjectionExpression = "#attrName1, #attrName2"
 };            

 try
 {
     var response = await client.ScanAsync(request);
     }
     catch(exception ex){
     
     }

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK.DynamoDBv2 3.7.401.3

Targeted .NET Platform

.Net 8

Operating System and version

Windows 10

@saikabade saikabade added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 12, 2024
@github-actions github-actions bot added the potential-regression Marking this issue as a potential regression to be checked by team member label Nov 12, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Nov 12, 2024

@saikabade Good afternoon. You mentioned that this issue is a potential regression. Could you please share if:

  • Your use case was working when using any previous versions of AWSSDK.DynamoDBv2 package?
  • Could you try reproducing the issue with with a normal console application?
  • Please share the minimal self-contained reproducible code with all the model classes used.

We also had previous issue #1895 related to Blazor. Unsure if it is related.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 12, 2024
@Decavoid
Copy link
Contributor

Try setting AWSConfigs.UseAlternateUserAgentHeader = true;

@ashishdhingra
Copy link
Contributor

Try setting AWSConfigs.UseAlternateUserAgentHeader = true;

@Decavoid Thanks for pointing it out. @saikabade Please review.

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Nov 12, 2024
@github-actions github-actions bot removed the potential-regression Marking this issue as a potential regression to be checked by team member label Nov 12, 2024
@dscpinheiro dscpinheiro changed the title Problem with DynamoDB ScanAsync with blazor wasm (.net 8) "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.." Problem with DynamoDB ScanAsync with blazor wasm (.net 8) Nov 14, 2024
@saikabade
Copy link
Author

@saikabade Good afternoon. You mentioned that this issue is a potential regression. Could you please share if:

  • Your use case was working when using any previous versions of AWSSDK.DynamoDBv2 package?
  • Could you try reproducing the issue with with a normal console application?
  • Please share the minimal self-contained reproducible code with all the model classes used.

We also had previous issue #1895 related to Blazor. Unsure if it is related.

Thanks, Ashish

Hi @ashishdhingra, apologies for the delay. No I cannot reproduce this with a simple console App. I can see it in a Blazor WASM project. Because the issue was happening with a Blazor WASM type project, I switched to Blazor Server application, and the issue was resolved, but the joy was not so long, it worked in the local and in the dev environment and failed in the QA. So, in the QA environment I've started seeing the same error in the openshift pod logs: Unhandled exception rendering component: 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.
Amazon.DynamoDBv2.AmazonDynamoDBException: 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.

@saikabade
Copy link
Author

Try setting AWSConfigs.UseAlternateUserAgentHeader = true;

@Decavoid Thanks for pointing it out. @saikabade Please review.

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. dynamodb module/blazor p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants