question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sioMiddleware.js not running

See original GitHub issue

I’m having issues getting sioMiddleware.js to do anything. I tried changing ~/.node-red/uibuilder/.config/sioMiddleware.js to the code below and am not seeing any error messages logged, either on the uibuilder front end or in node.

// sioMiddleware.js
module.exports = function(socket, next) {
  next(new Error('test error from sioMiddleware'));
}

But if I populate sioUse.js with the same code I do get an error as expected.

image

And the following log shows up in journalctl

Oct 29 13:48:17 raspberrypi Node-RED[26714]: 29 Oct 13:48:17 - [error] [uibuilder:uibuilder] ERROR received, ID: BT65fYSyzTmopURXAAAC, Reason: test error from sioUse

Since this works fine with sioUse.js I’m not sure what I may be doing wrong with sioMiddleware.js. Both files are in ~/.node-red/uibuilder/.config/, and I restarted Node-RED after each change. For my use case, it makes more sense to use sioMiddleware than sioUse since I only want code to run on the initial connection, not every message.

Software and Package Versions

Software Version
Node.JS 14.18.1
npm 6.14.15
Node-RED 2.1.3
uibuilder node 4.1.4
uibuilderFE 4.1.1
OS Raspbian GNU/Linux 10 (buster)
Browser Firefox 93.0 (64-bit)

How is Node-RED installed? Where is uibuilder installed?

Node-RED is installed using the provided script at https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered

uibuilder is installed through the Manage Palette to ~/.node-red/node_modules and uibuilder root ~/.node-red/uibuilder

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TotallyInformationcommented, Jan 23, 2022

Fixed in v5/vNext

0reactions
dczyszcommented, Jan 3, 2022

I keep hitting these issues about identification between the client and server. I will have a look at this again to see if it can help with the security features that I keep struggling with and can’t find robust and relatively simple answers to.

Yeah, it seems difficult to get a system that works well for everyone, since I’m guessing some people rely completely on uibuilder for security, and then others (like me) really don’t need any of uibuilder’s security features except one or two small pieces.

Also, I fixed the connect/disconnect control messages that were supposed to be issued

I hadn’t even noticed this, but I haven’t hooked anything up to the vNext uibuidler node yet, just using it alone for quick UI testing. Good to know it’s no longer an issue though since I’m relying on it for user data!

Read more comments on GitHub >

github_iconTop Results From Across the Web

upgrade TrueNAS-22.12-RC.1 failed,it says "middleware in ...
when I upgrade TrueNAS-22.02.4 to TrueNAS-22.12-RC.1,after reboot ,it prompts "middleware in not running.Press Enter to open root shell" and ...
Read more >
socketio/socket.io-client - Middleware error not catches - GitHub
I might be making a mistake, but I cannot manage to catch middleware error on client, here is server code: (function () {...
Read more >
[NAS-113144] Stuck on boot. middleware not running
passdb middleware not running. Press Enter to open root shell. middlewared: setting up plugins (alert) [8/91]. This is where it gets stuck.
Read more >
python-socketio not always emitting when tracking ...
Middleware (sio, app.wsgi_app) # Launch the server with socket integration app.run(port=8008, debug=False, threaded= ...
Read more >
Open Source usage in the Mercury Security Series 3 SIO ...
Open Source usage in the Mercury Security Series 3 SIO Firmware ... the FAQ page "My application does not run, what could be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found