none
Strange error when storing data using batch and dynamic table - PHP, local development storage

    Pertanyaan

  • I am using PHP with Eclipse in compute and storage emulator and I am trying to store error data (I am writing Windows Azure storage table appender for log4php) and I don't understand why it has a problem with some data saved using Microsoft_WindowsAzure_Storage_DynamicTableEntity and batch.

    This works:

    Microsoft_WindowsAzure_Storage_DynamicTableEntity(5) {
       _dynamicProperties protected => array(9) {
          timestamp => stdClass(3) {
             Name => "timestamp" (9)
             Type => "Edm.String" (10)
             Value => "2012 04 20 09:33:11 Europe/London" (33)
          }
          level => stdClass(3) {
             Name => "level" (5)
             Type => "Edm.String" (10)
             Value => "ERROR" (5)
          }
          thread => stdClass(3) {
             Name => "thread" (6)
             Type => "Edm.Int32" (9)
             Value => 2236
          }
          message => stdClass(3) {
             Name => "message" (7)
             Type => "Edm.String" (10)
             Value => "test error - nothing actually happened" (38)
          }
          loggername => stdClass(3) {
             Name => "loggerName" (10)
             Type => "Edm.String" (10)
             Value => "errors" (6)
          }
          filename => stdClass(3) {
             Name => "fileName" (8)
             Type => "Edm.String" (10)
             Value => "C:\Users\Ragnar\workspace\CelebrioLocalDev\ServiceDefinition.csx\roles\CelebrioLocalDevRole\approot\app\bootstrap.php" (117)
          }
          method => stdClass(3) {
             Name => "method" (6)
             Type => "Edm.String" (10)
             Value => "main" (4)
          }
          linenumber => stdClass(3) {
             Name => "lineNumber" (10)
             Type => "Edm.Int32" (9)
             Value => 90
          }
          classname => stdClass(3) {
             Name => "className" (9)
             Type => "Edm.String" (10)
             Value => "main" (4)
          }
       }
       _partitionKey protected => "20120420" (8)
       _rowKey protected => 1334910791.3827
       _timestamp protected => NULL
       _etag protected => ""
    }
    This doesnt:
    Microsoft_WindowsAzure_Storage_DynamicTableEntity(5) {
       _dynamicProperties protected => array(12) {
          timestamp => stdClass(3) {
             Name => "timestamp" (9)
             Type => "Edm.String" (10)
             Value => "2012 04 20 09:29:57 Europe/London" (33)
          }
          level => stdClass(3) {
             Name => "level" (5)
             Type => "Edm.String" (10)
             Value => "ERROR" (5)
          }
          thread => stdClass(3) {
             Name => "thread" (6)
             Type => "Edm.Int32" (9)
             Value => 5164
          }
          message => stdClass(3) {
             Name => "message" (7)
             Type => "Edm.String" (10)
             Value => "test error - nothing actually happened" (38)
          }
          loggername => stdClass(3) {
             Name => "loggerName" (10)
             Type => "Edm.String" (10)
             Value => "errors" (6)
          }
          filename => stdClass(3) {
             Name => "fileName" (8)
             Type => "Edm.String" (10)
             Value => "C:\Users\Ragnar\workspace\CelebrioLocalDev\ServiceDefinition.csx\roles\CelebrioLocalDevRole\approot\app\bootstrap.php" (117)
          }
          method => stdClass(3) {
             Name => "method" (6)
             Type => "Edm.String" (10)
             Value => "main" (4)
          }
          linenumber => stdClass(3) {
             Name => "lineNumber" (10)
             Type => "Edm.Int32" (9)
             Value => 90
          }
          classname => stdClass(3) {
             Name => "className" (9)
             Type => "Edm.String" (10)
             Value => "main" (4)
          }
          exceptionmessage => stdClass(3) {
             Name => "exceptionMessage" (16)
             Type => "Edm.String" (10)
             Value => "testing exception" (17)
          }
          exceptioncode => stdClass(3) {
             Name => "exceptionCode" (13)
             Type => "Edm.Int32" (9)
             Value => 0
          }
          exceptionstacktrace => stdClass(3) {
             Name => "exceptionStackTrace" (19)
             Type => "Edm.String" (10)
             Value => "#0 C:\Users\Ragnar\workspace\CelebrioLocalDev\ServiceDefinition.csx\roles\CelebrioLocalDevRole\approot\document_root\index.php(11): require()
    #1 {main ... " (151)
          }
       }
       _partitionKey protected => "20120420" (8)
       _rowKey protected => 1334910597.0864
       _timestamp protected => NULL
       _etag protected => ""
    }

    Why is there a problem with the second entity?

    The error message is:

    Microsoft_WindowsAzure_Exception

    An error has occured while committing a batch: 0:One of the request inputs is not valid.

    20 April 2012 8:34

Jawaban

  • Somehow the error was probably related to this http://phpazure.codeplex.com/workitem/6901 and http://stackoverflow.com/questions/10257764/php-azure-storage-on-table-update-i-get-server-failed-to-authenticate-the-req

    after fixing this bug, it works now
    21 April 2012 21:21

Semua Balasan

  • Hi,

    One thing you may want to try is check the request in Fiddler and see what is going across the wire. That will certainly help.

    Can you explain me something? There is another thing I noticed:

     exceptionstacktrace => stdClass(3) {
            
    Name => "exceptionStackTrace" (19)
            
    Type => "Edm.String" (10)
            
    Value => "#0 C:\Users\Ragnar\workspace\CelebrioLocalDev\ServiceDefinition.csx\roles\CelebrioLocalDevRole\approot\document_root\index.php(11): require()
    #1 {main ... "
    (151)
         
    }

    Now I am assuming in [Name => "exceptionStackTrace" (19)], 19 actually is the length of the value of this variable (exceptionStackTrace). I have not used PHP at all so I don't know the significance of this number (19 in this case). Can you explain me?

    Thanks

    Gaurav

    20 April 2012 9:38
  • I have installed Fiddler2 but it doesn't show connections to storage emulator and neither to azure cloud from local compute emulator. Do I have to turn something on?

    The provided code is a result of dump function in PHP on the Microsoft_WindowsAzure_Storage_DynamicTableEntity object, the number is only a length of the string.
    20 April 2012 17:07
  • Somehow the error was probably related to this http://phpazure.codeplex.com/workitem/6901 and http://stackoverflow.com/questions/10257764/php-azure-storage-on-table-update-i-get-server-failed-to-authenticate-the-req

    after fixing this bug, it works now
    21 April 2012 21:21