Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: 404 Error when installing and related system command failures #691

Closed
JeremyLaurenson opened this issue Mar 10, 2023 · 15 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@JeremyLaurenson
Copy link

Describe The Bug

During the install of the plugina 404 is generated downloading Bluetooth code

To Reproduce

Run install

Expected behavior

There should be no errors.

Relevant log output

> node-pre-gyp install --fallback-to-build
--update-binary
node-pre-gyp ERRI install response status 404 Not Found on https: //github.com/abandonwa re/node-bluetooth-hi-socket/releases/download/0.5.3-10/bluetooth_hi_socket-0.5.3-10-n ode-v108-linux-x64.tar.g make: Entering directory /var/lib/homebridge/node modules/@switchbot/homebridge-switch bot /node modules /@abandonware/bluetooth-hci-socket/build'
CXX(target) Release/obj.target/bluetooth hi socket/src/BluetoothHciSocket.o
In file included from /home/homebridge/.cache/node-gyp/18.12.1/include/node/node buffer .h: 25,
from .. /src/Bluetoothicisocket.cpp:7
/home/homebridge/.cache/node-gyp/18.12.1/include/node/node.h:976:7: warning: cast betwe en incompatible function types from
"void (*) (Nan: :ADDON REGISTER FUNCTION ARGS TYPE)'
{aka 'void (*) (v8: :Local<v8::Object>)) to
'node: :addon register [unc' (aka
'void (*)(v
8: ¡Local<v8: :object>, vB:;Local<v8: iValue>, void*) ') (-rcast-function-type]
976
(node: taddon_register_func) (regfunc),
/home/homebridge/.cache/node-gyp/18.12.1/include/node/node.h:1010:3: note: in expansion of macro 'NODE MODULE X'
1010
NODE _MODULE_X (modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
../src/BluetoothrciSocket.cpp:740:1:note:in expansion of macro 'NODE _MODULE'
740
NODE MODULE (binding, BluetoothHciSocket::Init);


...



1010
NODE_ MODULE_(modname, regfunc,
NULL, 0)
// NOLINT (readability/null _usage)
../src/BluetoothrciSocket.cpp:740:1:note:in expansion of macro
" NODE MODULE
740
NODE_ MODULE (binding, BluetoothHciSocket: :Init);
../src/Bluetooth#cisocket.cpp: In member function 'void BluetoothlciSocket: :setConnecti onParameters (short unsigned int, short unsigned int, short unsigned int, short unsigned int)':
../src/Bluetooth#cisocket.cpp:486:11: warning: ignoring return value of 'int system(con st char*) declared with attribute
'warn_unused_result'
[-Wunused-result]
486
system (command);
../src/Bluetoothfcisocket.cpp:488:11:warning:ignoring return value of st char*) declared with attribute
"int system(con
'warn_unused_ result'
[-Wunused-result]
488
system (command);
../src/Bluetoothicisocket.cpp:490:11: warning: ignoring return value of
'int system(con
st char*)' declared with attribute 'warn_ unused _result'
[-Wunused-result]
490
system (command);
../src/BluetoothilciSocket.cpp:492:11: warning: ignoring return value of
'int system(con
st char*) declared with attribute
'warn_unused_result' (-Wunused-result]
492
system (command);

Config for homebridge-switchbot

NA - this is pre-config

Screenshots

Screenshot 2023-03-10 at 6 58 38 AM
Screenshot 2023-03-10 at 6 58 38 AM 1
Screenshot 2023-03-10 at 6 58 39 AM

Device & Model

Intel NUK

Node.js Version

v18.15.0

NPM Version

na

Homebridge Version

1.6.0 (HAP v0.11.0)

Homebridge Switchbot Plugin Version

2.5.2

Homebridge Config UI X Plugin Version

v4.50.2

Operating System

Ubuntu Ubuntu Jammy Jellyfish (22.04.1 LTS)

@florinmoreanu
Copy link

Hey! Do you have any solution for this ?

@JeremyLaurenson
Copy link
Author

Its possibly just a typo, as there is a repo:

https://github.com/abandonware/node-bluetooth-hci-socket

as opposed to the install which references:

https://github.com/abandonware/node-bluetooth-hi-socket

However I cant find at a cursory look for where this is actually referenced.

@florinmoreanu
Copy link

I can see that plugin tries to install the -hci- version which I believe is the correct one.
7735ABFA-6FAF-46A7-8A53-94F8CD0A4B29

@JeremyLaurenson
Copy link
Author

