PhilippEngler / eufy-security-hm

AddOn for HomeMatic CCU and compatible devices to interact with eufy security devices.
MIT License
13 stars 2 forks source link

Set Guard Mode is Failing #10

Closed alexbde closed 1 year ago

alexbde commented 1 year ago

Describe the bug Since 2-3 weeks setting the guard mode (either manually or via API) is no longer working. It was working before. I first noticed using version 2.1.1 and experience the same issue after upgrading to version 2.2.0.

To Reproduce Steps to reproduce the behavior:

  1. Go to Statusänderung
  2. Click on any mode, e. g. abwesend
  3. See error in the lower right corner and Error occured at setGuardMode: Failed to communicate with station. in the log

As an alternative: execute system.Exec("curl -sS http://192.168.<redacted>:5<redacted>/setMode/schedule &"); in the CCU.

Expected behavior The guard mode is set to the chosen value.

Screenshots

Bildschirmfoto 2023-08-25 um 10 26 32

Desktop/Mobile Device (please complete the following information):

CCU/RaspberryMatic (please complete the following information):

Additional context There is an additional onSocketError Error: read ECONNRESET in the logs, every night at around 4 am without manual interaction.

``` 2023-08-23 17:24:25 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-23 19:03:06 - onSocketError Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' } 2023-08-23 20:57:10 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 03:55:23 - onSocketError Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' } 2023-08-24 07:16:49 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 15:04:55 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 15:11:11 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 15:13:24 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 15:21:17 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 19:07:55 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-24 21:40:37 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-25 03:54:33 - onSocketError Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' } 2023-08-25 07:49:49 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-25 09:16:12 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-25 10:13:40 - Error occured at setGuardMode: Failed to communicate with station. 2023-08-25 10:14:11 - Error occured at setGuardMode: Failed to communicate with station. ```
alexbde commented 1 year ago

Right after creating the issue I noticed there is a pre-release that might fix the issue 🙈

I'll test with the pre-release.

PhilippEngler commented 1 year ago

No worries, the beta should solve the problem for the homebases. Please leave this issue open, I will close it on releasing the next release, thank you.

alexbde commented 1 year ago

Sadly, this is not solving the issue, because it looks like the eufy Security server is no longer starting:

Bildschirmfoto 2023-08-26 um 10 48 36

The restart service button is not working, restarting the CCU ends in the same result.

Any idea what is wrong? It is not even displaying the log information. How can I supply further information to you?

PhilippEngler commented 1 year ago

Please establish a ssh connection to your CCU and check the two logsfiles /var/log/eufySecurity.log and /var/log/eufySecurity.err. In your case, the eufySecurity.err should contain the cause.

alexbde commented 1 year ago

Here we go, cat /var/log/eufySecurity.err:

