bisand / node-red-contrib-panasonic-comfort-cloud

MIT License
6 stars 4 forks source link

Intermittent failure of plugin forcing a stop of NodeRed #7

Closed xgcssch closed 2 years ago

xgcssch commented 2 years ago

Hello! I am using your plugin in Version 1.2.9. on a NodeRed instance running in docker. Sometimes the container restarts with the following output. It seems, that the Panasonic server sometimes returns with an unexcepted Response. There is no Proxy in my network between NodeRed and the target servers. Thanks for creating this plugin! Sönke

3 Apr 19:12:03 - [info] Starting flows
3 Apr 19:12:03 - [info] Server now running at http://127.0.0.1:1880/

---------------------------------------------------------------------
file using your chosen key the next time you deploy a change.
your settings file. Node-RED will then re-encrypt your credentials
You should set your own key using the 'credentialSecret' option in

your credentials.
"file will not be recoverable, you will have to delete it and re-enter
"
"If the system-generated key is lost for any reason, your credentials
"

Your flow credentials file is encrypted using a system-generated key.
---------------------------------------------------------------------

3 Apr 19:12:03 - [warn] 
3 Apr 19:12:03 - [info] Flows file     : /data/flows.json
3 Apr 19:12:03 - [warn] Projects disabled : editorTheme.projects.enabled=false
3 Apr 19:12:03 - [info] User directory : /data
3 Apr 19:12:03 - [info] Context store  : 'default' [module=memory]
3 Apr 19:12:03 - [info] Settings file  : /data/settings.js
3 Apr 19:12:04 - [info] [mqtt-broker:Schau] Connected to broker: mqtt://mqtt.int.schau.org:1883
npm ERR!     /data/.npm/_logs/2022-04-03T17_49_05_734Z-debug.log
npm ERR! A complete log of this run can be found in:

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! Failed at the node-red-docker@2.1.3 start script.
npm ERR! 
npm ERR! Exit status 1
npm ERR! node-red-docker@2.1.3 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
npm ERR! errno 1
npm ERR! code ELIFECYCLE
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at IncomingMessage.emit (events.js:412:35)
    at IncomingMessage.<anonymous> (/data/node_modules/panasonic-comfort-cloud-api/dist/ComfortCloud.js:268:47)
'
</html>
</body>
<hr><center>nginx</center>
<center><h1>504 Gateway Time-out</h1></center>
<body>
<head><title>504 Gateway Time-out</title></head>
3 Apr 19:49:05 - [error] TypeError: Cannot create property 'httpCode' on string '<html>
3 Apr 19:49:05 - [red] Uncaught Exception:
> node-red-docker@2.1.3 start /usr/src/node-red
smadds commented 2 years ago

Just to say this brought down our system today. Pretty sure its a problem with the Panasonic server, but it shouldn't crash all of our flows! I've just had to disable it until the bug can be fixed.

Just tried the Comfort Cloud app on my phone and it seems to be working fine though

smadds commented 2 years ago

This has just fixed it for us: https://github.com/bisand/node-red-contrib-panasonic-comfort-cloud/issues/9

EDIT- Nope - seemed to fix it for a while, but failed again

bisand commented 2 years ago

A new updated version is published (1.3.0). This update includes improved error handling and automatic resolving of X-APP-VERSION. Ref: #9. Thanks to @yodosan for PR and for pointing me in the right direction. Please update your installations and report back on the results. Thanks!

smadds commented 2 years ago

That's brilliant. Thanks, @bisand .

I've set up a test on a spare RPi I had and will run it there for a while before risking the production environment!

Outside temperatures in Redhill, Surrey if anyone's interested! http://remote-a.three-central.co.uk:20000/ui/

xgcssch commented 2 years ago

Hi André! I just downloaded the 1.3.2 version. And in general it's working again (i was effected from #9 too) Thanks for your effort!