eu-evops / homebridge-hikvision

28 stars 21 forks source link

Node.js error with new setup #26

Open SuperTurn opened 3 years ago

SuperTurn commented 3 years ago

Hi all,

Trying to get this setup with my HikVision NVR. Getting an error after the plugin connects to my NVR: I am running Raspberry Pi Homebridge version 1.3.4, node.js version 14.6.0, and my Homebridge-HikVision plugin is version 1.0.14.

I separately installed Homebridge Camera FFmpeg per the installation instructions, and that is version 3.1.2. When I installed that, it told me that my version of NPM was not supported and I should upgrade to version 7.6.3, which I did via the following command: sudo npm install -g npm@7.6.3

I think error 403 is a permission denied issue, and I believe it is because this plugin is trying to use basic authentication. Even in an internal-only environment, basic auth is a security risk. I happen to have my NVR exposed through my router's DDNS, so there is no way I would ever consider basic auth. Can this be updated to use digest authentication?

Here is my log when starting up my Homebridge, showing the errors within the homebridge-hikvision plugin dependencies.

[23/03/2021, 11:12:34] Homebridge v1.3.4 (Homebridge 35C2) is running on port 51273.
[23/03/2021, 11:12:34] [Hikvision] Connected to NVR system: {
DeviceInfo: {
'$': {
version: '1.0',
xmlns: 'http://www.hikvision.com/ver20/XMLSchema'
},
deviceName: 'Network Video Recorder',
deviceID: 'REDACTED',
model: 'DS-7608NI-E2/8P',
serialNumber: 'REDACTED',
macAddress: 'REDACTED',
firmwareVersion: 'V3.4.103',
firmwareReleasedDate: 'build 181226',
encoderVersion: 'V5.0',
encoderReleasedDate: 'build 181023',
deviceType: 'IPC',
telecontrolID: '255'
}
}
[23/03/2021, 11:12:34] [Hikvision] Loading cameras...
(node:2837) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
at createError (/usr/local/lib/node_modules/@evops/homebridge-hikvision/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/@evops/homebridge-hikvision/node_modules/axios/lib/core/settle.js:18:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/@evops/homebridge-hikvision/node_modules/axios/lib/adapters/http.js:202:11)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:2837) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
(node:2837) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
miroslavpetrov commented 3 years ago

same here

xfishernet commented 2 years ago

I also have this issue.

Beezo81 commented 2 years ago

Same issue here. Any luck with this @miroslavpetrov @xfishernet

kapps7 commented 2 years ago

Hey guys, I am getting a very similar error. Was there a work around

(node:10868) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'status' of undefined at AxiosDigest.getWwwAuth (/usr/local/lib/node_modules/@evops/homebridge-hikvision/node_modules/axios-digest/index.ts:69:13) at processTicksAndRejections (internal/process/task_queues.js:95:5) (Usenode --trace-warnings ...to show where the warning was created) (node:10868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:10868) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:10868) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'status' of undefined at AxiosDigest.getWwwAuth (/usr/local/lib/node_modules/@evops/homebridge-hikvision/node_modules/axios-digest/index.ts:69:13) at processTicksAndRejections (internal/process/task_queues.js:95:5) (node:10868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)