none
table storage creation error in node.js - again

    Question

  • It's just simple test app. I got this error. I am looking forward to your answer...

    var tableSvc = azure.createTableService(accountName, accountKey);

    tableSvc.createTableIfNotExists(messageTableName, function(error, result, response) {
       console.log(error);
    });

    I am Bizspark user in Republic of Korea.

    I can't see create table or queue menu in storage control panel in azure management panel.

    And I got 

    { [Error: The value for one of the HTTP headers is not in the correct format.
    RequestId:94a16b7c-fc89-4295-bd38-297239b8a4d3
    Time:2014-08-20T08:53:21.3557834Z]
      code: 'InvalidHeaderValue',
      statusCode: 400,
      requestId: '94a16b7c-fc89-4295-bd38-297239b8a4d3' }

    these errors when using the nodejs simple test code above.

    Is there any limitation for me to use table or queue service?

    Bizspark user in Republic of Korea.

    Or Is there any bugs or version problem between node.js azure-storage library and azure table platform?

    Wednesday, August 20, 2014 10:50 PM

Answers

  • var sendingRequestHandler = function (webresource) {
        webresource
            .withHeader(azure.Constants.HeaderConstants.DATA_SERVICE_VERSION, '3.0;NetFx')
            .withHeader(azure.Constants.HeaderConstants.MAX_DATA_SERVICE_VERSION, '3.0;NetFx');
    };
    tableSvc.on('sendingRequestEvent', sendingRequestHandler);

    It had been necessary this code. DATA_SERVICE_VERSION problem.

    I think you need to update nodejs library or some explanation for beginners.

    Friday, August 22, 2014 3:51 AM

All replies

  • It's just simple test app. I got this error. I am looking forward to your answer...

    var tableSvc = azure.createTableService(accountName, accountKey);

    tableSvc.createTableIfNotExists(messageTableName, function(error, result, response) {
       console.log(error);
    });

    I am Bizspark user in Republic of Korea.

    I can't see create table or queue menu in storage control panel in azure management panel.

    And I got 

    { [Error: The value for one of the HTTP headers is not in the correct format.
    RequestId:94a16b7c-fc89-4295-bd38-297239b8a4d3
    Time:2014-08-20T08:53:21.3557834Z]
      code: 'InvalidHeaderValue',
      statusCode: 400,
      requestId: '94a16b7c-fc89-4295-bd38-297239b8a4d3' }

    these errors when using the nodejs simple test code above.

    Is there any limitation for me to use table or queue service?

    Bizspark user in Republic of Korea.

    Or Is there any bugs or version problem between node.js azure-storage library and azure table platform?

    Wednesday, August 20, 2014 10:50 PM
  • Hi theklever,

    Thanks for your post.

    With your description and code provided, I see you want to create a storage table using node.js module. However you get a http error "The value for one of the HTTP headers is not in the correct format". For this issue, I think you should make sure the table name you specified is valid.

    tableSvc.createTableIfNotExists(messageTableName, function(error, result, response) {

    You can refer to article "Table Names" section and make a correct table name.

    http://msdn.microsoft.com/library/azure/dd179338.aspx

    If you are using the storage emulator to test your node.js code, I think you should make sure the storage emulator version works fine with the node.js module version.

    http://blogs.msdn.com/b/windowsazurestorage/archive/2014/06/26/microsoft-azure-storage-client-module-for-node-js-v-0-2-0.aspx

    Hope it helpful to you, thanks.

    Best Regards,

    Fuxiang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.<br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, August 21, 2014 8:47 AM
    Moderator
  • I think I am not using emulator and even table name is correct format.

    And the code below is working. So I think I don't have permission to use Table service. I can not find Table or Queue related buttons in Azure Management Website. Is emulator virtual environment for testing in local? 

    var azure = require('azure-storage');
    var fs = require('fs');

    var accountName = '*****';
    var accountKey = '****************';

    var blobService = azure.createBlobService(accountName, accountKey);

    blobService.createContainerIfNotExists('images', {publicAccessLevel: 'blob'}, function(error, result, response) {
        if(!error) {

            blobService.createBlockBlobFromLocalFile('images', '2014/08/16/abcdefsx_10321.ico', 'favicon.ico', function(error, result, response) {

                if(!error) {

                    blobService.getBlobToStream('images', '2014/08/16/abcdefsx_10321.ico', fs.createWriteStream('output.ico'), function(error, result, response) {

                        if(!error) {
                            // blob retrieved
                        }

                    });

                }

            })

        }
    })

    But 

    var azure = require('azure-storage');
    var uuid = require('node-uuid');
    var moment = require('moment');
    var assert = require('assert');

    var accountName = '*****';
    var accountKey = '************';
    var messageTableName = 'message';


    var tableSvc = azure.createTableService(accountName, accountKey);


    tableSvc.createTable(messageTableName, function(error1) {
        assert.equal(error1, null);
    });

    //tableSvc.createTableIfNotExists(messageTableName, function(error, result, response) {
    //   console.log(error);
    //});

    I got this error.

    { [Error: The value for one of the HTTP headers is not in the correct format.
    RequestId:94a16b7c-fc89-4295-bd38-297239b8a4d3
    Time:2014-08-20T08:53:21.3557834Z]
      code: 'InvalidHeaderValue',
      statusCode: 400,
      requestId: '94a16b7c-fc89-4295-bd38-297239b8a4d3' }

    Is it possible to be some restriction for using Table or Queue Storage Service at each different account type?

    I am Bizspark account in Republic of Korea.

    I haven't yet put card information for checkout.

    Can you check it for me?

    Is it right Table and Queue related function is not in Storage Management page?

    Thursday, August 21, 2014 11:21 AM
  • var sendingRequestHandler = function (webresource) {
        webresource
            .withHeader(azure.Constants.HeaderConstants.DATA_SERVICE_VERSION, '3.0;NetFx')
            .withHeader(azure.Constants.HeaderConstants.MAX_DATA_SERVICE_VERSION, '3.0;NetFx');
    };
    tableSvc.on('sendingRequestEvent', sendingRequestHandler);

    It had been necessary this code. DATA_SERVICE_VERSION problem.

    I think you need to update nodejs library or some explanation for beginners.

    Friday, August 22, 2014 3:51 AM
  • Hi theklever,

    Thanks for your response and the code provided.

    I tested your code without the 'sendingRequestEvent' and it works fine in my side.

    var azure = require('azure-storage');
    var messageTableName = 'mytable3';
    var accountName = 'accountname';
    var accountKey = 'access key';
    var tableSvc = azure.createTableService(accountName ,accountKey );
    tableSvc.createTableIfNotExists(messageTableName, function(error, result, response){
        if(!error)
        {
            // Table exists or created
        }
        else 
        {
           console.log(error);
        }
    });

    There may be the version problem with Node.js, please upgrade the node.js to last version.

    >>>Is emulator virtual environment for testing in local? 

    Yes, the emulator used for developer test their code in the local machine.

    Best Regards,

    Fuxiang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.<br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Friday, August 22, 2014 7:49 AM
    Moderator