fdegier / homebridge-jablotron-alarm

Homebridge plugin for connecting Jablotron JA-100 alarm systems to Homekit.
The Unlicense
26 stars 6 forks source link

code: 'METHOD.NOT-SUPPORTED' #58

Closed grzegorz914 closed 2 years ago

grzegorz914 commented 3 years ago

@F4stFr3ddy from time to time this error appears in the log

[24.08.2021, 10:52:41] [Alarm] {
  'http-code': 200,
  errors: [
    {
      code: 'METHOD.NOT-SUPPORTED',
      message: 'Unknown method.',
      debug: 'Unknown method.'
    }
  ]
}
[24.08.2021, 10:52:41] [Alarm] Error: 
    at /usr/lib/node_modules/homebridge-jablotron/lib/jablotron-client.js:25:31
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-jablotron/lib/jablotron-client.js:57:21)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1317:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
fdegier commented 3 years ago

Might have to add a bit more debugging to find where this is coming from. I have never seen it in my logs nor experienced an issue. When this occurs, do you experience any issues?

grzegorz914 commented 3 years ago

This haven’t no any impakt on plugin functionality, this happens every day.

grzegorz914 commented 2 years ago

@F4stFr3ddy this error still exist every day, any solution

fdegier commented 2 years ago

Interesting, I do not see this error in my logs. I will take another look at it, perhaps I can find something.

MvD66 commented 2 years ago

I see the same error, almost daily, and If it occurs it is at the same time:

[29/10/2021, 04:40:24] [Jablotron] { 'http-code': 200, errors: [ { code: 'METHOD.NOT-SUPPORTED', message: 'Unknown method.', debug: 'Unknown method.' } ] } [29/10/2021, 04:40:24] [Jablotron] Error: at /usr/lib/node_modules/homebridge-jablotron/lib/jablotron-client.js:25:31 at IncomingMessage. (/usr/lib/node_modules/homebridge-jablotron/lib/jablotron-client.js:57:21) at IncomingMessage.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1317:12) at processTicksAndRejections (internal/process/task_queues.js:82:21)

fdegier commented 2 years ago

Ok guys, thanks for reporting. This weekend I will spend some time on debugging.

fdegier commented 2 years ago

Btw, do you have any alerting on these errors?

grzegorz914 commented 2 years ago

On my side all working fine with this error

fdegier commented 2 years ago

On my side all working fine with this error

Same for me, that's why I haven't put that much effort in finding the root cause.

grzegorz914 commented 2 years ago

I see the same error, almost daily, and If it occurs it is at the same time:

[29/10/2021, 04:40:24] [Jablotron] { 'http-code': 200, errors: [ { code: 'METHOD.NOT-SUPPORTED', message: 'Unknown method.', debug: 'Unknown method.' } ] } [29/10/2021, 04:40:24] [Jablotron] Error: at /usr/lib/node_modules/homebridge-jablotron/lib/jablotron-client.js:25:31 at IncomingMessage. (/usr/lib/node_modules/homebridge-jablotron/lib/jablotron-client.js:57:21) at IncomingMessage.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1317:12) at processTicksAndRejections (internal/process/task_queues.js:82:21)

Exactly the error appear on my side in the same time, that must be something wrong with Jablotron server side.

fdegier commented 2 years ago

Situation I have given it some thought and come to the following. The problem seems to be on Jablotron side, for some reason at this time, and perhaps some other random times, the request send to Jablotron results in unexpected behavior, due to the error handling already in place, the error is caught and normal operation continues. This suspicion is strenghtened by the fact that we receive a 200.

Possible solutions

Questions

Source code

this.doRequest(endpoint, payload, cookies, function (response) {
            if (response['status']) {
                successCallback(response);
            } else if (response['error_message'] == 'Operation failed') {
                errorCallback(new Error('Operation failed'))
            } else {
                self.log(response);
                errorCallback(new Error(response['error_status']))
            }

What do you guys think? Am I overlooking a possibility here?

grzegorz914 commented 2 years ago

No, I don't have alerting notification, for me this error can be omitted if happens. This error have no impact on system functionality at this time.

fdegier commented 2 years ago

@grzegorz914 can you check #59 ?

grzegorz914 commented 2 years ago

Look’s good to me

grzegorz914 commented 2 years ago

@fdegier

when You push fixed version 2.3.1 to NPM?

fdegier commented 2 years ago

I wanted to test it on my installation first but haven't gotten around to doing that. I will test it today and release.