400 Bad Request in AWS Dynamo DB as a Session Provider for ASP.NET

We use AWS DynamoDB Session Provider in our application to store session data.

I recently moved to an environment where I can track a NewRelic application, and it started throwing warnings about accessing the Dynamo database. However, NewRelic is the only monitoring tool that receives it. I do not see anything related to this problem in my application logging protocol (log4net) or in the Windows event viewer.

I searched a lot and even went through the source code of the provider, but it came out empty.

I get (400) A bad request from the fact that it seems that all calls made within 1 or 2 minutes at a time occurring 3 or 4 times per hour.

The stack I could get does not promise:

at System.Net.HttpWebRequest.GetResponse()
at System.Net.HttpWebRequest.GetResponse()
at Amazon.Runtime.AmazonWebServiceClient.getResponseCallback(IAsyncResult result)

URL-:

dynamodb.us-east-1.amazonaws.com/Stream/GetResponse

, ( 1), , , DynamoDB, 0 ( 1). , , ( 2).


:. Fiddler , , AWS. " ", , , , , . / .

:


POST https://dynamodb.us-east-1.amazonaws.com/ HTTP/1.1
X-Amz-Target: DynamoDB_20120810.UpdateItem
Content-Type: application/x-amz-json-1.0
User-Agent: aws-sdk-dotnet-35/2.0.15.0 .NET Runtime/4.0 .NET Framework/4.0 OS/6.2.9200.0 SessionStateProvider TableSync
Host: dynamodb.us-east-1.amazonaws.com
X-Amz-Date: 20140510T153947Z
X-Amz-Content-SHA256: e7a4886acac6ccf16f0da9be962d3a68bd50e381c202277033d0d2bb3208aa8a
Authorization: AWS4-HMAC-SHA256 Credential=redacted/20140510/us-east-1/dynamodb/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-target, Signature=redacted
Accept: application/json
X-NewRelic-ID: redacted
X-NewRelic-Transaction: redacted
Content-Length: 399

{
    "TableName": "ASP.NET_SessionState",
    "Key": {
        "SessionId": {
            "S": "redacted"
        }
    },
    "AttributeUpdates": {
        "LockId": {
            "Value": {
                "S": "42a9ed29-7a92-4455-8733-2f56c7d974b3"
            },
            "Action": "PUT"
        },
        "Locked": {
            "Value": {
                "N": "1"
            },
            "Action": "PUT"
        },
        "LockDate": {
            "Value": {
                "S": "2014-05-10T15:39:47.324Z"
            },
            "Action": "PUT"
        }
    },
    "Expected": {
        "Locked": {
            "Value": {
                "N": "0"
            },
            "Exists": true
        }
    },
    "ReturnValues": "ALL_NEW"
}

:


HTTP/1.1 400 Bad Request
x-amzn-RequestId: redacted
x-amz-crc32: redacted
Content-Type: application/x-amz-json-1.0
Content-Length: 120
Date: Sat, 10 May 2014 15:33:17 GMT

{
    "__type": "com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException",
    "message": "The conditional request failed"
}

1

Non Web Transactions - Graph 1

2

Errors - Graph 2

. !

+4
2

, , . Ajax. The Downsides ASP.NET , ASP.NET :

, , - , ; ASP.NET , . , , , , . [...]

. AWS SDK .NET , . ASP.NET, , :

[...] , , , , . ASP.NET ? concurrency , ( ) .

+3

Update

Norm Johanson , , , .


, , , , API AWS , ., , EC2 . :

, , - :

  • .NET, , , , , .
  • , . , 400 - ThrottlingException API Error Codes, .. , , , , , .
    • : - 400 - ConditionalCheckFailedException, .

, , , - , 2.0.12.0 2.0.x.NET SDK, - ?

+1

Source: https://habr.com/ru/post/1539669/


All Articles