azurestorage 和 NodeJS 中的错误 getaddrinfo

Error getaddrinfo in azurestorage and NodeJS

我正在做的应用程序将文件发送到 Azure 存储容器,然后将消息发送到 Azure 队列。

当我达到大约 1000~1020 条消息时,我无法发送更多的文件和消息。我也注意到,当我尝试检查队列中有多少消息时,出现错误。

错误是:

    { [Error: getaddrinfo EADDRINFO] code: 'EADDRINFO', errno: 'EADDRINFO', syscall: 'getaddrinfo' }

我的代码是:

function start(pos) {

var entry = inputs[pos]; // The array stars at 0 (zero)
console.log(entry); // Print current file

//Let's start the uploading
blobSvcInput.createContainerIfNotExists(containerInput, function(error, result, response){ // this function will create a container in Azure Storage (if this does not already exist)
        if(!error){
            // The Container was created or already exist
            blobSvcInput.createBlockBlobFromLocalFile(containerInput, "input"+pos, entry, function(error, result, response){ // this function will create a new Blob in Azure Storage (Uploading the entry)
                if(!error){
                    //No errors occurred - File uploaded

                    //Now we will send a message to the Azure Queue 
                    setTimeout(function(){ sendMsg(pos);  }, 0);                                            

                }else{          
                    //An error occurred when upload the file. We need to start again.                                                           
                    console.log("Error when uploading Blob.");
                    console.log(error);
                    console.log(result);
                    console.log(response);
                    setTimeout(function(){ start(pos);  }, 2500);

                }
                });
        }else{ 
            // An error occurred when was trying create a Container
            console.log("Error when creating Container.");

            console.log(error);
            console.log(result);
            console.log(response);


                // We need to try again                             
            setTimeout(function(){ start(pos);  }, 2500);

        }
        });
}

发送消息的函数是:

function sendMsg (pos) {
//Here I'll format the content of my message
var msg = formatMessage(pos,1);


queueSvc.createQueueIfNotExists(queue, function(error, result, response){ // Create Queue, if it does not exist
    if(!error){ // Queue already exist or was created

    queueSvc.createMessage(queue, msg, function(error, result, response){ // Send the message

        if(!error){//Success sending the message

            totalMsgsSent++; // Just for control
            pos += parallelSend;
            if(pos <= inputs.length){
                setTimeout(function(){ start(pos);  }, 0);
            }
        }else{
            //Error occurred when sending the message
            console.log("Error occurred when sending the message")
            console.log(error);
            console.log(result);
            console.log(response);
            setTimeout(function(){ sendMsg(pos);  }, 2000);
        }
    });


    }else{
        //Occurred a error when creating the queue
        console.log("Occurred a error when creating the queue")
        console.log(error);
        console.log(result);
        console.log(response);
        setTimeout(function(){ sendMsg(pos);  }, 2000);
    }
});

}

我真的迷路了。 谢谢。

通常EADDRINFO是一种错误类型,在找不到IP地址的情况下查找主机名的IP地址时可能会出现。我没有看到你的代码有问题。您能否启用详细日志并分享满足问题的请求?要启用详细日志,您可以调用:


    var storage = require('azure-storage');
    blobSvcInput.logger.level = storage.Logger.LogLevels.DEBUG;
    queueSvc.logger.level = storage.Logger.LogLevels.DEBUG;
    

我尝试了更多测试。我在本地机器上测试过,没有问题。

所以现在我检查了版本,我的云虚拟机是 0.10 版本,我的本地版本是 0.12。

我删除并强制安装了 0.12。现在它工作正常。谢谢大家。

我怀疑可能是0.12的v8引擎。