I believe I found a race condition with the createTableIfNotExists method. I've got a loop that calls a method to create a new object. That method calls createTableIfNotExists and I get the following error with my mocha tests:
Uncaught TypeError: Cannot set property 'isSuccessful' of null
at path\to\project\api\node_modules\azure-storage\lib\services\table\tableservice.js:663:39
at finalCallback (path\to\project\api\node_modules\azure-storage\lib\services\table\tableservice.js:599:7)
at path\to\project\api\node_modules\azure-storage\lib\common\services\storageserviceclient.js:804:11
at processResponseCallback (path\to\project\api\node_modules\azure-storage\lib\services\table\tableservice.js:602:5)
at Request.processResponseCallback [as _callback] (path\to\project\api\node_modules\azure-storage\lib\common\services\storageserviceclient.js:286:13)
at Request.self.callback (path\to\project\api\node_modules\azure-storage\node_modules\request\request.js:129:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (path\to\project\api\node_modules\azure-storage\node_modules\request\request.js:873:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (path\to\project\api\node_modules\azure-storage\node_modules\request\request.js:824:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
It looks like this block in tableservice.js is trying to deal with the race condition of multiple calls to createTableIfNotExists, but doesn't account for the fact that createResponse will be null when there is a createError.
As a workaround, I've added the following line at line 663 of tableservice.js:
createResponse = {};
This appears to work, though I'm sure that's not a complete fix.
Comments: Looks like it was already filed: https://github.com/Azure/azure-storage-node/issues/31
Uncaught TypeError: Cannot set property 'isSuccessful' of null
at path\to\project\api\node_modules\azure-storage\lib\services\table\tableservice.js:663:39
at finalCallback (path\to\project\api\node_modules\azure-storage\lib\services\table\tableservice.js:599:7)
at path\to\project\api\node_modules\azure-storage\lib\common\services\storageserviceclient.js:804:11
at processResponseCallback (path\to\project\api\node_modules\azure-storage\lib\services\table\tableservice.js:602:5)
at Request.processResponseCallback [as _callback] (path\to\project\api\node_modules\azure-storage\lib\common\services\storageserviceclient.js:286:13)
at Request.self.callback (path\to\project\api\node_modules\azure-storage\node_modules\request\request.js:129:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (path\to\project\api\node_modules\azure-storage\node_modules\request\request.js:873:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (path\to\project\api\node_modules\azure-storage\node_modules\request\request.js:824:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
It looks like this block in tableservice.js is trying to deal with the race condition of multiple calls to createTableIfNotExists, but doesn't account for the fact that createResponse will be null when there is a createError.
As a workaround, I've added the following line at line 663 of tableservice.js:
createResponse = {};
This appears to work, though I'm sure that's not a complete fix.
Comments: Looks like it was already filed: https://github.com/Azure/azure-storage-node/issues/31