Akkadius / glass-isc-dhcp

Glass - ISC DHCP Server Interface
MIT License
707 stars 144 forks source link

error Failed at the dhcpd-glass@0.0.0 start script #66

Open rossyell opened 4 years ago

rossyell commented 4 years ago

Absolutely awesome work - when it is running. I really hope this is a project that continues.

I seem to be having similar problems to those described by https://github.com/Akkadius/glass-isc-dhcp/issues/4. I am running on Pi4 with latest version of raspberrian lite - and am running later version of nodejs.

The rot starts here:

[WS] CLIENT_CONNECT: Socket clients (23) [WS] STATUS: Socket clients (23) /bin/sh: 1: ./bin/dhcpd-pools: Exec format error GET /get_stats 500 45.400 ms - 1015 RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 2 at ServerResponse.writeHead (_http_server.js:248:11) at ServerResponse.writeHead (/opt/glass-isc-dhcp/node_modules/on-headers/index.js:55:19) at ServerResponse._implicitHeader (_httpserver.js:239:8) at write (_http_outgoing.js:650:9) at ServerResponse.end (_http_outgoing.js:761:5) at ServerResponse.send (/opt/glass-isc-dhcp/node_modules/express/lib/response.js:221:10) at /opt/glass-isc-dhcp/app.js:84:6 at Layer.handle_error (/opt/glass-isc-dhcp/node_modules/express/lib/router/layer.js:71:5) at trim_prefix (/opt/glass-isc-dhcp/node_modules/express/lib/router/index.js:315:13) at /opt/glass-isc-dhcp/node_modules/express/lib/router/index.js:284:7 GET /dhcp_statistics 304 8.373 ms - - GET /assets/plugins/node-waves/waves.css 304 7.579 ms - - GET /assets/plugins/bootstrap/css/bootstrap.css 304 10.556 ms - - GET /assets/plugins/morris/morris.css 304 5.773 ms - -

and runs well for a while until

/api/get_mac_oui_count_by_vendor 304 3.244 ms - - GET /api/get_dhcp_requests 304 2.323 ms - - [WS] CLIENT_CONNECT: Socket clients (24) [WS] STATUS: Socket clients (1) GET /assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff2 304 3.854 ms - - GET /images/glass_logo.png 200 9.766 ms - 22041 [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [Glass Server] Alert loop started /bin/sh: 1: ./bin/dhcpd-pools: Exec format error child_process.js:669 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:630:11)
at execSync (child_process.js:666:15)
at Timeout._onTimeout (/opt/glass-isc-dhcp/app.js:322:21)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) {

status: 2, signal: null, output: [ null,

, ], pid: 3367, stdout: , stderr: } 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/2020-05-24T02_10_21_054Z-debug.log The referred log looks like: 0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@6.14.5 3 info using node@v12.16.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 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:332:16) 13 verbose stack at EventEmitter.emit (events.js:310:20) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:310:20) 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 14 verbose pkgid dhcpd-glass@0.0.0 15 verbose cwd /opt/glass-isc-dhcp 16 verbose Linux 4.19.97-v7l+ 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v12.16.3 19 verbose npm v6.14.5 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 ] I guessed it might be something do with dhcpd-pools and went through the second part of the instructions to install - fails to install and looks like my pi4 has a different directory structure ? Unfortunately now way beyond my abilities. Any suggestions ?
rojarrolla commented 4 years ago

Hi, I have something very similar, I installed it in UNRAID, but, besides that it crashes, I can´t make changes because the glassadmin is not recoginized at the GUI.

Do you know what is going on? Attached is my log.

ISC DHCP GLASS Log.txt

Thanks for your help

rvtv commented 4 years ago

Absolutely awesome work - when it is running. I really hope this is a project that continues.

I seem to be having similar problems to those described by #4. I am running on Pi4 with latest version of raspberrian lite - and am running later version of nodejs.

The rot starts here:

[WS] CLIENT_CONNECT: Socket clients (23) [WS] STATUS: Socket clients (23) /bin/sh: 1: ./bin/dhcpd-pools: Exec format error GET /get_stats 500 45.400 ms - 1015 RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 2 at ServerResponse.writeHead (_http_server.js:248:11) at ServerResponse.writeHead (/opt/glass-isc-dhcp/node_modules/on-headers/index.js:55:19) at ServerResponse._implicitHeader (_httpserver.js:239:8) at write (_http_outgoing.js:650:9) at ServerResponse.end (_http_outgoing.js:761:5) at ServerResponse.send (/opt/glass-isc-dhcp/node_modules/express/lib/response.js:221:10) at /opt/glass-isc-dhcp/app.js:84:6 at Layer.handle_error (/opt/glass-isc-dhcp/node_modules/express/lib/router/layer.js:71:5) at trim_prefix (/opt/glass-isc-dhcp/node_modules/express/lib/router/index.js:315:13) at /opt/glass-isc-dhcp/node_modules/express/lib/router/index.js:284:7 GET /dhcp_statistics 304 8.373 ms - - GET /assets/plugins/node-waves/waves.css 304 7.579 ms - - GET /assets/plugins/bootstrap/css/bootstrap.css 304 10.556 ms - - GET /assets/plugins/morris/morris.css 304 5.773 ms - -

and runs well for a while until

/api/get_mac_oui_count_by_vendor 304 3.244 ms - - GET /api/get_dhcp_requests 304 2.323 ms - - [WS] CLIENT_CONNECT: Socket clients (24) [WS] STATUS: Socket clients (1) GET /assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff2 304 3.854 ms - - GET /images/glass_logo.png 200 9.766 ms - 22041 [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [Glass Server] Alert loop started /bin/sh: 1: ./bin/dhcpd-pools: Exec format error child_process.js:669 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:630:11)
at execSync (child_process.js:666:15)
at Timeout._onTimeout (/opt/glass-isc-dhcp/app.js:322:21)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) {

... Unfortunately now way beyond my abilities. Any suggestions ?

I think the issue is that dhcpd-pools actually is a binary executable and compiled for a different architecture then the arm architecture of the rpi. I worked around that by installing dhcpd-pools with apt (running glass-isc-dhcp in a docker container on a pi4) and replacing the dhcpd-pools file in the bin directory with a symlink to the newly installed version. IT's a bit of a hack but I got glass-isc-dhcp running that way.