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

Causing Node-RED to crash with Uncaught Exception: ReferenceError: renewSession is not defined #25

Open
HonestJohn61 opened this issue Mar 11, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@HonestJohn61
Copy link

HonestJohn61 commented Mar 11, 2023

Thanks for these nodes. I'm using Control and Status successfully, but every 30 minutes Node-RED crashes with the following reported in the log:

2023-03-11T12:31:33.644871018Z | stdout | 11 Mar 12:31:33 - [red] Uncaught Exception:
2023-03-11T12:31:33.645633752Z | stdout | 11 Mar 12:31:33 - [error] ReferenceError: renewSession is not defined
2023-03-11T12:31:33.645743492Z | stdout | at Timeout._onTimeout (/data/node_modules/node-red-contrib-evohome/evohome/evohome-control.js:18:7)
2023-03-11T12:31:33.645800044Z | stdout | at listOnTimeout (node:internal/timers:559:17)
2023-03-11T12:31:33.645844630Z | stdout | at processTimers (node:internal/timers:502:7)

I'm running Node-RED in a Docker container on a Synology NAS, and it's been exceptionally stable until installing node-red-contrib-evohome yesterday.

Is there any further info you need to get a handle on this? Thanks

@HonestJohn61
Copy link
Author

Disabling the configuration node doesn't avoid the module crashing Node-RED, but it does change the Uncaught Error reported in the Node-RED logs:

11 Mar 17:00:27 - [red] Uncaught Exception:
11 Mar 17:00:27 - [error] TypeError: Cannot read properties of null (reading 'userid')
    at publishEvohomeStatus (/data/node_modules/node-red-contrib-evohome/evohome/evohome-status.js:17:30)
    at Timeout._onTimeout (/data/node_modules/node-red-contrib-evohome/evohome/evohome-status.js:73:5)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

@C2Leu
Copy link

C2Leu commented Dec 27, 2023

function renewSession() is missing from evohome-control.js. I'm already poling every 5 mins via evohome-status to get the temps so I'm allowing that to do the renewSession and just commented 17 to 19 in evohome-control.js

// renew = setInterval(function() {
// evostatus.renewSession();
// }, session.refreshTokenInterval * 1000);

not pretty but it works

@HonestJohn61
Copy link
Author

Thanks for the work around. I gave up on it some while ago and installed Home Assistant under Docker on my Synology NAS just to use their evohome integration. That was my even less pretty solution!

dehsgr added a commit that referenced this issue Jun 27, 2024
Session renewal function was missing from evohome-control.
@dehsgr
Copy link
Owner

dehsgr commented Jun 27, 2024

Just published v1.3.3. Please give feedback, if this is solving the issue.

@dehsgr dehsgr self-assigned this Jun 27, 2024
@dehsgr dehsgr added the bug Something isn't working label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants