zautrix / hm-iobroker

ioBroker packaged as a CCU-Addon for RaspberryMatic and the HomeMatic CCU3.
MIT License
26 stars 9 forks source link

error: Caught by controller #5

Closed Matten-Matten closed 4 years ago

Matten-Matten commented 4 years ago

Zuerst mal, aller erste Sahne das du das Thema iobroker addon angegangen bist. Ich habe das Addon erfolgreich installieren und updaten können.

ab und an spuckt das Log folgende Fehlermeldung aus:

2019-10-01 18:09:38.923  - error: Caught by controller[0]: Error while getting PAGESIZE { Error: Command failed: getconf PAGESIZE
--
2019-10-01 18:09:38.923  - error: Caught by controller[0]: /bin/sh: getconf: not found
2019-10-01 18:09:38.923  - error: Caught by controller[0]:     at ChildProcess.exithandler (child_process.js:294:12)
2019-10-01 18:09:38.923  - error: Caught by controller[0]:     at ChildProcess.emit (events.js:189:13)
2019-10-01 18:09:38.923  - error: Caught by controller[0]:     at maybeClose (internal/child_process.js:970:16)
2019-10-01 18:09:38.924  - error: Caught by controller[0]:     at Socket.stream.socket.on (internal/child_process.js:389:11)
2019-10-01 18:09:38.924  - error: Caught by controller[0]:     at Socket.emit (events.js:189:13)
2019-10-01 18:09:38.924  - error: Caught by controller[0]:     at Pipe._handle.close (net.js:597:12)
2019-10-01 18:09:38.924  - error: Caught by controller[0]:   killed: false,
2019-10-01 18:09:38.924  - error: Caught by controller[0]:   code: 127,
2019-10-01 18:09:38.924  - error: Caught by controller[0]:   signal: null,
2019-10-01 18:09:38.924  - error: Caught by controller[0]:   cmd: 'getconf PAGESIZE' }
2019-10-01 18:09:38.924  - error: Caught by controller[1]: Error while getting CLK_TCK { Error: Command failed: getconf CLK_TCK
2019-10-01 18:09:38.924  - error: Caught by controller[1]: /bin/sh: getconf: not found
2019-10-01 18:09:38.925  - error: Caught by controller[1]:     at ChildProcess.exithandler (child_process.js:294:12)
2019-10-01 18:09:38.925  - error: Caught by controller[1]:     at ChildProcess.emit (events.js:189:13)
2019-10-01 18:09:38.925  - error: Caught by controller[1]:     at maybeClose (internal/child_process.js:970:16)
2019-10-01 18:09:38.925  - error: Caught by controller[1]:     at Socket.stream.socket.on (internal/child_process.js:389:11)
2019-10-01 18:09:38.925  - error: Caught by controller[1]:     at Socket.emit (events.js:189:13)
2019-10-01 18:09:38.925  - error:  Caught by controller[1]:     at Pipe._handle.close (net.js:597:12)  killed: false, code: 127, signal: null, cmd: 'getconf CLK_TCK' }

ich hoffe das hilft dir bei der Weiterentwicklung. Gruß Matten Matten

zautrix commented 4 years ago

This issue is caused by the limitatation of raspberrymatic. The command line interface "getconf" is called, which is not available on raspimatic.

The error message comes from cpu.js

function getClockAndPageSize (next) { parallel([ function getClockTick (cb) { getconf('CLK_TCK', {default: 100}, cb) }, function getPageSize (cb) { getconf('PAGESIZE', {default: 4096}, cb) } ], function (err, data) { if (err) return next(err)

next(null, {clockTick: data[0], pageSize: data[1]})

}) } With error message output here:

function getconf (keyword, options, next) { if (typeof options === 'function') { next = options options = { default: '' } }

exec('getconf ' + keyword, function (error, stdout, stderr) { if (error !== null) { console.error('Error while getting ' + keyword, error) return next(null, options.default) }

stdout = parseInt(stdout)

if (!isNaN(stdout)) {
  return next(null, stdout)
}

return next(null, options.default)

}) }

Because there are dedault values taken this issue should not matter.

jens-maus commented 4 years ago

Na wenn das getconf wirklich nicht zwingend gebraucht wird würde ich dieses ticket nicht einfach schließen sondern an ursprünglicher stelle dafür sorgen (durch ein entsprechendes ticket im js-controller github) das vor ausführung eine simple prüfung eingebaut wird ob es das kommando gibt oder nicht sodass in einer zukünftigen version von js-controller das problem nicht mehr auftritt.

Matten-Matten commented 4 years ago

/usr/local/addons/hm-iobroker/node_modules/pidusage/lib/helpers/cpu.js ich hab das erzeugen der Meldung jetzt erst einmal in Zeile 75 ausgeklammert.