schnibel / MMM-Memo

This an extension module for the MagicMirror². It adds the ability to manage different kind of memos.
MIT License
34 stars 8 forks source link

Error adding a new/changing old Memo #9

Open Snille opened 6 years ago

Snille commented 6 years ago

I have been using the module for some time. But now I keep getting this error in the pm2 log. I'm on MagicMirror 2.2.0-dev (latest dev version on a RPi3).

This I get when I try to add to a Memo.

0|mm       | [11:11:13 PM] TypeError: Cannot read property 'push' of undefined
0|mm       |     at Class.storeMemos (/home/pi/MagicMirror/modules/MMM-Memo/node_helper.js:106:13)
0|mm       |     at expressApp.get (/home/pi/MagicMirror/modules/MMM-Memo/node_helper.js:45:10)
0|mm       |     at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|mm       |     at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:137:13)
0|mm       |     at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:112:3)
0|mm       |     at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|mm       |     at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:281:22
0|mm       |     at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:335:12)
0|mm       |     at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:275:10)
0|mm       |     at jsonParser (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_modules/body-parser/lib/types/json.js:103:7)

And this when trying to change one.

0|mm       | [11:11:20 PM] TypeError: Cannot read property 'length' of undefined
0|mm       |     at Class.removeMemos (/home/pi/MagicMirror/modules/MMM-Memo/node_helper.js:124:32)
0|mm       |     at expressApp.get (/home/pi/MagicMirror/modules/MMM-Memo/node_helper.js:67:13)
0|mm       |     at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|mm       |     at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:137:13)
0|mm       |     at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:112:3)
0|mm       |     at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|mm       |     at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:281:22
0|mm       |     at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:335:12)
0|mm       |     at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:275:10)
0|mm       |     at jsonParser (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_modules/body-parser/lib/types/json.js:103:7)

I also see that the module don't create the MMM-Memo.josn file (at least it's not present in the MMM-Memo folder any longer.

This is my MMM-Memo part of my config:

        {
            module: "MMM-Memo",
            position: "upper_third",
            classes: "default everyone",
            config: {
                memoTitle: "flyginformation",
                memoDisplayIfEmpty: false,
                memoRotation: -4,
                format: "YYYY-MM-DD - HH:mm",
                memoWidth: 500,
                memoHeight: 500,
                memoDisplayHeader: true,
                memoDisplayDuration: true,
                memoDisplayId: true,
                memoColorBackground: "LightGoldenrod",
                memoDisplayNotification: true,
            }
        },

This is the URL:s I'm trying to execute,

  1. Add infomration (this is used several times adding multiple items to the list with altered information).
    http://10.0.0.112:8080/AddMemo?memoTitle=flyginformation&item=SAS%20%23189%20%20lämnade%20ARN%20%20vid%2018%3A13%20mot%20AGH%20%20ankommer%2018%3A58&level=INFO

    Response in the web browser looks ok, memo shows up (but I get the first error in the pm2 log):

    {"status":"success","item":{"memoTitle":"flyginformation","level":"INFO","item":"SAS #189  lämnade ARN  vid 18:13 mot AGH  ankommer 18:58","timestamp":"2017-10-07T21:28:40.921Z"}}

    And...

  2. Remove item 1.
    http://10.0.0.112:8080/RemoveMemo?memoTitle=flyginformation&item=1

    Nothing happens on the memo but I get this in the web browser (I get the second error in the pm2 log):

    {"status":"success","payload":{"memoTitle":"flyginformation","item":"1"}}

    Then last...

  3. Delete the memo.
    http://10.0.0.112:8080/RemoveMemo?memoTitle=flyginformation&item=ALL

    Response in the web browser looks ok (but I get the second error in the pm2 log):

    {"status":"success","payload":{"memoTitle":"flyginformation","item":"ALL"}}

Funny thing is that the information is added to the Memo and it does show up on the mirror. However, I can not remove an Item or delete the memo once it's there. :) If I refresh the web browser window the whole memo is gone.

Any ideas? :)

schnibel commented 6 years ago

Hi @Snille, First of all, I'm so sorry, I didn't see your message, notifications I received was in my spam folder !!! I just updated MagicMirror to version 2.2.2, and I don't have any problem with this module. Do you still have the problem ?

Snille commented 6 years ago

Hi! Yes, still have the problem. Have you found anything? :)

schnibel commented 6 years ago

Arggghhh, No, I didn't find anything because I cannot reproduce the problem. I'm going to use the MagicMirror 2.2.0-dev branch, in order to see if I can reproduce it... Did you try to debug it using breakpoints and so on ?

Snille commented 6 years ago

Hmm... I have not put any more time in to this actually. :) I just tried to delete and reinstall the module. Just to be sure. :) But the problem still persists. Maybe there is another module that is "breaking" yours? I'm not sure if that's even possible. :)

Snille commented 6 years ago

Hi again, I have a secondary mirror (not a real mirror, just the software running on a VM) but on that machine I do not have the same problem it seems... The one I have the problem on is the RPi3 based (real) mirror... The major difference is the CPU power and memory... The RPi is struggling quite a bit with all my modules. Maybe that's the reason? Still, the strange thing is that the "MMM-Memo.json" does not get updated on the RPi3. But it do get updated on the "VM"-one.

schnibel commented 6 years ago

Hummmm... It's weird. I tried using the same distribution than the one you're using, and I don't have any issues. I'm not running it on a rpi3, maybe that's the reason indeed... But I don't see why it could generate this kind of issue. I like your idea of another module interference, could you tell me which are the others modules please ?

Le sam. 3 févr. 2018 à 09:39, Erik Pettersson notifications@github.com a écrit :

Hi again, I have a secondary mirror (not a real mirror, just the software running on a VM) but on that machine I do not have the same problem it seems... The one I have the problem on is the RPi3 based (real) mirror... The major difference is the CPU power and memory... The RPi is struggling quite a bit with all my modules. Maybe that's the reason?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/schnibel/MMM-Memo/issues/9#issuecomment-362790998, or mute the thread https://github.com/notifications/unsubscribe-auth/AXz6JKz2A8rAVcGHswV7mkTokiw4Y6qmks5tRBtZgaJpZM4Pxf7u .

dmartin9999 commented 5 years ago

I am also unable to remove memos using the syntax provided in README.md. Running Raspbian GNU/Linux 9 (stretch) on a Raspberry PI 3 B+