Weird... and a 404 for you too

@florinmoreanu
Copy link

Tried different Raspbian OS’s versions but no luck..

@JeremyLaurenson
Copy link
Author

Im running this on Ubuntu Jammy Jellyfish 22.04.1 LTS

@florinmoreanu
Copy link

Thanks for letting me know.Will give it a try

@BallistiX09
Copy link

If you check the repo, it looks like all of the releases have been completely removed. There's tags on there which match up with release versions from what I can tell, but nothing under releases where the plugin will be looking.

@JeremyLaurenson
Copy link
Author

Fitting it's "abandonware"

@marvinjoa
Copy link

This is the same issue I have trying to update from 2.5.1 to 2.5.3. The plugin stops working after updating.

@marvinjoa
Copy link

I was able to fix it:

  1. SSH into the server
  2. cd /var/lib/homebridge/node_modules/@switchbot
  3. use ls -a to see all folders
  4. due to the failed update you will most likely have 2 folders there, one has a dot at the beginning which makes it invisible (that's why you need to use ls -a). Rename both folders with mv foldername foldername-backup
  5. open the Homebridge shell with sudo hb-shell
  6. install the bluetooth-hci-socket manually via npm i @abandonware/bluetooth-hci-socket. This will remove some SwitchBot Plugin files and folders, but don't worry.
  7. After finishing the installation, exit the hb-shell via exit
  8. The folder with the dot at the beginning needs to be renamed to homebridge-switchbot with mv .foldername-backup homebridge-switchbot
  9. Reboot time -> sudo reboot
  10. Use the Homebridge UI to update the Switchbot plugin and afterwards use ssh to restart the server again.
  11. Done

@donavanbecker
Copy link
Collaborator

This should be raise as an issue on noble and Bluetooth-hci-socket.

@marvinjoa
Copy link

This should be raise as an issue on noble and Bluetooth-hci-socket.

@donavanbecker Update from 2.5.3 to 2.6.1 worked without any issues 10 mins ago. Don't know if it is because the compiled files still exists from my manual hci-socket installation. If you need me to I can rollback to 2.5.2 via the SD image backup and try out if the update to 2.6.1 works without problems now. Let me know.

@mkizzle2906
Copy link

I can only install 2.5.2 or below. Updating to newer version of SwitchBot plugin always show the errors

(##################) ⠙ reify:googleapis: timing reifyNode:node_modules/@switchbot/home

@abandonware/bluetooth-hci-socket@0.5.3-10 install
node-pre-gyp install --fallback-to-build --update-binary

node-pre-gyp ERR! install response status 404 Not Found on https://github.com/abandonware/node-bluetooth-hci-socket/releases/download/0.5.3-10/bluetooth_hci_socket-0.5.3-10-node-v108-linux-arm.tar.gz
make: Entering directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/build'
CXX(target) Release/obj.target/bluetooth_hci_socket/src/BluetoothHciSocket.o
make: g++: No such file or directory
make: *** [bluetooth_hci_socket.target.mk:111: Release/obj.target/bluetooth_hci_socket/src/BluetoothHciSocket.o] Error 127
make: Leaving directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/build'
gyp ERR! build error ⠼ reify:googleapis: timing reifyNode:node_modules/@switchbot/home
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.10.103-v7l+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--update-binary" "--module=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node" "--module_name=bluetooth_hci_socket" "--module_path=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
gyp ERR! cwd /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket
gyp ERR! node -v v18.16.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node --module_name=bluetooth_hci_socket --module_path=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Linux 5.10.103-v7l+
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket
node-pre-gyp ERR! node -v v18.16.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node --module_name=bluetooth_hci_socket --module_path=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
(##################) ⠼ reify:googleapis: timing reifyNode:node_modules/@switchbot/home

@abandonware/noble@1.9.2-20 install
node-gyp-build

make: Entering directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble/build'
SOLINK_MODULE(target) Release/obj.target/noble.node
make: g++: No such file or directory
make: *** [noble.target.mk:20: Release/obj.target/noble.node] Error 127
make: Leaving directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2Node:node_modules/@switchbot/home
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.10.103-v7l+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble
gyp ERR! node -v v18.16.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble
npm ERR! command failed
npm ERR! command sh -c node-gyp-build

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2023-04-17T18_15_17_417Z-debug-0.log

@JeremyLaurenson
Copy link
Author

Wait, you're saying 2.25.2 of Switchbot plugin or below doesnt have this issue?
Does 2.5.2 have bluetooth support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants