crholliday / iota-prom-exporter

Iota Exporter for Prometheus Metrics
32 stars 5 forks source link

Docker container does not work #19

Closed antonionardella closed 6 years ago

antonionardella commented 6 years ago

Hello,

I've got 2 nodes and 1 test server where the docker cotainer is in use. There is always the latest version installed, but as soon as the container starts it crashes. The log shows:

TypeError: Cannot read property 'reduce' of undefined
    at new Histogram (/exporter/node_modules/prom-client/lib/histogram.js:70:40)
    at Object.<anonymous> (/exporter/app.js:36:32)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:618:3

Any advice? Thank you.

bambash commented 6 years ago

this may be related to the feb 3rd changes, i'll investigate tonight

stereu commented 6 years ago

Same here.

antonionardella commented 6 years ago

Hi,

still trying to get the docker image to run. I've updated my config an added:

    // window for bucketing confirmation times by transaction
    // represents seconds and aggregates a histogram
    confirm_time_buckets: [300, 600, 1200, 2400, 3600, 7200, 21600, 43200],

    // how often the prune schedule will run (leave at default unless you have
    // a good reason)
    prune_interval_days: 1,

    // number of days to keep confirmation stats
    // db does not grow that quickly but checking the db/ folder
    // size regularly will prevent any issues
    // **Comment out to remove pruning**
retention_days: 14

Then built the container myself with the latest version of the master repository. The container crashes. Here are the logs:

/exporter/node_modules/prom-client/lib/histogram.js:70
        this.bucketValues = this.upperBounds.reduce((acc, upperBound) => {
                                             ^

TypeError: Cannot read property 'reduce' of undefined
    at new Histogram (/exporter/node_modules/prom-client/lib/histogram.js:70:40)
    at module.exports (/exporter/zmq/zmq.js:47:33)
    at Object.<anonymous> (/exporter/app.js:9:42)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)
/exporter/node_modules/prom-client/lib/histogram.js:70
        this.bucketValues = this.upperBounds.reduce((acc, upperBound) => {
                                             ^

TypeError: Cannot read property 'reduce' of undefined
    at new Histogram (/exporter/node_modules/prom-client/lib/histogram.js:70:40)
    at module.exports (/exporter/zmq/zmq.js:47:33)
    at Object.<anonymous> (/exporter/app.js:9:42)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)
/exporter/config.js:21
    confirm_time_buckets: [300, 600, 1200, 2400, 3600, 7200, 21600, 43200],
    ^^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:626:28)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)

Cheers!

antonionardella commented 6 years ago

So I've tried to comment that line out. Now the logs shows:

SyntaxError: Unexpected identifier
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:626:28)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)
/exporter/config.js:25
    prune_interval_days: 1,
    ^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:626:28)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)

Commenting that line out gives:

SyntaxError: Unexpected identifier
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:626:28)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)
/exporter/config.js:31
    retention_days: 14
    ^^^^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:626:28)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)

Commenting the last line out gives:

/exporter/node_modules/prom-client/lib/histogram.js:70
        this.bucketValues = this.upperBounds.reduce((acc, upperBound) => {
                                             ^

TypeError: Cannot read property 'reduce' of undefined
    at new Histogram (/exporter/node_modules/prom-client/lib/histogram.js:70:40)
    at module.exports (/exporter/zmq/zmq.js:47:33)
    at Object.<anonymous> (/exporter/app.js:9:42)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)

Cheers!

antonionardella commented 6 years ago

Solved. It was an error on my side. Sorry. https://github.com/ioiobzit/iota-nelson-node/pull/18