Akkadius / glass-isc-dhcp

Glass - ISC DHCP Server Interface
MIT License
686 stars 143 forks source link

npm start issue on Raspbian v9 #17

Closed mkopnsrc closed 5 years ago

mkopnsrc commented 6 years ago

after running cmd : npm start ; this is the output of error CONSOLE OUTPUT

dhcpd-glass@0.0.0 start /opt/glass-isc-dhcp node ./bin/www

[Glass Server] Bootup complete [Glass Server] Leases file loaded [Glass Server] OUI Database Loaded [WS] STATUS: Socket clients (0) [WS] STATUS: Socket clients (0) [Glass Server] Alert loop started [Slack] :warning: CRITICAL: DHCP leases per minute have dropped below threshold (50) Current (0) undefined [Glass Server] Loading E-Mail template... [Glass Server] Loading E-Mail template... DONE... [Glass Server] Sending E-Mail Alert...

/bin/sh: 1: ./bin/dhcpd-pools: Exec format error child_process.js:644 throw err; ^

Error: Command failed: ./bin/dhcpd-pools -c /etc/dhcp/dhcpd.conf -l /var/lib/dhcp/dhcpd.leases -f j -A -s e /bin/sh: 1: ./bin/dhcpd-pools: Exec format error

at checkExecSyncError (child_process.js:601:13)
at execSync (child_process.js:641:13)
at Timeout._onTimeout (/opt/glass-isc-dhcp/app.js:555:22)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! dhcpd-glass@0.0.0 start: node ./bin/www npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dhcpd-glass@0.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:

======================= DEBUG LOG OUTPUT

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@6.2.0 3 info using node@v8.11.3 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle dhcpd-glass@0.0.0~prestart: dhcpd-glass@0.0.0 6 info lifecycle dhcpd-glass@0.0.0~start: dhcpd-glass@0.0.0 7 verbose lifecycle dhcpd-glass@0.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle dhcpd-glass@0.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/glass-isc-dhcp/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root:. 9 verbose lifecycle dhcpd-glass@0.0.0~start: CWD: /opt/glass-isc-dhcp 10 silly lifecycle dhcpd-glass@0.0.0~start: Args: [ '-c', 'node ./bin/www' ] 11 silly lifecycle dhcpd-glass@0.0.0~start: Returned: code: 1 signal: null 12 info lifecycle dhcpd-glass@0.0.0~start: Failed to exec start script 13 verbose stack Error: dhcpd-glass@0.0.0 start: node ./bin/www 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid dhcpd-glass@0.0.0 15 verbose cwd /opt/glass-isc-dhcp 16 verbose Linux 4.14.52-v7+ 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v8.11.3 19 verbose npm v6.2.0 20 error code ELIFECYCLE 21 error errno 1 22 error dhcpd-glass@0.0.0 start: node ./bin/www 22 error Exit status 1 23 error Failed at the dhcpd-glass@0.0.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Guerbie commented 5 years ago

@mkopnsrc not sure if you are having the same issue I posted previously, but you will probably find the issue is starting with your IP binding on the Raspberry Pi. Managed to get this installed on Raspbian (running stable now for a few months).

You need to ensure the IPv4 and IPv6 addresses are properly bound to fixed addresses before you start the install process mentioned. I think you will notice in lines 5-13 it is registering an incorrect IP (0.0.0). Without the IP being manually bound properly the nodes and web scripts simply wont work.

However, I would note that I don't have all the scripts on the website working correctly. I installed the package for DHCPD-POOLS and none of those scripts on the webpage appear to work (might need to use the version forked by Akkadius). And not all the graphs will show with 100% accuracy (Device graph appears eventually, but is often missing).

I believe these are issues that Akkadius might address in a future update. EItherway still a good tool even without these items working 100%.

Akkadius commented 5 years ago

You need to manually build dhcpd-pools for Raspbian, you need to follow the dhcpd-pools make instructions in the readme and then copy the binary to your /bin folder in the Glass folder. I don't have a Raspbian to test this, but if I can get a hold of a VM I can make a build script to try and automate this for you guys, in the meantime I am closing this

jchartkoff commented 5 years ago

Greetings,

I was getting the exact same issue as above: Error: Command failed: ./bin/dhcpd-pools -c /etc/dhcp/dhcpd.conf -l /var/lib/dhcp/dhcpd.leases -f j -A -s e /bin/sh: 1: ./bin/dhcpd-pools: Exec format error

I am running a fully updated and upgraded copy of Raspbian Stretch on a RPi 3. The pi is my home router, and is running isc-dhcp-server, and stubby.

Then I cloned the file from https://github.com/Akkadius/dhcpd-pools and built as instructed. It failed in and exited the ./bootstrap script here:

autoreconf: configure.ac: tracing autoreconf: running: true --copy --force autoreconf: running: /usr/bin/autoconf --include=m4 --force autoreconf: running: /usr/bin/autoheader --include=m4 --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:31: installing 'build-aux/compile' configure.ac:13: installing 'build-aux/missing' Makefile.am:42: warning: dir $@: non-POSIX variable name Makefile.am:42: (probably a GNU make extension) Makefile.am: installing './INSTALL' Makefile.am: error: required file './README' not found Makefile.am: installing 'build-aux/depcomp' parallel-tests: installing 'build-aux/test-driver' autoreconf: automake failed with exit status: 1 ./bootstrap: autoreconf failed

Next I deleted the /tmp/dhcpd-pools directory and the master file, and cloned and successfully installed the following version of dhcpd-pools without error:

git clone git://git.code.sf.net/p/dhcpd-pools/code dhcpd-pools

Next I ran the configure script as instructed without errors.

Then I installed glass-isc-dhcp as directed, but the service crashes when running sudo npm start.

./bin/dhcpd-pools: invalid option -- 'A' ./bin/dhcpd-pools: Try ./bin/dhcpd-pools --help for more information. child_process.js:650 throw err; ^

Error: Command failed: ./bin/dhcpd-pools -c /etc/dhcp/dhcpd.conf -l /var/lib/dhcp/dhcpd.leases -f j -A -s e ./bin/dhcpd-pools: invalid option -- 'A' ./bin/dhcpd-pools: Try ./bin/dhcpd-pools --help for more information.

at checkExecSyncError (child_process.js:607:13)
at execSync (child_process.js:647:13)
at Timeout._onTimeout (/opt/glass-isc-dhcp/app.js:322:21)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! dhcpd-glass@0.0.0 start: node ./bin/www npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dhcpd-glass@0.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-01-23T05_15_40_491Z-debug.log

Please advise

Thank you,