NickChristensen/homebridge-unifi-block-clients

Unable to unblock client: "Request failed with status code 401

Opened this issue · 2 comments

@NickChristensen

Hi, Thanks for making this plugin. I now get to monitor my kid's device usage, such an asset!

occasionally, I get the following error and when it does I have to reset the Accessories Cache on Homebridge. Any idea why this is happening?

ERROR
[Unifi Block Clients] Unable to unblock client: "Request failed with status code 401"

CONFIG

   },
        {
            "platform": "unifiBlockClients",
            "name": "Unifi Block Clients",
            "username": "####",
            "password": "####",
            "controllerUrl": "https://192.168.1.100:8443",
            "clients": [
                "##:##:##:##:##:##",
                "##:##:##:##:##:##"
            ]
        }
    ],

to add to the above, if I make changes to the config Accessories Chache needs to be restarted or else the following UUID error shows up

Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: a7b906af-6505-4e51-8bef-8753fc3caec1
    at Bridge.Accessory.addBridgedAccessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:268:13)
    at Server._configCachedPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:396:18)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:93:8)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:59:10)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)

Hey @jeylites, thanks for the report. I haven't seen the 401 issue, how often would you ballpark "occasionally"?

I'm aware of the accessory cache issue (although I don't have a fix yet), see #1.