``` /usr/local/addons/eufySecurity/node_modules/axios/dist/node/axios.cjs:1909 reject(new AxiosError( ^ AxiosError: Request failed with status code 503 at settle (/usr/local/addons/eufySecurity/node_modules/axios/dist/node/axios.cjs:1909:12) at IncomingMessage.handleStreamEnd (/usr/local/addons/eufySecurity/node_modules/axios/dist/node/axios.cjs:2989:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'ERR_BAD_RESPONSE', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function: FormData] { LINE_BREAK: '\r\n', DEFAULT_CONTENT_TYPE: 'application/octet-stream' }, Blob: null }, validateStatus: [Function: validateStatus], headers: AxiosHeaders { Accept: 'application/json, text/plain, */*', 'Content-Type': 'text/plain', 'User-Agent': 'axios/1.4.0', 'Content-Length': '92', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'post', url: 'http://localhost:8181/esapi.exe', data: "dom.GetObject(ID_SYSTEM_VARIABLES).Get('eufyCentralState').State('Zeitplan')" }, request: ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _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: '92', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Function: onReadableStreamEnd], free: [Function: onFree], close: [ [Function: onClose], [Function: socketCloseListener] ], timeout: [Function: onTimeout], agentRemove: [Function: onRemove], error: [Function: socketErrorListener], finish: [Function: bound onceWrapper] { listener: [Function: destroy] } }, _eventsCount: 7, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 1, constructed: true, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: TCP { reading: true, onconnection: null, [Symbol(owner_symbol)]: [Circular *2] }, [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(RequestTimeout)]: undefined }, _header: 'POST /esapi.exe HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'Content-Type: text/plain\r\n' + 'User-Agent: axios/1.4.0\r\n' + 'Content-Length: 92\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: localhost:8181\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype] { free: [Function (anonymous)], newListener: [Function: maybeEnableKeylog] }, _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype] { path: null }, requests: [Object: null prototype] {}, sockets: [Object: null prototype] { 'localhost:8181:': [ Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: [TCP], [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(RequestTimeout)]: undefined }, Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 8, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: [HTTPParser], _httpMessage: [ClientRequest], [Symbol(async_id_symbol)]: 1323, [Symbol(kHandle)]: [TCP], [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 }, Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 8, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: [HTTPParser], _httpMessage: [ClientRequest], [Symbol(async_id_symbol)]: 1326, [Symbol(kHandle)]: [TCP], [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 }, Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 8, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: [HTTPParser], _httpMessage: [ClientRequest], [Symbol(async_id_symbol)]: 1329, [Symbol(kHandle)]: [TCP], [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 }, Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 8, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: [HTTPParser], _httpMessage: [ClientRequest], [Symbol(async_id_symbol)]: 1332, [Symbol(kHandle)]: [TCP], [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 } ] }, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 5, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/esapi.exe', _ended: true, res: IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: true, endEmitted: true, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: true, errored: null, closed: true, closeEmitted: true, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: true, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [ [Function: responseOnEnd], [Function: handleStreamEnd] ], error: [Function: handleStreamError], data: [Function: handleStreamData], aborted: [Function: handlerStreamAborted] }, _eventsCount: 4, _maxListeners: undefined, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Function: onReadableStreamEnd], free: [Function: onFree], close: [ [Function: onClose], [Function: socketCloseListener] ], timeout: [Function: onTimeout], agentRemove: [Function: onRemove], error: [Function: socketErrorListener], finish: [Function: bound onceWrapper] { listener: [Function: destroy] } }, _eventsCount: 7, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 1, constructed: true, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: TCP { reading: true, onconnection: null, [Symbol(owner_symbol)]: [Circular *2] }, [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(RequestTimeout)]: undefined }, httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [ 'Content-Type', 'text/html', 'X-Frame-Options', 'SAMEORIGIN', 'X-Content-Type-Options', 'nosniff', 'X-XSS-Protection', '1; mode=block', 'X-Robots-Tag', 'none', 'X-Download-Options', 'noopen', 'X-Permitted-Cross-Domain-Policies', 'none', 'Referrer-Policy', 'no-referrer', 'Cache-Control', 'private, no-cache, must-revalidate, no-transform, max-age=0', 'Content-Length', '3093', 'Connection', 'close', 'Date', 'Sat, 26 Aug 2023 07:41:40 GMT' ], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 503, statusMessage: 'Service Not Available', client: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Function: onReadableStreamEnd], free: [Function: onFree], close: [ [Function: onClose], [Function: socketCloseListener] ], timeout: [Function: onTimeout], agentRemove: [Function: onRemove], error: [Function: socketErrorListener], finish: [Function: bound onceWrapper] { listener: [Function: destroy] } }, _eventsCount: 7, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 1, constructed: true, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: TCP { reading: true, onconnection: null, [Symbol(owner_symbol)]: [Circular *2] }, [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(RequestTimeout)]: undefined }, _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://localhost:8181/esapi.exe', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: { 'content-type': 'text/html', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-robots-tag': 'none', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'referrer-policy': 'no-referrer', 'cache-control': 'private, no-cache, must-revalidate, no-transform, max-age=0', 'content-length': '3093', connection: 'close', date: 'Sat, 26 Aug 2023 07:41:40 GMT' }, [Symbol(kHeadersCount)]: 24, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError], socket: [Function: handleRequestSocket] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: Infinity, protocol: 'http:', path: '/esapi.exe', method: 'POST', headers: [Object: null prototype] { Accept: 'application/json, text/plain, */*', 'Content-Type': 'text/plain', 'User-Agent': 'axios/1.4.0', 'Content-Length': '92', 'Accept-Encoding': 'gzip, compress, deflate, br' }, agents: { http: undefined, https: undefined }, auth: undefined, family: undefined, lookup: undefined, beforeRedirect: [Function: dispatchBeforeRedirect], beforeRedirects: { proxy: [Function: beforeRedirect] }, hostname: 'localhost', port: '8181', agent: undefined, nativeProtocols: { 'http:': { _connectionListener: [Function: connectionListener], METHODS: [Array], STATUS_CODES: [Object], Agent: [Function], ClientRequest: [Function: ClientRequest], IncomingMessage: [Function: IncomingMessage], OutgoingMessage: [Function: OutgoingMessage], Server: [Function: Server], ServerResponse: [Function: ServerResponse], createServer: [Function: createServer], validateHeaderName: [Function: __node_internal_], validateHeaderValue: [Function: __node_internal_], get: [Function: get], request: [Function: request], setMaxIdleHTTPParsers: [Function: setMaxIdleHTTPParsers], maxHeaderSize: [Getter], globalAgent: [Getter/Setter] }, 'https:': { Agent: [Function: Agent], globalAgent: [Agent], Server: [Function: Server], createServer: [Function: createServer], get: [Function: get], request: [Function: request] } }, pathname: '/esapi.exe' }, _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 92, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://localhost:8181/esapi.exe', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [ 'Accept', 'application/json, text/plain, */*' ], 'content-type': [ 'Content-Type', 'text/plain' ], 'user-agent': [ 'User-Agent', 'axios/1.4.0' ], 'content-length': [ 'Content-Length', '92' ], 'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ], host: [ 'Host', 'localhost:8181' ] }, [Symbol(kUniqueHeaders)]: null }, response: { status: 503, statusText: 'Service Not Available', headers: AxiosHeaders { 'content-type': 'text/html', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-robots-tag': 'none', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'referrer-policy': 'no-referrer', 'cache-control': 'private, no-cache, must-revalidate, no-transform, max-age=0', 'content-length': '3093', connection: 'close', date: 'Sat, 26 Aug 2023 07:41:40 GMT' }, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function: FormData] { LINE_BREAK: '\r\n', DEFAULT_CONTENT_TYPE: 'application/octet-stream' }, Blob: null }, validateStatus: [Function: validateStatus], headers: AxiosHeaders { Accept: 'application/json, text/plain, */*', 'Content-Type': 'text/plain', 'User-Agent': 'axios/1.4.0', 'Content-Length': '92', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'post', url: 'http://localhost:8181/esapi.exe', data: "dom.GetObject(ID_SYSTEM_VARIABLES).Get('eufyCentralState').State('Zeitplan')" }, request: ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _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: '92', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Function: onReadableStreamEnd], free: [Function: onFree], close: [ [Function: onClose], [Function: socketCloseListener] ], timeout: [Function: onTimeout], agentRemove: [Function: onRemove], error: [Function: socketErrorListener], finish: [Function: bound onceWrapper] { listener: [Function: destroy] } }, _eventsCount: 7, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 1, constructed: true, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: TCP { reading: true, onconnection: null, [Symbol(owner_symbol)]: [Circular *2] }, [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(RequestTimeout)]: undefined }, _header: 'POST /esapi.exe HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'Content-Type: text/plain\r\n' + 'User-Agent: axios/1.4.0\r\n' + 'Content-Length: 92\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: localhost:8181\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype] { free: [Function (anonymous)], newListener: [Function: maybeEnableKeylog] }, _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype] { path: null }, requests: [Object: null prototype] {}, sockets: [Object: null prototype] { 'localhost:8181:': [ [Socket], [Socket], [Socket], [Socket], [Socket] ] }, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 5, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/esapi.exe', _ended: true, res: IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: true, endEmitted: true, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: true, errored: null, closed: true, closeEmitted: true, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: true, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [ [Function: responseOnEnd], [Function: handleStreamEnd] ], error: [Function: handleStreamError], data: [Function: handleStreamData], aborted: [Function: handlerStreamAborted] }, _eventsCount: 4, _maxListeners: undefined, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: [BufferList], length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Function: onReadableStreamEnd], free: [Function: onFree], close: [Array], timeout: [Function: onTimeout], agentRemove: [Function: onRemove], error: [Function: socketErrorListener], finish: [Function] }, _eventsCount: 7, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 1, constructed: true, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: TCP { reading: true, onconnection: null, [Symbol(owner_symbol)]: [Circular *2] }, [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(RequestTimeout)]: undefined }, httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [ 'Content-Type', 'text/html', 'X-Frame-Options', 'SAMEORIGIN', 'X-Content-Type-Options', 'nosniff', 'X-XSS-Protection', '1; mode=block', 'X-Robots-Tag', 'none', 'X-Download-Options', 'noopen', 'X-Permitted-Cross-Domain-Policies', 'none', 'Referrer-Policy', 'no-referrer', 'Cache-Control', 'private, no-cache, must-revalidate, no-transform, max-age=0', 'Content-Length', '3093', 'Connection', 'close', 'Date', 'Sat, 26 Aug 2023 07:41:40 GMT' ], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 503, statusMessage: 'Service Not Available', client: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: [BufferList], length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: true, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Function: onReadableStreamEnd], free: [Function: onFree], close: [Array], timeout: [Function: onTimeout], agentRemove: [Function: onRemove], error: [Function: socketErrorListener], finish: [Function] }, _eventsCount: 7, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 1, constructed: true, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 1320, [Symbol(kHandle)]: TCP { reading: true, onconnection: null, [Symbol(owner_symbol)]: [Circular *2] }, [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(RequestTimeout)]: undefined }, _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://localhost:8181/esapi.exe', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: { 'content-type': 'text/html', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-robots-tag': 'none', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'referrer-policy': 'no-referrer', 'cache-control': 'private, no-cache, must-revalidate, no-transform, max-age=0', 'content-length': '3093', connection: 'close', date: 'Sat, 26 Aug 2023 07:41:40 GMT' }, [Symbol(kHeadersCount)]: 24, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError], socket: [Function: handleRequestSocket] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: Infinity, protocol: 'http:', path: '/esapi.exe', method: 'POST', headers: [Object: null prototype] { Accept: 'application/json, text/plain, */*', 'Content-Type': 'text/plain', 'User-Agent': 'axios/1.4.0', 'Content-Length': '92', 'Accept-Encoding': 'gzip, compress, deflate, br' }, agents: { http: undefined, https: undefined }, auth: undefined, family: undefined, lookup: undefined, beforeRedirect: [Function: dispatchBeforeRedirect], beforeRedirects: { proxy: [Function: beforeRedirect] }, hostname: 'localhost', port: '8181', agent: undefined, nativeProtocols: { 'http:': [Object], 'https:': [Object] }, pathname: '/esapi.exe' }, _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 92, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://localhost:8181/esapi.exe', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [ 'Accept', 'application/json, text/plain, */*' ], 'content-type': [ 'Content-Type', 'text/plain' ], 'user-agent': [ 'User-Agent', 'axios/1.4.0' ], 'content-length': [ 'Content-Length', '92' ], 'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ], host: [ 'Host', 'localhost:8181' ] }, [Symbol(kUniqueHeaders)]: null }, data: '\r\n' + '\r\n' + ' \r\n' + ' \r\n' + ' HomeMatic\r\n' + '\r\n' + ' \r\n' + ' \r\n' + ' \r\n' + ' \r\n' + ' \r\n' + ' \r\n' + ' \r\n' + ' \r\n' + '\r\n' + ' \r\n' + '\r\n' + ' \r\n' + '\r\n' + ' \r\n' + '\r\n' + ' \r\n' + '\r\n' } } ```

