I've broken the Deploy button

Hi team,

I imported some nodes into my flow (a flow dedicated to my Dashboard) and since doing that I now can't get the Deploy button to work. It worked once, the nodes deployed - I suffered instant regret because I should have put them into a separate flow for testing - and now I can't get rid of them.

I've refreshed, Ctrl-F5'd, logged out and back in, cleared browser cache and it's still not vorking.

I do have backups, but I thought you might be interested in this.

Here is the flow:

[{"id":"9a81c902.a90078","type":"subflow","name":"Get all future rates from DB","info":"","category":"","in":[{"x":120,"y":80,"wires":[{"id":"e51dfadb.9d7028"}]}],"out":[{"x":640,"y":80,"wires":[{"id":"8b5b9ec6.0300c","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"e51dfadb.9d7028","type":"function","z":"9a81c902.a90078","name":"Create InfluxQL Query","func":"// Get all future HH rates from the database.\n// We are asking for all records with a timestamp\n// that is newer than 30 minutes old...\n\nmsg.query = \"SELECT (\\\"value_inc_vat\\\") FROM \\\"agile\\\" WHERE time > NOW() -30m\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":80,"wires":[["8b5b9ec6.0300c"]]},{"id":"8b5b9ec6.0300c","type":"influxdb in","z":"9a81c902.a90078","influxdb":"8cfff909.7d4a98","name":"Query InfluxDB","query":"","rawOutput":false,"precision":"","retentionPolicy":"","x":500,"y":80,"wires":[[]]},{"id":"8cfff909.7d4a98","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"agile","name":"","usetls":false,"tls":""},{"id":"87c43538.912d48","type":"tab","label":"Dashboard","disabled":false,"info":""},{"id":"b530d23e.1858a","type":"inject","z":"87c43538.912d48","name":"Tick","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"30","topic":"","payload":"","payloadType":"date","x":190,"y":180,"wires":[["8c3bb1a8.45278","e9787e17.bbca6"]]},{"id":"b70abe5a.21a05","type":"function","z":"87c43538.912d48","name":"Prepare graph","func":"// Prepares the line graph in the format:\n\n// [{\n//   \"series\": [\"Price\"],\n//   \"data\": [\n//       [{ \"x\": 1504029632890, \"y\": 5 },\n//        { \"x\": 1504029636001, \"y\": 4 },\n//        { \"x\": 1504029638656, \"y\": 2 }\n//       ]\n//   ],\n//   \"labels\": [\"\"]\n// }]\n\nlet data = [];\nlet labels = [];\nlet series = [\"Price\", \"Now\"];\nlet dataSeries = [];\n\nlet leftX = 0;\nlet rightX = 0;\nlet max = 0;\nlet min = 0;\n\nfor (let i=0; i<msg.payload.length; i++) {\n    \n    let item = {};\n    item['x'] = Date.parse(msg.payload[i].time);\n    item['y'] = msg.payload[i].value_inc_vat;\n\n    if (i === 0) {\n        leftX = item['x'];\n    }\n    else if (i == (msg.payload.length - 1)) {\n        rightX = item['x'];\n    }\n    \n    // update min/max for vertical line\n    if (item['y'] > max) {\n        max = item['y'];\n    }\n    else if (item['y'] < min) {\n        min = item['y'];\n    }\n    \n    dataSeries.push(item);    \n}\n\ndata.push(dataSeries);\n\n// Now - a vertical line to show current time\ndataSeries = [ { 'x': Date.now(), 'y': (max + 2)}, { 'x': Date.now(), 'y': (min - 2)}];\ndata.push(dataSeries);\n\n// A horizontal line to show zero cost\nif (leftX && rightX) {\n    series.push(\"Average\");\n    dataSeries = [ { 'x': leftX, 'y': global.get(\"AverageRate\")}, { 'x': rightX, 'y': global.get(\"AverageRate\")}];\n    data.push(dataSeries);\n}\n\nlabels.push(\"\");\n\nlet info = {};\ninfo.series = series;\ninfo.data = data;\ninfo.labels = labels;\n\n\nmsg.payload = [];\nmsg.payload.push(info);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":180,"wires":[["393ec820.525598"]]},{"id":"393ec820.525598","type":"ui_chart","z":"87c43538.912d48","name":"Rate graph","group":"ae915ea8.0aa29","order":1,"width":"10","height":"5","label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"step","nodata":"","dot":false,"ymin":"-5","ymax":"35","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#1f77b4","#e46c02","#00ee48","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1030,"y":180,"wires":[[]]},{"id":"2e576985.6e5fc6","type":"ui_gauge","z":"87c43538.912d48","name":"Current cost","group":"25e674f1.1956fc","order":1,"width":"5","height":"3","gtype":"gage","title":"","label":"p/kWh","format":"{{value}}","min":"-5","max":"30","colors":["#00ff1e","#e69100","#cb3a3a"],"seg1":"","seg2":"","x":1090,"y":140,"wires":[]},{"id":"8860ac74.0bcee","type":"comment","z":"87c43538.912d48","name":"Refresh display every minute","info":"","x":160,"y":60,"wires":[]},{"id":"8c3bb1a8.45278","type":"subflow:9a81c902.a90078","z":"87c43538.912d48","name":"","x":420,"y":140,"wires":[["b70abe5a.21a05","3745b9d0.0e2036"]]},{"id":"4be0ab76.0eed34","type":"ui_switch","z":"87c43538.912d48","name":"","label":"Water Heater","tooltip":"","group":"b283c8d1.6b62c8","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"ON","onvalueType":"str","onicon":"","oncolor":"","offvalue":"OFF","offvalueType":"str","officon":"","offcolor":"","x":190,"y":280,"wires":[["2336951d.65e96a"]]},{"id":"2336951d.65e96a","type":"link out","z":"87c43538.912d48","name":"WH (Dashboard)","links":["2562a740.8ca748","5ad4a919.d17c38"],"x":305,"y":280,"wires":[]},{"id":"adce0d0a.02f7e","type":"ui_switch","z":"87c43538.912d48","name":"","label":"Fan Heater","tooltip":"","group":"b283c8d1.6b62c8","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"ON","onvalueType":"str","onicon":"","oncolor":"","offvalue":"OFF","offvalueType":"str","officon":"","offcolor":"","x":190,"y":340,"wires":[["906eed1.711ee1"]]},{"id":"906eed1.711ee1","type":"link out","z":"87c43538.912d48","name":"FH (Dashboard)","links":["d5dfbc97.87888","5ad4a919.d17c38"],"x":305,"y":340,"wires":[]},{"id":"8c3d0e01.7482e","type":"ui_text","z":"87c43538.912d48","group":"ae915ea8.0aa29","order":1,"width":"7","height":"1","name":"Ave/Min/Max","label":"","format":"{{msg.payload}}","layout":"col-center","x":1030,"y":220,"wires":[]},{"id":"e9787e17.bbca6","type":"function","z":"87c43538.912d48","name":"Prepare text","func":"var whauto = global.get(\"waterheater.onAuto\") ? \" (Auto)*\\n\" : \"*\\n\";\nvar fhauto = global.get(\"fanheater.onAuto\") ? \" (Auto)*\" : \"*\";\nvar washerarmed = global.get(\"washer.Armed\") ? \", Armed*\" : \"*\";\nvar washerpower = global.get(\"washer.Status\") == \"ON\" ? \", \" + global.get(\"washer.Power\") + \"W\\n\" : \"\\n\";\nvar fhpower = global.get(\"fanheater.Status\") == \"ON\" ? \", \" + global.get(\"fanheater.Power\") + \"W\\n\" : \"\\n\"\nvar dysonpower = global.get(\"dyson.Status\") == \"ON\" ? \", \" + global.get(\"dyson.Power\") + \"W\\n\" : \"\\n\"\nvar recieverpower = global.get(\"receiver.Status\") == \"ON\" ? \", \" + global.get(\"receiver.Power\") + \"W\\n\" : \"\\n\"\nvar serverpower = global.get(\"server.Status\") == \"ON\" ? \", \" + global.get(\"server.Power\") + \"W\\n\" : \"\\n\"\nvar dryerpower = global.get(\"dryer.Status\") == \"ON\" ? \", \" + global.get(\"dryer.Power\") + \"W\\n\" : \"\\n\"\nvar dryerarmed = global.get(\"dryer.Armed\") ? \", Armed*\" : \"*\";\n\nmsg.payload = \"Average: \" + global.get(\"AverageRate\").toFixed(1) + \"p, \" +\n            \"Max: \" + global.get(\"MaxRate\").toFixed(1) + \"p, Min: \" + global.get(\"MinRate\").toFixed(1) + \"p.\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":220,"wires":[["8c3d0e01.7482e"]],"icon":"font-awesome/fa-pencil-square-o"},{"id":"8a244e45.f955b","type":"ui_slider","z":"87c43538.912d48","name":"","label":"Expensive","tooltip":"","group":"9a9e2b57.da13d8","order":2,"width":"10","height":"1","passthru":false,"outs":"end","topic":"","min":0,"max":"35","step":"0.1","x":910,"y":440,"wires":[["dbac80d.8c3708"]]},{"id":"24826bdd.c7e434","type":"ui_button","z":"87c43538.912d48","name":"","group":"79422917.e7e318","order":3,"width":"3","height":"1","passthru":false,"label":"Arm Dryer","tooltip":"","color":"","bgcolor":"","icon":"","payload":"HOLD","payloadType":"str","topic":"","x":890,"y":320,"wires":[["8b1cde38.6d3c4"]]},{"id":"37b2f700.f98a08","type":"link in","z":"87c43538.912d48","name":"Expensive","links":["5d9a6878.203648"],"x":535,"y":440,"wires":[["47f7aadf.8f56d4"]]},{"id":"9f36f70f.5858d8","type":"debug","z":"87c43538.912d48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":830,"y":720,"wires":[]},{"id":"47f7aadf.8f56d4","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":440,"wires":[["8a244e45.f955b"]]},{"id":"cd37a19.875416","type":"link in","z":"87c43538.912d48","name":"Expensive","links":["fd4a600.c4de0a"],"x":715,"y":400,"wires":[["8a244e45.f955b"]]},{"id":"f8eeb78d.4e17e8","type":"link in","z":"87c43538.912d48","name":"Average","links":["80b1330.89961d","36af761.308fd8a"],"x":535,"y":520,"wires":[["4d3ae587.a6fbfc","a7e516a2.7d2758"]]},{"id":"4d3ae587.a6fbfc","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"ui_control.min","pt":"msg","to":"$round(payload + 0.2, 1)","tot":"jsonata"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":480,"wires":[["8a244e45.f955b"]]},{"id":"dbac80d.8c3708","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"ExpensiveRate","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":440,"wires":[[]]},{"id":"a7fed7ef.297cc8","type":"ui_slider","z":"87c43538.912d48","name":"","label":"Cheap","tooltip":"","group":"9a9e2b57.da13d8","order":2,"width":"10","height":"1","passthru":false,"outs":"end","topic":"","min":0,"max":"15","step":"0.1","x":890,"y":600,"wires":[["60da1ff7.92b8e"]]},{"id":"c82c3cd3.a875c","type":"link in","z":"87c43538.912d48","name":"Cheap","links":["b74143f3.744a1"],"x":535,"y":600,"wires":[["61148e1e.2b916"]]},{"id":"61148e1e.2b916","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":600,"wires":[["a7fed7ef.297cc8"]]},{"id":"cab166c7.484fa8","type":"link in","z":"87c43538.912d48","name":"Cheap","links":["9affec75.c324d"],"x":715,"y":640,"wires":[["a7fed7ef.297cc8"]]},{"id":"a7e516a2.7d2758","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"ui_control.max","pt":"msg","to":"$round(payload - 0.2, 1)","tot":"jsonata"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":560,"wires":[["a7fed7ef.297cc8"]]},{"id":"60da1ff7.92b8e","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"CheapRate","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":600,"wires":[[]]},{"id":"2d17a0f1.df778","type":"ui_switch","z":"87c43538.912d48","name":"","label":"Server","tooltip":"","group":"b283c8d1.6b62c8","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"ON","onvalueType":"str","onicon":"","oncolor":"","offvalue":"OFF","offvalueType":"str","officon":"","offcolor":"","x":170,"y":400,"wires":[["c430241c.9fc178"]]},{"id":"c430241c.9fc178","type":"link out","z":"87c43538.912d48","name":"FH (Dashboard)","links":["631c669d.8d4ab8"],"x":305,"y":400,"wires":[]},{"id":"ddfd59e7.9ba8c8","type":"inject","z":"87c43538.912d48","name":"Startup","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"60","topic":"","payload":"","payloadType":"date","x":210,"y":520,"wires":[["e5e0fb4e.2c3da8"]]},{"id":"e5e0fb4e.2c3da8","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"AverageRate","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":520,"wires":[["4d3ae587.a6fbfc","a7e516a2.7d2758"]]},{"id":"ab6573c8.f73a3","type":"ui_button","z":"87c43538.912d48","name":"","group":"79422917.e7e318","order":3,"width":"3","height":"1","passthru":false,"label":"Arm Washer","tooltip":"","color":"","bgcolor":"","icon":"","payload":"HOLD","payloadType":"str","topic":"","x":890,"y":280,"wires":[[]]},{"id":"57321b6.47ae5e4","type":"ui_button","z":"87c43538.912d48","name":"","group":"79422917.e7e318","order":3,"width":"3","height":"1","passthru":false,"label":"Arm D/Washer","tooltip":"","color":"","bgcolor":"","icon":"","payload":"HOLD","payloadType":"str","topic":"","x":900,"y":360,"wires":[[]]},{"id":"3745b9d0.0e2036","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"ui_control.options.minTxt","pt":"msg","to":" ","tot":"str"},{"t":"set","p":"ui_control.options.maxTxt","pt":"msg","to":" ","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$round(payload[0].value_inc_vat ,1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":140,"wires":[["2e576985.6e5fc6"]]},{"id":"8779e0d.1a7632","type":"link in","z":"87c43538.912d48","name":"","links":["7691c0f.089f14"],"x":495,"y":320,"wires":[["33da69c2.871b26"]]},{"id":"8b1cde38.6d3c4","type":"link out","z":"87c43538.912d48","name":"","links":["246bc257.442f7e"],"x":1035,"y":320,"wires":[]},{"id":"33da69c2.871b26","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":320,"wires":[["24826bdd.c7e434"]]},{"id":"b9a70965.13e138","type":"ui_button","z":"87c43538.912d48","name":"","group":"79422917.e7e318","order":0,"width":"0","height":"0","passthru":false,"label":"{{payload}}","tooltip":"","color":"","bgcolor":"{{colour}}","icon":"","payload":"press","payloadType":"str","topic":"","x":550,"y":740,"wires":[["48aaee20.8d9e1"]]},{"id":"5cc84101.ac6d9","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"colour","pt":"msg","to":"green","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"fa fa-rotate-90 fa-folder-open-o\"></i> OPEN","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":695,"wires":[["b9a70965.13e138"]]},{"id":"329e773b.0fdcb8","type":"inject","z":"87c43538.912d48","name":"","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":175,"y":695,"wires":[["bc5a70e.6f6a29"]]},{"id":"48aaee20.8d9e1","type":"function","z":"87c43538.912d48","name":"state","func":"var state = context.state || false;\nstate = !state;\ncontext.state = state;\nif (state) { return [msg,null]; }\nelse { return [null,msg]; }\n","outputs":2,"noerr":0,"x":175,"y":740,"wires":[["5cc84101.ac6d9"],["bc5a70e.6f6a29"]]},{"id":"bc5a70e.6f6a29","type":"change","z":"87c43538.912d48","name":"","rules":[{"t":"set","p":"colour","pt":"msg","to":"red","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"fa fa-rotate-90 fa-folder-o\"></i> Closed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":740,"wires":[["b9a70965.13e138"]]},{"id":"ae915ea8.0aa29","type":"ui_group","name":"Agile Tariff","tab":"483f70f7.0bbd7","order":1,"disp":false,"width":"10","collapse":false},{"id":"25e674f1.1956fc","type":"ui_group","name":"Current rate","tab":"483f70f7.0bbd7","order":2,"disp":false,"width":"5","collapse":false},{"id":"b283c8d1.6b62c8","type":"ui_group","name":"Controls","tab":"483f70f7.0bbd7","order":3,"disp":false,"width":"5","collapse":false},{"id":"9a9e2b57.da13d8","type":"ui_group","name":"Settings","tab":"483f70f7.0bbd7","order":4,"disp":false,"width":"10","collapse":false},{"id":"79422917.e7e318","type":"ui_group","name":"Buttons","tab":"483f70f7.0bbd7","order":5,"disp":false,"width":"10","collapse":false},{"id":"483f70f7.0bbd7","type":"ui_tab","name":"Octopus Energy","icon":"dashboard","disabled":false,"hidden":false}]

Here are the nodes I imported:

[{"id":"153706ec.665b79","type":"ui_button","z":"a5974066.c4e61","name":"","group":"79422917.e7e318","order":0,"width":"0","height":"0","passthru":false,"label":"{{payload}}","tooltip":"","color":"","bgcolor":"{{colour}}","icon":"","payload":"press","payloadType":"str","topic":"","x":490,"y":160,"wires":[["8721ad5.3f7fa5"]]},{"id":"4d02bffb.f83f8","type":"change","z":"a5974066.c4e61","name":"","rules":[{"t":"set","p":"colour","pt":"msg","to":"green","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"fa fa-rotate-90 fa-folder-open-o\"></i> OPEN","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":115,"wires":[["153706ec.665b79"]]},{"id":"2f536cef.9ea074","type":"inject","z":"a5974066.c4e61","name":"","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":115,"y":115,"wires":[["d034cdee.5b1bb"]]},{"id":"8721ad5.3f7fa5","type":"function","z":"a5974066.c4e61","name":"state","func":"var state = context.state || false;\nstate = !state;\ncontext.state = state;\nif (state) { return [msg,null]; }\nelse { return [null,msg]; }\n","outputs":2,"noerr":0,"x":115,"y":160,"wires":[["4d02bffb.f83f8"],["d034cdee.5b1bb"]]},{"id":"d034cdee.5b1bb","type":"change","z":"a5974066.c4e61","name":"","rules":[{"t":"set","p":"colour","pt":"msg","to":"red","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"fa fa-rotate-90 fa-folder-o\"></i> Closed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":160,"wires":[["153706ec.665b79"]]},{"id":"79422917.e7e318","type":"ui_group","name":"Buttons","tab":"483f70f7.0bbd7","order":5,"disp":false,"width":"10","collapse":false},{"id":"483f70f7.0bbd7","type":"ui_tab","name":"Octopus Energy","icon":"dashboard","disabled":false,"hidden":false}]

And here the JS console error I get when I click Deploy:

Uncaught TypeError: Cannot read property 'name' of undefined
    at v (red.min.js:16)
    at red.min.js:16
    at Object.eachConfig (red.min.js:16)
    at E (red.min.js:16)
    at HTMLAnchorElement.<anonymous> (red.min.js:16)
    at HTMLAnchorElement.dispatch (vendor.js:2)
    at HTMLAnchorElement.v.handle (vendor.js:2)
v @ red.min.js:16
(anonymous) @ red.min.js:16
eachConfig @ red.min.js:16
E @ red.min.js:16
(anonymous) @ red.min.js:16
dispatch @ vendor.js:2
v.handle @ vendor.js:2

I won't restore from backup just yet...

What node-red version are you using?

This was fixed in V1.2.5+

Can you start node-red with node-red --safe and delete the misbehaving nodes?

Johannes

Ah - 1.2.2 - I didn't realise I was so far behind the curve. I think I keep forgetting I didn't use apt to install it! Greatest apologies.

Am I safe to update Node-RED and then delete the nodes or should I attempt it in safe mode first?

Either before or after.

If it makes you feel safer, backup the flow files from the .node-red directory.

In fact, the last good backup will also be in there (so you could simply rename it)

1 Like

I can confirm that updating to 1.2.6 solved this.

Sorry for the noise!

3 Likes

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