# Anyone having DSM issues with v3.0.0-beta.2?

**URL:** <https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244>\
**Category:** General\
**Created:** [30 May 2022 10:29 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244 "2022-05-30T10:29:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MyRandomThoughts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myrandomthoughts/32/41085_2.png) [@MyRandomThoughts](https://discourse.nodered.org/u/MyRandomThoughts)\
**Post date:** [30 May 2022 10:29 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/1 "2022-05-30T10:29:26Z")

</div>

I am running backups from a DSM node that works perfectly well on v2.2.2 but is not on v3-b2.  
It's a customised version of the backup code found in the [DSM examples wiki](https://github.com/cflurin/node-red-contrib-dsm/wiki/Backup)

Using the `node.warn` messages, I can see that the `init` code is being called, but when I trigger the node the status icon turns black and nothing happens.

Thanks

```auto
{
    "currentState": "ready",
    "states": {
        "ready": {
            "start": "step2",
            "reset": "ready"
        },
        "step2": {
            "tar": "step3",
            "reset": "ready"
        },
        "step3": {
            "output": "ready",
            "reset": "ready"
        }
    },
    "methods": {
        "init": [
            "node.warn('init');",
            "sm.udir = RED.settings.userDir + '/';",
            "sm.exec = require('child_process').exec;"
        ],
        "start": [
            "node.warn('start');",
            "resume('tar', msg);"
        ],
        "tar": [
            "node.warn('tar');",
            "sm.ts = new Date();",
            "sm.days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];",
            "sm.day = sm.days[sm.ts.getDay()];",
            "sm.file = sm.udir + 'TESTING-NodeRED-' + sm.day + '.tar';",
            "var pre = ' ' + sm.udir;",
            "var cmd = 'tar -czvf';",
            "cmd += ' ' + sm.file;",
            "cmd += pre + 'flows*.json';",
            "cmd += pre + '.config*.json';",
            "cmd += pre + 'settings.js';",
            "cmd += pre + 'package.json';",
            "cmd += pre + 'package-lock.json';",
            "cmd += pre + 'lib/*';",
            "sm.fill = 'yellow';",
            "sm.text = 'Compressing...';",
            "output = false;",
            "sm.exec(cmd, function(error, stdout, stderr) {",
            " if (error) {",
            " node.error(error);",
            " } else {",
            " resume('output', msg);",
            " }",
            "});"
        ],
        "output": [
            "node.warn('output');",
            "sm.ts = new Date();",
            "sm.days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];",
            "sm.day = sm.days[sm.ts.getDay()];",
            "sm.file = sm.udir + 'TESTING-NodeRED-' + sm.day + '.tar';",
            "msg.topic = 'Node-RED';",
            "msg.payload = sm.day + ' Backup Complete';",
            "msg.filename = sm.file;",
            "sm.fill = 'green';",
            "sm.text = sm.day;"
        ],
        "reset": [
            "node.warn('reset');",
            "sm.fill = 'grey';",
            "sm.text = 'Reset';",
            "output = false;"
        ],
        "status": {
            "fill": {
                "get": "sm.fill"
            },
            "text": {
                "get": "sm.text"
            },
            "shape": "dot"
        }
    }
}

```

EDIT, removed extra comma, thanks @cflurin. Still not working tho.

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [30 May 2022 16:04 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/2 "2022-05-30T16:04:27Z")

</div>

There is an error in your code:

> [@MyRandomThoughts](#):
>
> ` "sm.exec = require('child_process').exec;",`

it should be (without comma):

> [@](#):
>
> ` "sm.exec = require('child_process').exec;"`

---

<div class="post-metadata">

**Author:** ![MyRandomThoughts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myrandomthoughts/32/41085_2.png) [@MyRandomThoughts](https://discourse.nodered.org/u/MyRandomThoughts)\
**Post date:** [30 May 2022 16:51 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/3 "2022-05-30T16:51:14Z")

</div>

Oops, that was a last minute edit in the copy/paste.  
Still doesn't work for me after checking.

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [30 May 2022 18:06 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/4 "2022-05-30T18:06:28Z")

</div>

> [@MyRandomThoughts](#):
>
> Still doesn't work for me after checking.

Strange, it works for me.  
Raspberry Pi, node-red 3.0.0-beta.2

```auto
"Monday Backup Complete"

```

---

<div class="post-metadata">

**Author:** ![MyRandomThoughts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myrandomthoughts/32/41085_2.png) [@MyRandomThoughts](https://discourse.nodered.org/u/MyRandomThoughts)\
**Post date:** [30 May 2022 19:01 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/5 "2022-05-30T19:01:24Z")

</div>

Um, thanks. I'll have another play then.

---

<div class="post-metadata">

**Author:** ![MyRandomThoughts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myrandomthoughts/32/41085_2.png) [@MyRandomThoughts](https://discourse.nodered.org/u/MyRandomThoughts)\
**Post date:** [14 June 2022 19:40 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/6 "2022-06-14T19:40:30Z")

</div>

I was an idiot. When I was using a trigger node to test it, I wasn't setting the topic to "start" and therefore the DSM node didn't know what to do. Doh!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 June 2022 19:40 UTC](https://discourse.nodered.org/t/anyone-having-dsm-issues-with-v3-0-0-beta-2/63244/7 "2022-06-28T19:40:48Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
