beele / homebridge-unifi-protect-camera-motion

Camera & Motion sensor support for Unifi Protect cameras in Homekit via Homebridge
Apache License 2.0
103 stars 12 forks source link

Installation of Update Fails #63

Closed disruptivepatternmaterial closed 3 years ago

disruptivepatternmaterial commented 3 years ago

Describe the bug I went to update the plugin and it failed

Specifications What hardware and OS is your Homebridge running on?
Ubuntu Bionic Beaver (18.04.4 LTS) What Unifi hardware are you using Cloud Key 2+

Logging USER: root DIR: /homebridge CMD: npm install --save homebridge-unifi-protect-camera-motion@latest

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 npm WARN deprecated har-validator@5.1.5: this library is no longer supported

ffmpeg-for-homebridge@0.0.7 install /homebridge/node_modules/homebridge-unifi-protect-camera-motion/node_modules/ffmpeg-for-homebridge node install.js

ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-indev=alsa --enable-outdev=alsa libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100

ffmpeg has been downloaded to /homebridge/node_modules/homebridge-unifi-protect-camera-motion/node_modules/ffmpeg-for-homebridge/ffmpeg Thank you for using https://github.com/homebridge/ffmpeg-for-homebridge

@tensorflow/tfjs-node@1.7.4 install /homebridge/node_modules/homebridge-unifi-protect-camera-motion/node_modules/@tensorflow/tfjs-node node scripts/install.js

CPU-linux-1.7.4.tar.gz

Error: connect ECONNREFUSED 0.0.0.0:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) Emitted 'error' event on ClientRequest instance at: at TLSSocket.socketErrorListener (_http_client.js:426:9) at TLSSocket.emit (events.js:310:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '0.0.0.0', port: 443 } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @tensorflow/tfjs-node@1.7.4 install: node scripts/install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @tensorflow/tfjs-node@1.7.4 install 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-08-02T16_12_41_360Z-debug.log

Command failed. Please review log for details.

To Reproduce npm i homebridge-unifi-protect-camera-motion

Expected behavior Installation completes

beele commented 3 years ago
@mint-vm:/usr/lib/node_modules$ sudo npm install homebridge-unifi-protect-camera-motion -g --unsafe-perm=true
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> ffmpeg-for-homebridge@0.0.7 install /usr/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/ffmpeg-for-homebridge
> node install.js

Downloading ffmpeg from https://github.com/homebridge/ffmpeg-for-homebridge/releases/latest/download/ffmpeg-debian-x86_64.tar.gz
100% - Download Complete
ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-indev=alsa --enable-outdev=alsa
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

ffmpeg has been downloaded to /usr/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/ffmpeg-for-homebridge/ffmpeg
Thank you for using https://github.com/homebridge/ffmpeg-for-homebridge

> @tensorflow/tfjs-node@1.7.4 install /usr/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.7.4.tar.gz
* Downloading libtensorflow
[==============================] 8482389/bps 100% 0.0s
* Building TensorFlow Node.js bindings

> canvas@2.6.1 install /usr/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[canvas] Success: "/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/canvas/build/Release/canvas.node" is installed via remote

> homebridge-unifi-protect-camera-motion@0.4.1 postinstall /usr/lib/node_modules/homebridge-unifi-protect-camera-motion
> node scripts/postinstall.js

homebridge-unifi-protect-camera-motion postinstall script running on: x64
Supported architecture, tfjs-lib should be available!
+ homebridge-unifi-protect-camera-motion@0.4.1
added 249 packages from 233 contributors in 112.791s
beele@mint-vm:/usr/lib/node_modules$ 

On my Min 20 vm with node 12.X it seems to install correctly (from scratch) Could you run the install command again but as sudo?

disruptivepatternmaterial commented 3 years ago

same result

root@8PH-Hub:/homebridge/node_modules# sudo npm install homebridge-unifi-protect-camera-motion -g --unsafe-perm=true
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> ffmpeg-for-homebridge@0.0.7 install /usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/ffmpeg-for-homebridge
> node install.js

ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-indev=alsa --enable-outdev=alsa
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

ffmpeg has been downloaded to /usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/ffmpeg-for-homebridge/ffmpeg
Thank you for using https://github.com/homebridge/ffmpeg-for-homebridge

> @tensorflow/tfjs-node@1.7.4 install /usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.7.4.tar.gz
* Downloading libtensorflow
events.js:287
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 0.0.0.0:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (_http_client.js:426:9)
    at TLSSocket.emit (events.js:310:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '0.0.0.0',
  port: 443
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs-node@1.7.4 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tensorflow/tfjs-node@1.7.4 install 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-08-02T17_41_04_442Z-debug.log
root@8PH-Hub:/homebridge/node_modules# 
beele commented 3 years ago

Seems like the issue is a refused connection when trying to download the tensorflow prebuilt binary. Do you have any special firewall rules or AV software enabled?

Edit: could you try deleting the folder where npm installed the plugin, and then install the plugin again?

disruptivepatternmaterial commented 3 years ago

I have nothing unusual. I can curl many urls http and https from within this container. I moved the host into the DMZ with the same result: it fails in the same spot.

Trying to hit 0.0.0.0 would never work...so not sure what is happening.

beele commented 3 years ago

You are running inside a docker container? Could you try installing the plugin on the host? (just to see if it can pass that point of the installation)

disruptivepatternmaterial commented 3 years ago

exactly the same error when installed outside docker on host OS

beele commented 3 years ago

What is your node version? It should be at least 12.18.0

Can you open this link on the host: https://storage.googleapis.com/tf-builds/ And subsequently can you donwload this file: https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v4/1.7.4/CPU-linux-1.7.4.tar.gz

This is the file that should be downloaded and installed by npm.

acesarewld commented 3 years ago

I disabled my Pi-Hole and tried again -- that did the trick for me.

beele commented 3 years ago

closing due to inactivity