Now i want to use adminAuth. i have already test adminAuth settting successfully in CPU:ARMv7 Processor rev 5 (v7l) platform, But i test adminAuth setting failed in CPU:MIPS 1004Kc V2.15.
i can enter a password and click login but after i click login the web request hangs continuous about 40 seconds,then it returns a 'login failed' type message. i have also use a error username or error password to test , there are same phenomenon.About the JavaScript console without any errors printing.
This is the Caught file.
Can you edit your settings.js file and set the logging.audit value to true and the logging.level to "trace". Then restart Node-RED and try again. Then see what the Node-RED log shows.
It is odd for it to take 40 seconds to respond - I'm not sure what could cause that. What type of machine is this running on?
What hardware is this running on? The uname command says Linux router - so is this a low powered, low memory router type device? That could explain why it takes so long to respond - the bcrypt password hashing can be quite slow on slow devices. But it doesn't explain why the login fails.
When node-red is installed, it tries to install the bcrypt module to handle the password hashing. This is a binary module that doesn't always successfully install. As a fall back, we also install bcryptjs - a pure javascript implementation that will install cleanly, but is much slower than the binary module.
Can you try reinstalling the bcrypt module; in the directory /mnt/sd/node-js-app/node-red-0.19.5/ run npm install bcrypt
Node-red run in embedded Router device(Linux operating system), i know the bcrypt module that doesn't always successfully install.i have checkout that bcrypt is install Success.
Not sure if it still relevant,
but the following method worked for me (version 1.0.3):
Run npm install -g node-red-admin or use this tutorial
Generate the password hash by running node-red-admin hash-pw
Type your preferred password (case-sensitive) and write it down.
Edit settings.js file, go to adminAuth. section (line 123 more or less) - change the username property to the one you want (again, case sensitive) and the password property to the generated password from step 2.
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:189:13)
at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:189:13)
at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:189:13)
at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:189:13)
at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:189:13)
at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
// Configure the logging output
logging: {
// Only console logging is currently supported
console: {
// Level of logging to be recorded. Options are:
// fatal - only those errors which make the application unusable should be recorded
// error - record errors which are deemed fatal for a particular request + fatal errors
// warn - record problems which are non fatal + errors + fatal errors
// info - record information about the general running of the application + warn + error + fatal errors
// debug - record information which is more verbose than info + info + warn + error + fatal errors
// trace - record very detailed logging + debug + info + warn + error + fatal errors
// off - turn off all logging (doesn't affect metrics or audit)
level: "trace",
// Whether or not to include metric events in the log output
metrics: false,
// Whether or not to include audit events in the log output
audit: true
}
},