azurestorage和NodeJS中的getaddrinfo错误
我正在做和将文件发送到Azure存储容器的应用程序,然后将消息发送到Azure队列。
当我达到1000〜1020条消息时,我不能发送更多的文件和消息。 我也注意到,当我尝试检查队列中有多less条消息时,我有一个错误。
错误是:
{ [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
是一个错误types,当找不到IP地址的情况下查找主机名称的IP地址时可能会发生。 我没有看到你的代码的问题。 您能否请启用详细日志并分享符合问题的请求? 要启用详细日志,您可以调用:
var storage = require('azure-storage'); blobSvcInput.logger.level = storage.Logger.LogLevels.DEBUG; queueSvc.logger.level = storage.Logger.LogLevels.DEBUG;
我尝试了更多的testing。 我在我的本地机器上testing过,我没有问题。
所以现在我检查了版本和我的云虚拟机版本是0.10和我的本地0.12。
我删除并强制0.12安装。 现在它工作正常。 谢谢大家。
我怀疑可能是0.12的v8引擎。
- Azure“Web应用程序”服务:从package.json自动安装npm模块
- 接收和解释hex数据时发生内容types为application / octet-stream错误
- 您无权查看Azure Ionic App的此目录或页面
- 带有Azure错误请求的Node.js Express
- node.js http和bingsearchapi
- Microsoft Azure Active Directory Passport身份validation
- 从Azure Blob存储下载文件的示例
- 无法在Azure上部署node.js项目,Bcrypt是罪魁祸首
- testingbot部署到azure色时,HTTP 500