Read the statement by Michael Teeuw here.
MMM-GooglePhotos
-
@dumitrudany
Not possible immediately as you wish. There is no way to detect whether you add/modify photos or not. Maybe frequent scanning would get a similar result, but it will consume and waste too many API quota. I can’t recommend it at all. -
@Sean Thanks. I think if you can gracefully handle the bad connection (no matter where it’s from) and reconnect once the connection works again, the image being stuck won’t be an issue. Right now once the connection breaks the module can’t recover.
-
@Sean I’ve been looking into this, because I’m really don’t think it’s my network (no other module has this issue and there’s no similar problems anywhere else on the network). The first error doesn’t seem to be fatal, but the second is.
These are the errors I’m seeing in my Out.log
[2020-04-27 17:33:15.365] [LOG] 2020-04-27T17:33:15 <log> [GPHOTOS:CORE] Error: socket hang up (/home/pi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:124 GPhotos.log)
and
[2020-04-27 18:51:15.155] [LOG] 2020-04-27T18:51:15 <log> [GPHOTOS:CORE] Error: Client network socket disconnected before secure TLS connectionwas established (/home/pi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:124 GPhotos.log)
I came across this issue on gitub related to Google APIs. https://github.com/googleapis/nodejs-bigquery/issues/624
Not sure it’s related.In Error.log I see
2020-04-27 17:33:15.356] [ERROR] [31m[1m2020-04-27T17:33:15 <error> Error: socket hang up[22m[39m [31m[1m at connResetException (internal/errors.js:559:14)[22m[39m [31m[1m at TLSSocket.socketOnEnd (_http_client.js:436:23)[22m[39m [31m[1m at TLSSocket.emit (events.js:205:15)[22m[39m [31m[1m at endReadableNT (_stream_readable.js:1154:12)[22m[39m [31m[1m at processTicksAndRejections (internal/process/task_queues.js:84:9) {[22m[39m [31m[1m code: 'ECONNRESET'[22m[39m [31m[1m} (/home/pi/MagicMirror/js/app.js:40 process.<anonymous>)[22m[39m [2020-04-27 17:33:15.361] [ERROR] [31m[1m2020-04-27T17:33:15 <error> Error: socket hang up[22m[39m [31m[1m at connResetException (internal/errors.js:559:14)[22m[39m [31m[1m at TLSSocket.socketOnEnd (_http_client.js:436:23)[22m[39m [31m[1m at TLSSocket.emit (events.js:205:15)[22m[39m [31m[1m at endReadableNT (_stream_readable.js:1154:12)[22m[39m [31m[1m at processTicksAndRejections (internal/process/task_queues.js:84:9) {[22m[39m [31m[1m code: 'ECONNRESET'[22m[39m [31m[1m} (/home/pi/MagicMirror/js/app.js:40 process.<anonymous>)[22m[39m [2020-04-27 17:33:15.367] [ERROR] [31m[1m2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: socket hang up[22m[39m [31m[1m at connResetException (internal/errors.js:559:14)[22m[39m [31m[1m at TLSSocket.socketOnEnd (_http_client.js:436:23)[22m[39m [31m[1m at TLSSocket.emit (events.js:205:15)[22m[39m [31m[1m at endReadableNT (_stream_readable.js:1154:12)[22m[39m [31m[1m at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 17:33:15.368] [ERROR] [31m[1m2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: socket hang up[22m[39m [31m[1m at connResetException (internal/errors.js:559:14)[22m[39m [31m[1m at TLSSocket.socketOnEnd (_http_client.js:436:23)[22m[39m [31m[1m at TLSSocket.emit (events.js:205:15)[22m[39m [31m[1m at endReadableNT (_stream_readable.js:1154:12)[22m[39m [31m[1m at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 17:33:15.369] [ERROR] [31m[1m2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 17:33:15.369] [ERROR] [31m[1m2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 17:33:15.370] [ERROR] [31m[1m2020-04-27T17:33:15 <error> (node:17589) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 17:33:15.371] [ERROR] [31m[1m2020-04-27T17:33:15 <error> (node:17589) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m
and
[2020-04-27 18:51:15.161] [ERROR] [31m[1m2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established[22m[39m [31m[1m at connResetException (internal/errors.js:559:14)[22m[39m [31m[1m at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)[22m[39m [31m[1m at Object.onceWrapper (events.js:288:20)[22m[39m [31m[1m at TLSSocket.emit (events.js:205:15)[22m[39m [31m[1m at endReadableNT (_stream_readable.js:1154:12)[22m[39m [31m[1m at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 18:51:15.164] [ERROR] [31m[1m2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established[22m[39m [31m[1m at connResetException (internal/errors.js:559:14)[22m[39m [31m[1m at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)[22m[39m [31m[1m at Object.onceWrapper (events.js:288:20)[22m[39m [31m[1m at TLSSocket.emit (events.js:205:15)[22m[39m [31m[1m at endReadableNT (_stream_readable.js:1154:12)[22m[39m [31m[1m at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 18:51:15.166] [ERROR] [31m[1m2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m [2020-04-27 18:51:15.168] [ERROR] [31m[1m2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)[22m[39m
-
@zolabus - That is merely a warning, not an error. That won’t be the source of the problem.
-
@bhepler Unhandled promise rejection.
I disagree… that means the code didn’t anticipate the error, and was waiting for the good completion which will never come…
gotta have a .catch() on every .then()
-
Unhandled promise rejection is not the reason of this symptom, rather result.
Anyway,
I thinkClient network socket disconnected before secure TLS connection was established
is not coming from program logic. It probably might be caused from unstable network status. (Especially handling TLS connection).
There is no one reason of that issue, so it has no simple solution to diagnose or solve.
I can’t represent this symptom, so hard to find the solution at this moment.@gonzonia
For me;reconnect once the connection works again, the image being stuck won’t be an issue. Right now once the connection breaks the module can’t recover.
When I force to break the connection then reconnect again, the module works again without issue. This module just loads an image from external google URL on each update schedule. So, if network is ok, image should be loaded and displayed. I suspect your router or proxy setting is interfering TLS connection between Google Server. but not sure.
Anyway, at this moment hard to find reason why yours are not working.
-
@Sean I appreciate you trying. I’ll see if I can figure out more detail. It’s weird because it’ll work fine sometimes for days and then all of a sudden I can’t get it to do more than 1 or 2 photos before it stops. Nothing else on the pi has that issue, newsfeeds still update, weather updates, CalendarExt2 updates.
I’m going to circumvent the pihole I have set up and point to GoogleDNS and see if that helps.
I wasn’t seeing anything from the MagicMirror in the query logs for the pihole which was in itself odd.
-
@sdetweil - I was replying to the warning about the buffer package being deprecated.
-
@bhepler ah. never mind!
-
@Sean I’ve got a theory. I don’t know enough about how it’s all working to be sure, but I’m testing it a little. I noticed in the logs that the error seemed to coincide with something the CalendarExt2 module was doing. Since they’re both connecting to Google, I thought, perhaps there’s something happening there. I’ve disabled the CalendarExt2 module and haven’t had a problem. I’m going to see how it all runs for today and then turn the module back on to see if the problem returns.