{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-net/issues/226","labels_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/226/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/226/events","html_url":"https://github.com/aws/aws-sdk-net/issues/226","id":98568436,"number":226,"title":"Local DynamoDb hangs when PutItem with NULL value","user":{"login":"mythz","id":89361,"avatar_url":"https://avatars.githubusercontent.com/u/89361?v=3","gravatar_id":"","url":"https://api.github.com/users/mythz","html_url":"https://github.com/mythz","followers_url":"https://api.github.com/users/mythz/followers","following_url":"https://api.github.com/users/mythz/following{/other_user}","gists_url":"https://api.github.com/users/mythz/gists{/gist_id}","starred_url":"https://api.github.com/users/mythz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythz/subscriptions","organizations_url":"https://api.github.com/users/mythz/orgs","repos_url":"https://api.github.com/users/mythz/repos","events_url":"https://api.github.com/users/mythz/events{/privacy}","received_events_url":"https://api.github.com/users/mythz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-01T23:26:04Z","updated_at":"2015-08-03T20:10:06Z","closed_at":"2015-08-03T20:10:06Z","body":"Not sure if it's the Local DynamoDB Server or the AWSSDK .NET client library but trying to put a simple item with a **NULL** `AttributeValue` causes the `AmazonDynamoDBClient` to hang with this Exception:\r\n\r\n```\r\nAmazon.DynamoDBv2.AmazonDynamoDBException : The request processing has failed because of an unknown error, exception or failure.\r\n  ----> Amazon.Runtime.Internal.HttpErrorResponseException : The remote server returned an error: (500) Internal Server Error.\r\n  ----> System.Net.WebException : The remote server returned an error: (500) Internal Server Error.\r\n   at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception) in d:\\Jenkins\\jobs\\v3-release-build\\workspace\\AWSDotNetPublic\\sdk\\src\\Core\\Amazon.Runtime\\Pipeline\\ErrorHandler\\HttpErrorResponseExceptionHandler.cs: line 60\r\n...\r\n```\r\n\r\nThis is a stand-alone repro of the issue which works when the `Empty` field is commented out but hangs when the `Empty` field is set to **NULL**:\r\n\r\n```csharp\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Threading;\r\nusing Amazon.DynamoDBv2;\r\nusing Amazon.DynamoDBv2.Model;\r\nusing NUnit.Framework;\r\n\r\nnamespace ServiceStack.Aws.Tests.Issues\r\n{\r\n    [TestFixture]\r\n    public class LocalDynamoDbHangsWhenPuttingNullValue\r\n    {\r\n        [Test]\r\n        public void Can_put_item_with_null_value()\r\n        {\r\n            var db = new AmazonDynamoDBClient(\"keyId\", \"key\", new AmazonDynamoDBConfig\r\n            {\r\n                ServiceURL = \"http://localhost:8000\",\r\n            });\r\n\r\n            try\r\n            {\r\n                db.DeleteTable(new DeleteTableRequest\r\n                {\r\n                    TableName = \"Test\",\r\n                });\r\n\r\n                Thread.Sleep(1000);\r\n            }\r\n            catch (Exception) { /*ignore*/ }\r\n\r\n            db.CreateTable(new CreateTableRequest\r\n            {\r\n                TableName = \"Test\",\r\n                KeySchema = new List<KeySchemaElement>\r\n                {\r\n                    new KeySchemaElement\r\n                    {\r\n                        AttributeName = \"Id\",\r\n                        KeyType = \"HASH\"\r\n                    }\r\n                },\r\n                AttributeDefinitions = new List<AttributeDefinition>\r\n                {\r\n                    new AttributeDefinition\r\n                    {\r\n                        AttributeName = \"Id\",\r\n                        AttributeType = \"N\",\r\n                    }\r\n                },\r\n                ProvisionedThroughput = new ProvisionedThroughput\r\n                {\r\n                    ReadCapacityUnits = 10,\r\n                    WriteCapacityUnits = 5,\r\n                }\r\n            });\r\n\r\n            Thread.Sleep(1000);\r\n\r\n            db.PutItem(new PutItemRequest\r\n            {\r\n                TableName = \"Test\",\r\n                Item = new Dictionary<string, AttributeValue>\r\n                {\r\n                    { \"Id\", new AttributeValue { N = \"1\" } },\r\n                    { \"Name\", new AttributeValue { S = \"Foo\"} },\r\n                    //{ \"Empty\", new AttributeValue { NULL = true } },\r\n                }\r\n            });\r\n\r\n            var response = db.GetItem(new GetItemRequest\r\n            {\r\n                TableName = \"Test\",\r\n                ConsistentRead = true,\r\n                Key = new Dictionary<string, AttributeValue> {\r\n                    { \"Id\", new AttributeValue { N = \"1\" } }\r\n                }\r\n            });\r\n\r\n            Assert.That(response.IsItemSet);\r\n            Assert.That(response.Item[\"Id\"].N, Is.EqualTo(\"1\"));\r\n            Assert.That(response.Item[\"Name\"].S, Is.EqualTo(\"Foo\"));\r\n            //Assert.That(response.Item[\"Empty\"].NULL);\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Environment\r\n\r\nI've tested this using the latest stable v3 AWSSDK.DynamoDBv2 NuGet package, i.e:\r\n\r\n```java\r\n<package id=\"AWSSDK.DynamoDBv2\" version=\"3.1.0.0\" targetFramework=\"net45\" />\r\n```\r\n\r\n### Java Version\r\n\r\n```\r\njava version \"1.8.0_31\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_31-b13)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)\r\n```\r\n\r\nOn Windows 8.\r\n\r\n### DynamoDBLocal\r\n\r\nI'm running `DynamoDBLocal` on its default `8000` port, started with:\r\n\r\n```\r\njava -Djava.library.path=%DYNAMODB_HOME%\\DynamoDBLocal_lib -jar %DYNAMODB_HOME%\\DynamoDBLocal.jar -sharedDb\r\n```\r\n\r\n### .NET \r\n\r\nI'm running this in a .NET 4.5 project in VS 2015."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-net/issues/comments/127392886","html_url":"https://github.com/aws/aws-sdk-net/issues/226#issuecomment-127392886","issue_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/226","id":127392886,"user":{"login":"mythz","id":89361,"avatar_url":"https://avatars.githubusercontent.com/u/89361?v=3","gravatar_id":"","url":"https://api.github.com/users/mythz","html_url":"https://github.com/mythz","followers_url":"https://api.github.com/users/mythz/followers","following_url":"https://api.github.com/users/mythz/following{/other_user}","gists_url":"https://api.github.com/users/mythz/gists{/gist_id}","starred_url":"https://api.github.com/users/mythz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythz/subscriptions","organizations_url":"https://api.github.com/users/mythz/orgs","repos_url":"https://api.github.com/users/mythz/repos","events_url":"https://api.github.com/users/mythz/events{/privacy}","received_events_url":"https://api.github.com/users/mythz/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T20:10:06Z","updated_at":"2015-08-03T20:10:06Z","body":"Crap, I downloaded the version linked on AWS's blog post announcement: https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/ \r\n\r\nI've just tested it with version downloaded from: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html\r\n\r\n... and it works, Yay! thx. you may want to tell AWS blog admins to update the links on that blog post, as the initial version was incredibly buggy."}}