Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error relocating ... symbol not found #45

Open
SindreLindahl opened this issue Jan 8, 2025 · 11 comments
Open

Error relocating ... symbol not found #45

SindreLindahl opened this issue Jan 8, 2025 · 11 comments

Comments

@SindreLindahl
Copy link
Contributor

When using this node, it produces the following errors on every deploy:

Error: Error relocating /data/node_modules/node-mbus/build/Release/mbus.node: _ZN2v820EscapableHandleScopeC1EPNS_7IsolateE: symbol not found

TypeError: Cannot read properties of null (reading 'on')

This happen for each client, so I have 3 clients and get these 2 messages 3 times (for a total of 6 error messages).

Node.js v22
npm v11
Node red v4.0.8
node-red-contrib-m-bus v 3.2.1

Any clue what's wrong here?

@SindreLindahl
Copy link
Contributor Author

The node is silent and doesn't produce any output. It also doesn't throw any error to be caught in catch node. Shouldn't it at least throw an error so it can be handled?

@robertsLando
Copy link
Owner

arch?

@SindreLindahl
Copy link
Contributor Author

Pi5 so arm64v8. You may be right it could have been accidentally wrong arch because after a npm rebuild it worked. Another problem entirely is this node doesn't seem to throw any errors or give error property in msg output?

@robertsLando
Copy link
Owner

@SindreLindahl Nope it's not but it sets the node status and you can easily get it using the status node of node-red, this is what I usually do

@SindreLindahl
Copy link
Contributor Author

SindreLindahl commented Jan 14, 2025

If this runs headless in production, there is no website to look at. Regardless, this could happen at night or off-hours. Don't want to sit and watch node status all day to be able to see when it fails. What I need is to be able to catch this error in some programmatic/automatic way and log it. This is best-practice for how nodes should behave.

More info here: https://discourse.nodered.org/t/request-nodes-that-is-a-black-hole-on-error/94456

@robertsLando
Copy link
Owner

are you speaking about m-bus out node or m-bus controller? Where/*when would you expect an error to be emitted? I still don't understand your answer :

if this runs headless in production, there is no website to look at

If you use node-red status node (see the green one on this link) you can intercept the status of the node, ATM the status is set to error when an error happens

@SindreLindahl
Copy link
Contributor Author

SindreLindahl commented Jan 14, 2025

Was thinking about the m-bus controller node. My answer was in response to the status, which I've just used to look at. So I imagined the proposed solution was to look at the editor in the browser to observe errors. But Node Red can run without browser or anything to look at (except logs).

The status node is a poor substitution for the catch node. That's not what it is made for, and is more hassle. You have to add filter and hope it match everything you need it to match. Best practice is to throw errors when errors occur, then we can use catch node to handle it. Isn't this how virtually all other libraries work? Please compare to other I/O like bacnet, modbus, http etc. For instance, using the status, you lose all context to the message that failed. It's just bad for a million reasons to use status instead of the proper channel which is to throw an exception.

@robertsLando
Copy link
Owner

Checking source code I see there are already some node.error that should be catched by catch node, what's the specific error that is not catched in your case?

Source at:

https://github.com/robertsLando/node-red-contrib-m-bus/blob/master/mbus-out.js

Missing node.error I can spot in source code:

  1. https://github.com/robertsLando/node-red-contrib-m-bus/blob/master/mbus-controller.js#L35
  2. https://github.com/robertsLando/node-red-contrib-m-bus/blob/master/mbus-controller.js#L142
  3. https://github.com/robertsLando/node-red-contrib-m-bus/blob/master/mbus-controller.js#L145
  4. Optionally a main try/catch before the switch

@SindreLindahl
Copy link
Contributor Author

Thanks, I have to investigate this, I'll be back 😎 (later this week).

@robertsLando
Copy link
Owner

Ok let me know and in case feel free to submit a PR otherwise I can look at this and fix it

@SindreLindahl
Copy link
Contributor Author

Thanks, have enabled catch node and log to file, so will report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants