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

sense config causes node-red to crash #1

Open
brentratliff opened this issue Mar 16, 2021 · 10 comments
Open

sense config causes node-red to crash #1

brentratliff opened this issue Mar 16, 2021 · 10 comments

Comments

@brentratliff
Copy link

When using sense-now I get a syntax error and the GUI disconnects from the server. Disabling node-red-unofficial-sense in the json config reconnects the server.

@brentratliff
Copy link
Author

Error: write EPROTO 1995863712:error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type:../deps/openssl/openssl/ssl/t1_lib.c:1146:
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

@brentratliff
Copy link
Author

I know this code is three years old. I'm guessing something to do with authentication. Let me know if you're no longer working on this project.

@brentratliff
Copy link
Author

It's definitely the configuration node. When I delete and deploy the config node, node-red does not disconnect. I'm guessing sense has changed their authentication since 2018.

@brentratliff brentratliff changed the title sense-now causes node-red to crash sense config causes node-red to crash Mar 16, 2021
@AshMartian
Copy link
Owner

It’s definitely changed slightly, my node-red has been throwing some auth errors, but haven’t had the time to dig into it. I haven’t had any usability problems, sense node-red still making my Google home notify me when microwave goes off. Used to have issues when using the app, but just checked the app today and both responding.

@brentratliff
Copy link
Author

Can you point me in the direction of the authentication piece? I couldn't find the API call in the code?

@brentratliff
Copy link
Author

I wonder if yours still works since you already have an Auth token. It’s an SSL error so may be a quick fix.

@brentratliff
Copy link
Author

brentratliff commented Mar 17, 2021

This seems to be affecting other users of the API, not just those using node or node red. The issue appears related to outdated SSL settings on the Sense servers. I was able to get this running on a Mac unlike the Pi.

This issue is actually caused by the security levels set by the web site, in this case Sense. The default security level in Debian 10/OpenSSL 1.1.1b conflict with the lower security of whatever web application. You can read more about this here: https://wiki.debian.org/ContinuousIntegration/TriagingTips/openssl-1.1.1 77

Basically, you need to lower the default level back down to level 1. This really is a workaround, the sites in question should be updating their security. To do this you need to open up /etc/ssl/openssl.cnf and change “CipherString” from “DEFAULT@SECLEVEL=2” to “DEFAULT@SECLEVEL=1” Then you will have to reboot your system.

My Mac is not always running, but now I know the problem, I can either get it working on the Pi or possibly my always on Win10 server.

@brentratliff
Copy link
Author

brentratliff commented Mar 18, 2021

[red] Uncaught Exception:
18 Mar 12:40:50 - FetchError: invalid json response body at https://api.sense.com/apiservice/api/v1/app/monitors/xxxxxx/devices reason: Unexpected token < in JSON at position 0

Getting this on Windows using Node 15. Not getting it on the LTS versions on Mac or Rasbpian. Is there a way I can add error checking into the api call?

@rossphillips70
Copy link

rossphillips70 commented Jun 1, 2021

Is there a fix for this yet? I believe this is causing my Node-Red to crash.

0|node-red | FetchError: invalid json response body at https://api.sense.com/apiservice/api/v1/app/monitors/xxxxxx/devices reason: Unexpected token < in JSON at position 0
0|node-red | at /home/node-red/node_modules/node-fetch/lib/index.js:272:32
0|node-red | at runMicrotasks ()
0|node-red | at processTicksAndRejections (internal/process/task_queues.js:97:5)
0|node-red | at async /home/node-red/node_modules/unofficial-sense/index.js:70:42 {
0|node-red | message: 'invalid json response body at https://api.sense.com/apiservice/api/v1/app/monitors/xxxxxx/devices reason: Unexpected token < in JSON at position 0',
0|node-red | type: 'invalid-json'
0|node-red | }

@andrewvanlagen
Copy link

anyone have a fix for this issue

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

4 participants