zestedesavoir / zmarkdown

Live demo: https://zestedesavoir.github.io/zmarkdown/
MIT License
224 stars 52 forks source link

Munin controller: TypeCannot read properties of undefined (reading 'value') #475

Closed philippemilink closed 1 year ago

philippemilink commented 1 year ago

Sentry reported the following error:

TypeError: Cannot read properties of undefined (reading 'value')
  File "/opt/zds/app/zmd/node_modules/zmarkdown/server/controllers/munin.js", line 105, col 77, in null.<anonymous>
    loopLag = parseFloat(proc.pm2_env.axm_monitor['Event Loop Latency'].value)
  ?, in Array.reduce
  File "/opt/zds/app/zmd/node_modules/zmarkdown/server/controllers/munin.js", line 95, col 28, in gatherData
    const procs = procList.reduce((acc, proc, i) => {
  File "/opt/zds/app/zmd/node_modules/zmarkdown/server/controllers/munin.js", line 204, col 18, in null.<anonymous>
    callback(gatherData(plist))
  File "/opt/zds/app/zmd/node_modules/pm2/lib/API.js", line 625, col 19, in null.<anonymous>
    return cb ? cb(null, list) : that.speedList(null);
  File "/opt/zds/app/zmd/node_modules/pm2-axon-rpc/lib/client.js", line 45, col 10, in null.<anonymous>
    fn.apply(null, msg.args);
  File "/opt/zds/app/zmd/node_modules/pm2-axon/lib/sockets/req.js", line 67, col 8, in Parser.<anonymous>
    fn.apply(null, msg.args);
  File "node:events", line 513, col 28, in Parser.emit
  File "node:domain", line 552, col 15, in Parser.emit
  File "/opt/zds/app/zmd/node_modules/amp/lib/stream.js", line 91, col 16, in Parser._write
    this.emit('data', Buffer.concat(this._bufs));

A representation slightly different of the same backtrace:

TypeError: Cannot read properties of undefined (reading 'value')
    at /opt/zds/app/zmd/node_modules/zmarkdown/server/controllers/munin.js:105:77
    at Array.reduce (<anonymous>)
    at gatherData (/opt/zds/app/zmd/node_modules/zmarkdown/server/controllers/munin.js:95:28)
    at /opt/zds/app/zmd/node_modules/zmarkdown/server/controllers/munin.js:204:18
    at /opt/zds/app/zmd/node_modules/pm2/lib/API.js:625:19
    at /opt/zds/app/zmd/node_modules/pm2-axon-rpc/lib/client.js:45:10
    at Parser.<anonymous> (/opt/zds/app/zmd/node_modules/pm2-axon/lib/sockets/req.js:67:8)
    at Parser.emit (node:events:513:28)
    at Parser.emit (node:domain:552:15)
    at Parser._write (/opt/zds/app/zmd/node_modules/amp/lib/stream.js:91:16)

Do not hesitate to ask if you need more context.