victronenergy / node-red-contrib-victron

MIT License
90 stars 18 forks source link

Running node-red without vncpassword.txt #67

Closed mpvader closed 2 years ago

mpvader commented 3 years ago

Note that impact of this is low: most device will have that file on the data partition by default.

To reproduce, either take a fresh gx device or simply remove mentioned txt file from the data partition and reboot. And then navigate to ip:1880, before pressing the 'Disabled password' item in the Remote Console menu in the gui.

Below is the error in the log, and on the webbrowser there is also an error 'lost connection to server', or similar wording.

2021-01-11 16:20:04.537862500 (node:1471) UnhandledPromiseRejectionWarning: TypeError: console.err is not a function
2021-01-11 16:20:04.537874500     at getPassword (/data/home/root/.node-red/user-authentication.js:60:13)
2021-01-11 16:20:04.537877500     at /data/home/root/.node-red/user-authentication.js:44:12
2021-01-11 16:20:04.537880500     at new Promise (<anonymous>)
2021-01-11 16:20:04.537882500     at Object.default (/data/home/root/.node-red/user-authentication.js:43:12)
2021-01-11 16:20:04.537885500     at Object.default (/usr/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/auth/users.js:131:45)
2021-01-11 16:20:04.537988500     at Object.start (/usr/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:190:22)
2021-01-11 16:20:04.537993500     at /usr/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/index.js:124:19
2021-01-11 16:20:04.537997500     at tryCatchReject (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:845:30)
2021-01-11 16:20:04.538027500     at runContinuation1 (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:804:4)
2021-01-11 16:20:04.538031500     at Fulfilled.when (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:592:4)
2021-01-11 16:20:04.538871500 (node:1471) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
2021-01-11 16:20:04.539610500 (node:1471) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
dirkjanfaber commented 2 years ago

This patch takes care or this, allowing the file to be non-existent.