Hello,
I am working on a storage plugin for Microsoft SQL Server inspired by this project:
It was a fairly straight forward translation but I am running into a snag I was hoping somebody could point me in the right direction on. When I start Node-RED with my plugin in place I will see it fire getSettings, saveSettings, getFlows, getCredentials, and saveSettings again. During this time I will see my empty table structure for NodeRedSettings within SQL Server filled with a row that looks like this:
{
"nodes":{
"node-red":{
"name":"node-red",
"version":"1.0.3-git",
"local":false,
"nodes":{
"inject":{
"name":"inject",
"types":[
"inject"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/20-inject.js"
},
"debug":{
"name":"debug",
"types":[
"debug"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/21-debug.js"
},
"complete":{
"name":"complete",
"types":[
"complete"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/24-complete.js"
},
"catch":{
"name":"catch",
"types":[
"catch"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/25-catch.js"
},
"status":{
"name":"status",
"types":[
"status"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/25-status.js"
},
"link":{
"name":"link",
"types":[
"link in",
"link out"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/60-link.js"
},
"comment":{
"name":"comment",
"types":[
"comment"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/90-comment.js"
},
"unknown":{
"name":"unknown",
"types":[
"unknown"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/common/98-unknown.js"
},
"function":{
"name":"function",
"types":[
"function"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/10-function.js"
},
"switch":{
"name":"switch",
"types":[
"switch"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/10-switch.js"
},
"change":{
"name":"change",
"types":[
"change"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/15-change.js"
},
"range":{
"name":"range",
"types":[
"range"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/16-range.js"
},
"template":{
"name":"template",
"types":[
"template"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/80-template.js"
},
"delay":{
"name":"delay",
"types":[
"delay"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/89-delay.js"
},
"trigger":{
"name":"trigger",
"types":[
"trigger"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/89-trigger.js"
},
"exec":{
"name":"exec",
"types":[
"exec"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/function/90-exec.js"
},
"tls":{
"name":"tls",
"types":[
"tls-config"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/05-tls.js"
},
"httpproxy":{
"name":"httpproxy",
"types":[
"http proxy"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/06-httpproxy.js"
},
"mqtt":{
"name":"mqtt",
"types":[
"mqtt in",
"mqtt out",
"mqtt-broker"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/10-mqtt.js"
},
"httpin":{
"name":"httpin",
"types":[
"http in",
"http response"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/21-httpin.js"
},
"httprequest":{
"name":"httprequest",
"types":[
"http request"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/21-httprequest.js"
},
"websocket":{
"name":"websocket",
"types":[
"websocket in",
"websocket out",
"websocket-listener",
"websocket-client"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/22-websocket.js"
},
"tcpin":{
"name":"tcpin",
"types":[
"tcp in",
"tcp out",
"tcp request"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/31-tcpin.js"
},
"udp":{
"name":"udp",
"types":[
"udp in",
"udp out"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/network/32-udp.js"
},
"CSV":{
"name":"CSV",
"types":[
"csv"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/parsers/70-CSV.js"
},
"HTML":{
"name":"HTML",
"types":[
"html"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/parsers/70-HTML.js"
},
"JSON":{
"name":"JSON",
"types":[
"json"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/parsers/70-JSON.js"
},
"XML":{
"name":"XML",
"types":[
"xml"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/parsers/70-XML.js"
},
"YAML":{
"name":"YAML",
"types":[
"yaml"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/parsers/70-YAML.js"
},
"split":{
"name":"split",
"types":[
"split",
"join"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/sequence/17-split.js"
},
"sort":{
"name":"sort",
"types":[
"sort"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/sequence/18-sort.js"
},
"batch":{
"name":"batch",
"types":[
"batch"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/sequence/19-batch.js"
},
"file":{
"name":"file",
"types":[
"file",
"file in"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/storage/10-file.js"
},
"watch":{
"name":"watch",
"types":[
"watch"
],
"enabled":true,
"local":false,
"module":"node-red",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/@node-red/nodes/core/storage/23-watch.js"
}
}
},
"node-red-node-pi-gpio":{
"name":"node-red-node-pi-gpio",
"version":"1.0.6",
"local":false,
"nodes":{
"rpi-gpio":{
"name":"rpi-gpio",
"types":[
"rpi-gpio in",
"rpi-gpio out",
"rpi-mouse",
"rpi-keyboard"
],
"enabled":true,
"local":false,
"module":"node-red-node-pi-gpio",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/node-red-node-pi-gpio/36-rpi-gpio.js"
}
}
},
"node-red-node-rbe":{
"name":"node-red-node-rbe",
"version":"0.2.8",
"local":false,
"nodes":{
"rbe":{
"name":"rbe",
"types":[
"rbe"
],
"enabled":true,
"local":false,
"module":"node-red-node-rbe",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/node-red-node-rbe/rbe.js"
}
}
},
"node-red-node-tail":{
"name":"node-red-node-tail",
"version":"0.0.3",
"local":false,
"nodes":{
"tail":{
"name":"tail",
"types":[
"tail"
],
"enabled":true,
"local":false,
"module":"node-red-node-tail",
"file":"/Users/adamellis/Documents/src/ginger-iot-webapp/node_modules/node-red-node-tail/28-tail.js"
}
}
}
},
"credentialSecret":"HIDDEN",
"users":{
"":{
"editor":{
"view":{
"view-show-grid":true,
"view-snap-grid":true,
"view-grid-size":20,
"view-node-status":true,
"view-node-show-label":true,
"view-show-tips":true
}
}
}
}
}
So far so good - then I load the dashboard up and build a flow (there is not the typical default 'Flow 1' so I need to create one). When I go to deploy I am getting this error and do not see any of the storage methods being called:
Deploy failed: {"code":"unexpected_error","message":"Cannot read property 'rev' of null"}
Any ideas of where to start looking?
Thanks in advance,
Adam
*post edited for readability and a slight tweak to my plugin code