rylee-s / Homebridge-Litter-Robot-4

Litter Robot 4 Plugin for Apple HomeKit via Homebridge
Apache License 2.0
9 stars 2 forks source link

Homebridge not functional after installing v3.0.0 #3

Open scottdlowe opened 4 weeks ago

scottdlowe commented 4 weeks ago

Describe The Bug:

Homebridge is not functional at all upon installation of v3.0.0 of this plugin.

To Reproduce:

Install Litter Robot plugin, configure, then restart HB - continuous errors in logs; removing the plugin restores Homebridge

Expected behavior:

An operational Homebridge console post plugin installation

Logs:


      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: '42nk7qrhdg.execute-api.us-east-1.amazonaws.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: '42nk7qrhdg.execute-api.us-east-1.amazonaws.com',
      _closeAfterHandlingError: false,
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 506,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _header: 'POST /prod/login HTTP/1.1\r\n' +
      'Accept: */*\r\n' +
      'Content-Type: application/json\r\n' +
      'x-api-key: w2tPFbjlP13GUmb8dMjUL5B2YyPVD3pJ7Ey6fz8v\r\n' +
      'Accept-Encoding: gzip, deflate\r\n' +
      'User-Agent: axios/1.7.2\r\n' +
      'Content-Length: 52\r\n' +
      'Host: 42nk7qrhdg.execute-api.us-east-1.amazonaws.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    joinDuplicateHeaders: undefined,
    path: '/prod/login',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      joinDuplicateHeaders: undefined,
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 401,
      statusMessage: 'Unauthorized',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://42nk7qrhdg.execute-api.us-east-1.amazonaws.com/prod/login',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 22,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: '42nk7qrhdg.execute-api.us-east-1.amazonaws.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 52,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://42nk7qrhdg.execute-api.us-east-1.amazonaws.com/prod/login',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'x-api-key': [Array],
      'accept-encoding': [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    },
    [Symbol(errored)]: null,
    [Symbol(kHighWaterMark)]: 16384,
    [Symbol(kRejectNonStandardBodyWrites)]: false,
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 401,
    statusText: 'Unauthorized',
    headers: Object [AxiosHeaders] {
      'content-type': 'application/json',
      'content-length': '29',
      connection: 'close',
      date: 'Sun, 09 Jun 2024 03:32:13 GMT',
      'x-amzn-requestid': '3fb4fc9b-b2dc-4ce3-ad5b-67fbe0c15a02',
      'x-amz-apigw-id': 'ZFJJlEL2IAMELfQ=',
      'x-amzn-trace-id': 'Root=1-6665223d-592a66b22b035ed158c99d40;Sampled=1',
      'x-cache': 'Error from cloudfront',
      via: '1.1 a0b647da77edd97cca88fb4c4b1a9d08.cloudfront.net (CloudFront)',
      'x-amz-cf-pop': 'DEN52-P3',
      'x-amz-cf-id': '_wGDY8JFOIWzyaa6ki_heZlvdgqPwPob6xb-q345rRlQYtKOzr0dqw=='
    },
    config: {
      transitional: [Object],
      adapter: [Array],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: Infinity,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [Object [AxiosHeaders]],
      method: 'post',
      url: 'https://42nk7qrhdg.execute-api.us-east-1.amazonaws.com/prod/login',
      data: '{"email":"redacted","password":"redacted"}'
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '52',
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'POST /prod/login HTTP/1.1\r\n' +
        'Accept: */*\r\n' +
        'Content-Type: application/json\r\n' +
        'x-api-key: w2tPFbjlP13GUmb8dMjUL5B2YyPVD3pJ7Ey6fz8v\r\n' +
        'Accept-Encoding: gzip, deflate\r\n' +
        'User-Agent: axios/1.7.2\r\n' +
        'Content-Length: 52\r\n' +
        'Host: 42nk7qrhdg.execute-api.us-east-1.amazonaws.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/prod/login',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: '42nk7qrhdg.execute-api.us-east-1.amazonaws.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 16384,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null
    },
    data: { message: 'Invalid request' }
  }
}
[6/8/2024, 10:32:13 PM] AxiosError: Request failed with status code 401
    at settle (/var/lib/homebridge/node_modules/homebridge-litter-robot-4/node_modules/axios/lib/core/settle.js:19:12)
    at IncomingMessage.handleStreamEnd (/var/lib/homebridge/node_modules/homebridge-litter-robot-4/node_modules/axios/lib/adapters/http.js:589:11)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1368:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at Axios.request (/var/lib/homebridge/node_modules/homebridge-litter-robot-4/node_modules/axios/lib/core/Axios.js:45:41)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[6/8/2024, 10:32:13 PM] AxiosError: Request failed with status code 401
    at settle (/var/lib/homebridge/node_modules/homebridge-litter-robot-4/node_modules/axios/lib/core/settle.js:19:12)
    at IncomingMessage.handleStreamEnd (/var/lib/homebridge/node_modules/homebridge-litter-robot-4/node_modules/axios/lib/adapters/http.js:589:11)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1368:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at Axios.request (/var/lib/homebridge/node_modules/homebridge-litter-robot-4/node_modules/axios/lib/core/Axios.js:45:41)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[6/8/2024, 10:32:13 PM] Got SIGTERM, shutting down Homebridge...
