colinbendell / homebridge-blink-for-home

Blink For Home Camera Homebridge plugin
MIT License
87 stars 27 forks source link

Blink Authentication Failed (Unexpected end of JSON input) #142

Closed eklass closed 1 year ago

eklass commented 1 year ago

Hi guys, First, thanks for the Plugin. I really want to test this plugin out, but just by restarting the ham.adapter i get the following plugin error.

[27.6.2023, 20:53:54] Plugin /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword 'homebridge-plugin'.
[27.6.2023, 20:53:54] Plugin /opt/iobroker/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword 'homebridge-plugin'.
[27.6.2023, 20:53:58] [Blink] SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at CacheableResponse.json (/opt/iobroker/node_modules/iobroker.ham/node_modules/@adobe/fetch/src/fetch/cacheableResponse.js:93:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at BlinkAPI._request (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink-api.js:290:26)
    at BlinkAPI.get (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink-api.js:229:16)
    at BlinkAPI.getBlinkStatus (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink-api.js:1282:16)
    at anonymize (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink.js:469:25)
    at BlinkHAP.diagnosticDebug (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink.js:499:13)
    at HomebridgeBlink.setupBlink (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/homebridge/index.js:112:59)
    at HomebridgeBlink.init (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/homebridge/index.js:41:26)
[27.6.2023, 20:53:58] [Blink] TypeError: Cannot read properties of undefined (reading 'replaceAll')
    at anonymize (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink.js:472:33)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at BlinkHAP.diagnosticDebug (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/blink.js:499:13)
    at HomebridgeBlink.setupBlink (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/homebridge/index.js:112:59)
    at HomebridgeBlink.init (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/homebridge/index.js:41:26)
[27.6.2023, 20:53:58] [Blink] Error: Blink Authentication failed.
    at HomebridgeBlink.setupBlink (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/homebridge/index.js:116:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at HomebridgeBlink.init (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-blink-for-home/src/homebridge/index.js:41:26)
[27.6.2023, 20:53:58] [Blink] NOTE: Blink devices in HomeKit will not be responsive.

Somehow the plugin cannot handle the response from blink. Is there a bug in the current version? At least could you tell me, how I can trace the request and response? Enabling the Debug Logleven in the plugin section did not helped.

Thanks for looking into the issue.

Edit: blink-for-home version: 3.9.2 NodeJs: v18.16.1 NPM: 9.5.1 OS: Portainer with "Linux raspberrypi 5.10.103-v7l+ #1529 SMP" Running HAM in Wrapper Mode

I saw that the user @crlppr has the same errormessage https://github.com/colinbendell/homebridge-blink-for-home/issues/78#issuecomment-1555935614

eklass commented 1 year ago

In the meantime I could get the plugin in the version 3.9.2 working with downgrading HAM from version 3.5.1. to 3.5.0.