每当我发出postgresql查询时,Appmetrics-dash都会崩溃应用程序

时间:2017-06-20 13:02:53

标签: node.js postgresql

我正在使用节点v7.2.1。

我使用以下命令安装了appmetrics-dash: npm install appmetrics-dash

在应用程序中,我在快递后添加了一行:

var express = require('express');
var dash = require('appmetrics-dash').monitor();

我的应用程序启动正常,我可以在端口3001看到仪表板,但是当我向(PostgreSQL)数据库发出查询时,appmetrics崩溃,以及我的应用程序:

D:\Projekti\a2\app\edgar\node_modules\appmetrics-dash\node_modules\appmetrics\probes\postgres-probe.js:54
        if(!client.__appmetricsProbeAttached__) {
                  ^

TypeError: Cannot read property '__appmetricsProbeAttached__' of null
    at D:\Projekti\a2\app\edgar\node_modules\appmetrics-dash\node_modules\appmetrics\probes\postgres-probe.js:54:19
    at args.(anonymous function) (D:\Projekti\a2\app\edgar\node_modules\appmetrics-dash\node_modules\appmetrics\lib\aspect.js:26:4)
    at D:\Projekti\a2\app\edgar\node_modules\pg\lib\pool.js:81:27
    at D:\Projekti\a2\app\edgar\node_modules\generic-pool\lib\generic-pool.js:274:11
    at D:\Projekti\a2\app\edgar\node_modules\pg\lib\pool.js:30:28
    at Connection.<anonymous> (D:\Projekti\a2\app\edgar\node_modules\pg\lib\client.js:176:5)
    at emitOne (events.js:96:13)
    at Connection.emit (events.js:188:7)
    at Socket.<anonymous> (D:\Projekti\a2\app\edgar\node_modules\pg\lib\connection.js:59:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)

1 个答案:

答案 0 :(得分:0)

将pg升级到最新版本(6.3.0)解决了这个问题,所以我猜这毕竟不是appmetrics错误。