[6/8/2024, 10:32:13 PM] [UniFi Protect] Child bridge process ended
[6/8/2024, 10:32:13 PM] [UniFi Protect] Process Ended. Code: null, Signal: SIGTERM
[6/8/2024, 10:32:18 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[6/8/2024, 10:32:23 PM] [HB Supervisor] Restarting Homebridge...
[6/8/2024, 10:32:23 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[6/8/2024, 10:32:23 PM] [HB Supervisor] Started Homebridge v1.8.2 with PID: 21274
[6/8/2024, 10:32:25 PM] Loaded config.json with 0 accessories and 3 platforms.
[6/8/2024, 10:32:25 PM] Loaded 0 cached accessories from cachedAccessories.
[6/8/2024, 10:32:25 PM] ---
[6/8/2024, 10:32:25 PM] Loaded plugin: homebridge-litter-robot-4@3.0.0
[6/8/2024, 10:32:25 PM] Registering platform 'homebridge-litter-robot-4.LitterRobot4'
[6/8/2024, 10:32:25 PM] ---
[6/8/2024, 10:32:25 PM] Loaded plugin: homebridge-ratgdo@2.2.2
[6/8/2024, 10:32:25 PM] Registering platform 'homebridge-ratgdo.Ratgdo'
[6/8/2024, 10:32:25 PM] ---
[6/8/2024, 10:32:26 PM] Loaded plugin: homebridge-unifi-protect@7.0.1
[6/8/2024, 10:32:26 PM] Registering platform 'homebridge-unifi-protect.UniFi Protect'
[6/8/2024, 10:32:26 PM] ---
[6/8/2024, 10:32:26 PM] Loading 3 platforms...
[6/8/2024, 10:32:26 PM] [UniFi Protect] Initializing UniFi Protect platform...
[6/8/2024, 10:32:26 PM] [UniFi Protect] Initializing child bridge 0E:B4:F4:A9:EC:B8
[6/8/2024, 10:32:26 PM] [LitterRobot4] Initializing LitterRobot4 platform...
Setup Payload:
X-HM://0024ZWML2NJZP```

**Plugin Config:**

```json
{
    "email": "redacted",
    "password": "redacted",
    "debugMode": false,
    "platform": "LitterRobot4"
}```

**Screenshots:**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment:**

* **Plugin Version**: 3.0.0
* **Homebridge Version**: <!-- homebridge -V --> 1.8.2
* **Node.js Version**: <!-- node -v --> 18.18.2
* **NPM Version**: <!-- npm -v --> 9.8.1
* **Operating System**: <!-- Raspbian / Ubuntu / Debian / Windows / macOS / Docker / hb-service --> Raspbian

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
rylee-s commented 1 week ago

Hi! Thanks for the ticket. It's looking like an auth issue by the response code. Can you double check your credentials and restart the instance? I haven't had any other reports of issues 🤔