hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
553 stars 51 forks source link

Hoobs Not Responding After Node Update #1734

Closed thevangogh closed 2 years ago

thevangogh commented 2 years ago

Hi there, Just tried to update the Node to the latest version as per the "update" UI. Hoobs is no longer responsive. I can ping the device but cannot ssh to diagnose.

It says "Permission Denied" when I tried ssh. Please help.

Vincent

bwp91 commented 2 years ago

The default username and password for the SSH connection is hoobs and hoobsadmin.

Have you tried to ssh in with these credentials?

thevangogh commented 2 years ago

OK. The good news is that the credential works. thanks for the prompt response. Bad news is that when i try "sudo hoobs service log", i get a "You must first enable the HOOBS service" response. Tried "sudo hoobs" and the following is what I get in response

_hoobs@hoobs:~ $ sudo hoobs innerError Error: Cannot find module '../build/Debug/pty.node' Require stack:

Error: The module '/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 83. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object. (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/node-pty/lib/unixTerminal.js:26:11) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) { code: 'ERR_DLOPENFAILED' }

thevangogh commented 2 years ago

Is my next step "npm rebuild"?

bwp91 commented 2 years ago

Which version of hoobs are you running?

thevangogh commented 2 years ago

I think i was trying to upgrade from 4.0 to 4.1? Not sure to be honest. can I check the log some where?

bwp91 commented 2 years ago

I am thinking to try these steps from this issue, which has the same original error messages are you are getting:

https://github.com/hoobs-org/HOOBS/issues/393#issuecomment-570432107

thevangogh commented 2 years ago

Followed the instruction to uninstall and re-install hoobs but still getting the same error message. I did receive a warning after the install command.

"npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau

added 271 packages, and audited 272 packages in 2m

58 packages are looking for funding run npm fund for details

found 0 vulnerabilities"

thevangogh commented 2 years ago

Hoobs status is showing the same error message.

"innerError Error: Cannot find module '../build/Debug/pty.node' Require stack:

Error: The module '/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 83. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object. (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/node-pty/lib/unixTerminal.js:26:11) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) { code: 'ERR_DLOPEN_FAILED' } "

thevangogh commented 2 years ago

The issue seems to be wrong version of pty.node. Can I force version 83 of pty.node?

bwp91 commented 2 years ago

It seems to be behaving like hoobs 3 is still installed on your system. It might be worth going through all the steps here to properly migrate to hoobs 4.

https://support.hoobs.org/docs/60e5b9026c19a6a5ca8ead7a

Unless you have already done this?

thevangogh commented 2 years ago

I don't believe I have as the last major migration was done via the UI. Going through the steps now.

Getting an error executing command at "hoobs@hoobs:~ $ wget -qO- https://dl.hoobs.org/stable | sudo -E bash - Hit:1 http://archive.raspberrypi.org/debian buster InRelease Hit:2 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster InRelease Reading package lists... Done
error executing command"

OK to proceed to disable the node?

thevangogh commented 2 years ago

Encountered a bunch of errors when executing "sudo apt remove nodejs". Seems to suggest files are not removed properly. Below are some sample errors

"dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/docs' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/emoji-regex' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/brace-expansion' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/normalize-package-data' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/minizlib' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/infer-owner' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/chownr' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/ip-regex' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/abbrev' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/supports-color' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/debug/node_modules/ms' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/debug/src' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/has-unicode' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/ssri' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/concat-map' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/readdir-scoped-modules' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/humanize-ms' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/promzard' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/yallist' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/is-cidr' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/libnpmhook' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/hosted-git-info' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/asap' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/glob' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/is-fullwidth-code-point' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/ini' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/graceful-fs' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/dezalgo' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/ansi-regex' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/npm-registry-fetch' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/npm-profile' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/smart-buffer' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/npm-normalize-package-bin' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/chalk' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/retry' not empty so not removed"

thevangogh commented 2 years ago

I have a suspicion that I may be operating version 4 already but when I check the package.json, it is still referring to hoobs 3.3.12. Does that mean anything to you?

Version 4 is where Hoobs can run multiple plugins on separate thread right?

bwp91 commented 2 years ago

I don’t know what’s going on with your system… but… you could choose to wait for a member of the hoobs support team to look into this properly… or if you have the ability (and patience!) to re flash the system and start afresh with the latest version of hoobs this might be a good idea.

VladimirSpidla commented 2 years ago

I am having the same problem since trying to update

hoobs@hoobs:~ $ hoobs -v 3.3.12 hoobs@hoobs:~ $ hoobs innerError Error: Cannot find module '../build/Debug/pty.node' Require stack:

Error: The module '/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 83. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:1127:18) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module._load (internal/modules/cjs/loader.js:774:14) at Module.require (internal/modules/cjs/loader.js:957:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/node-pty/lib/unixTerminal.js:26:11) at Module._compile (internal/modules/cjs/loader.js:1068:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module._load (internal/modules/cjs/loader.js:774:14)

hoobs@hoobs:~ $ uname -a Linux hoobs 5.10.63-v7+ #1496 SMP Wed Dec 1 15:58:11 GMT 2021 armv7l GNU/Linux

thevangogh commented 2 years ago

@VladimirSpidla finally got my Hoobs back online. It is largely what @bwp91 suggested.

Follow the steps in https://support.hoobs.org/docs/60e5b9026c19a6a5ca8ead7a but use "wget -q -O - https://raw.githubusercontent.com/hoobs-org/HOOBS/master/clean.sh | sudo bash -" in one of the earlier steps.

@bwp91 thanks for your guidance.