title: aws DynamoDB gives "write EPROTO"
body: <p>I'm using dynamoDB to save the data that a web service is generating.
  I sometimes (it is not consistent) get the 'EPROTO' error, I read about it and it is a protocol error, but I use aws-sdk (javascript) and I don't state any protocol-related details.</p>
  
  <p>This is how I initialize it:</p>
  
  <pre><code>var aws = require('aws-sdk');
  var dynamoDB = new aws.DynamoDB({
      accessKeyId: config.DynamoDB.accessKeyId,
      secretAccessKey: config.DynamoDB.secretAccessKey,
      region: config.DynamoDB.region
  });
  </code></pre>
  
  <p>And I simply use the put api:</p>
  
  <pre><code>dynamoDB.putItem(params, function(err, dat) {
      if (err) {
         console.log('ERROR: Putting to dynamo failed with error: ' + err.message);
      }
      else {
         console.log('wipi');
         //passing data 
      }
  });
  </code></pre>
  
  <p><code>params</code> is as follow:</p>
  
  <pre><code>var params = {
      TableName: config.DynamoDB.tableNames.data, //this is the table name, a string
      Item: {
          id: {
              S: id // this is a generated uid (also a string)
          },
          scheme: {
              S: ivd.version // this is a string of structure 'X.X.X'
          },
          data: {
              S: JSON.stringify(data.data) // data.data is a big object - {arg1: [1, 2, 3...], arg2: '', ...}
          }
      }
  };
  </code></pre>
  
  <p>I should mention that it is not even consistent over the same params object (that differs only by the generated uid).</p>
  
  <p>Any ideas what this error means in my case and why would it occur?</p>