Any insights based on that log?

PhilippEngler commented 1 year ago

Just a fast shot in the dark: Have you changed something with your CCUs firewall settings or addon settings? It looks like, that the addon could not connect to port 8081 (Homematic-Script API). This is used for all the stuff regarding system variables.

alexbde commented 1 year ago

The only thing I changed recently is that I uninstalled the NEO server. Not sure if this has any impact on the eufy Security addon.

I figured out, the eufy Security addon is not starting automatically after CCU restart. It is still showing this error. After hitting the restart button on the addon details page...

Bildschirmfoto 2023-08-27 um 21 16 20

...the plugin is working again o.O And it is switching guard modes again! :) But this starting issue is still strange.

PhilippEngler commented 1 year ago

No, the NEO server addon has no impact on this addon. Does the error logfile contains the same error after rebooting?

alexbde commented 1 year ago

The log is cleared on reboot, correct? If yes, it still contains the error:

/usr/local/addons/eufySecurity/node_modules/axios/dist/node/axios.cjs:1909
   reject(new AxiosError(
          ^
AxiosError: Request failed with status code 503

There is another one from yesterday night:

2023-08-28 03:01:55 - Station <redacted> - All address lookup tentatives failed.
2023-08-28 03:51:58 - onSocketError Error: read ECONNRESET
   at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
 errno: -104,
 code: 'ECONNRESET',
 syscall: 'read'
}
PhilippEngler commented 1 year ago

Yes, the log files are cleared on reboot, because there are located in the ram.

Meanwhile, I test a solution regarding service crashing. After that, the service should in your case not crashing anymore on startup, but this will not resolve your problem. Maybe, we will get an idea where the problem is located.

The other two error entries occurring from time to time.

PhilippEngler commented 1 year ago

Please give the new v2.2.1-b5 a try. As outlined, you will receive a error message but the addon should not crash anymore.

alexbde commented 1 year ago

Please give the new v2.2.1-b5 a try. As outlined, you will receive a error message but the addon should not crash anymore.

I tested and the service is no longer crashing on startup 👍 There are still the error messages as you said though:

``` 2023-08-30 13:04:34 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:34 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:34 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:34 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:34 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:44 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:44 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:44 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:44 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 2023-08-30 13:04:44 - CCU request error on setSystemVariable(): code: ERR_BAD_RESPONSE; message: Request failed with status code 503 ```
PhilippEngler commented 1 year ago

Ok, that's good. The problem is now, that the CCU will not accepts the requests. If this occurs only after (re)start, than the service on the CCU will take some time to come up. You can try to check the CCU logs, but this might have not been related to this add-on.

alexbde commented 1 year ago

Successfully tested with version 2.2.1. Thank you very much for handling this issue short-term!