在Azure中运行的node.js服务器上获取错误(读取ECONNRESET)

时间:2018-11-26 05:48:14

标签: angularjs node.js

当我以天蓝色运行node.js服务器时,它运行大约5至10分钟,然后出现以下错误  错误:{“ errno”:“ ENOTFOUND”,“代码”:“ ENOTFOUND”,“ syscall”:“ getaddrinfo”,“主机名”:“ brdiesmsdc01.abc.com”,“主机”:“ brdiesmsdc01.abc.com” ,“端口”:389}

events.js:183 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET

at TLSWrap.onread (net.js:622:25)


    ***Please find the code for Api.js in node server***
var connection = mysql.createConnection({host: "temp.mysql.database.azure.com", 
user: "tempDb@xerox", password: "*******", database: "tempDB", port: 3306,    ssl: true });  

const express = require('express');
const router = express.Router();
var app = express();
var mysql = require('mysql');
var async = require('async');
const http = require('http');   

router.get("/plantName", function (req, res) {
  var query = "SELECT plant_name FROM abc.abc_plant_details;";  
  var return_data = {};
  async.parallel([
    function (parallel_done) {
      connection.query(query, {}, function (err, results) {
        if (err) return parallel_done(err);
        return_data.table = results;        
        parallel_done();
      });
    }
  ], function (err) {
    if (err) console.log(err);
    res.send(return_data);
  });
});

Please help me to resolve this error TLSWrap.onread (net.js:622:25)

0 个答案:

没有答案