Giter Site home page Giter Site logo

Comments (9)

mrbungle64 avatar mrbungle64 commented on July 16, 2024

@winnieXY

Do I see that correctly, that problem occurs in this case with Node-RED?
Can you give me more details about the circumstances under which this occurs?

from ecovacs-deebot.js.

winnieXY avatar winnieXY commented on July 16, 2024

Yes, correct.

I can extract the nodes and provide them if needed. But it's basically just data retrieval which is parsed then by node-red.

I've no clue yet which message crashed it. For the time being i added a try catch around it and some console.error things to get more details.

from ecovacs-deebot.js.

winnieXY avatar winnieXY commented on July 16, 2024

Here we go:
First again the stacktrace:

TypeError: Cannot read properties of undefined (reading 'data')
    at EcovacsMQTT_JSON.handleMessage (/data/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:94:32)
    at MqttClient.<anonymous> (/data/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:73:18)
    at MqttClient.emit (node:events:527:28)
    at MqttClient._handlePublish (/data/node_modules/mqtt/lib/client.js:1547:12)
    at MqttClient._handlePacket (/data/node_modules/mqtt/lib/client.js:535:12)
    at work (/data/node_modules/mqtt/lib/client.js:438:12)
    at Writable.writable._write (/data/node_modules/mqtt/lib/client.js:452:5)
    at doWrite (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at Writable.write (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at TLSSocket.ondata (node:internal/streams/readable:754:22)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

This is the message which caused the crash:
{ td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }

This is my modification to the code for reference:

        try {
                if (type === "incoming") {
                    eventName = topic.split('/')[2];
                    message = JSON.parse(message);
                    payload = message['body']['data']; //<-- crashing here
                } else if (type === "response") {
                    resultCode = message['body']['code'];
                    resultCodeMessage = message['body']['msg'];
                    payload = message['body']['data'];
                    if (message['header']) {
                        const header = message['header'];
                        if (this.vacBot.firmwareVersion !== header['fwVer']) {
                            this.vacBot.firmwareVersion = header['fwVer'];
                            this.emit('HeaderInfo', {
                                'fwVer': header['fwVer'],
                                'hwVer': header['hwVer']
                            });
                        }
                    }
                } else if (type === "logResponse") {
                    resultCodeMessage = message['ret'];
                }
        }
        catch (error) {
            console.error(error)
            console.error(message)
        }

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 16, 2024

@winnieXY

This is the message which caused the crash:
{ td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }

Where did you log this message and was it caused by sending a command?
I think a message with this structure is a bit unusual.

from ecovacs-deebot.js.

winnieXY avatar winnieXY commented on July 16, 2024

The output ist from the second console.error statement within the catch. The stack trace is from the first console.error Statement.

from ecovacs-deebot.js.

winnieXY avatar winnieXY commented on July 16, 2024

grafik

This is the screenshot of the Deebot node which is causing that crash. So I just use it as input - till now I've never send a command to the node.

from ecovacs-deebot.js.

winnieXY avatar winnieXY commented on July 16, 2024

So after several days of running: It doesn't crash nodered anymore. However I see on a irregular basis these stacktraces in the error log:

[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) TypeError: Cannot read properties of undefined (reading 'data')
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at EcovacsMQTT_JSON.handleMessage (/data/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:94:32)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient.<anonymous> (/data/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:73:18)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient._handlePublish (/data/node_modules/mqtt/lib/client.js:1547:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient._handlePacket (/data/node_modules/mqtt/lib/client.js:535:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at work (/data/node_modules/mqtt/lib/client.js:438:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at Writable.writable._write (/data/node_modules/mqtt/lib/client.js:452:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at doWrite (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at writeOrBuffer (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at Writable.write (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSSocket.ondata (node:internal/streams/readable:754:22)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSSocket.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at addChunk (node:internal/streams/readable:315:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at readableAddChunk (node:internal/streams/readable:289:9)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) { td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) TypeError: Cannot read properties of undefined (reading 'data')
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at EcovacsMQTT_JSON.handleMessage (/data/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:94:32)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient.<anonymous> (/data/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:73:18)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient._handlePublish (/data/node_modules/mqtt/lib/client.js:1547:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at MqttClient._handlePacket (/data/node_modules/mqtt/lib/client.js:535:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at work (/data/node_modules/mqtt/lib/client.js:438:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at Writable.writable._write (/data/node_modules/mqtt/lib/client.js:452:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at doWrite (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at writeOrBuffer (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at Writable.write (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSSocket.ondata (node:internal/streams/readable:754:22)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSSocket.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at addChunk (node:internal/streams/readable:315:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at readableAddChunk (node:internal/streams/readable:289:9)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1)     at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) { td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }

It's always the same IP which does not belong to my network. As an example I added two subsequent crashes from the error log here. Sadly I forgot to add timestamps into the log message ..

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 16, 2024

@winnieXY

Thanks for the information 👍🏻
I will implement some code to handle this message when I find the time (maybe already in a few days).

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 16, 2024

@winnieXY

This should be fixed with version 0.4.3 of node-red-contrib-ecovacs-deebot

from ecovacs-deebot.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.