hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
170 stars 65 forks source link

Google photos freezes until reboot #78

Closed DaniloMagliarisi88 closed 3 years ago

DaniloMagliarisi88 commented 4 years ago

It often happens to me that while everything is working, suddenly the photos freeze and I am forced to restart MagicMirror. I only have two active modules, the clock and google photo. The error that the log says is this:

0|mm | [09:19:57.511] [ERROR] (node:455) [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. 0|mm | [13:23:20.320] [ERROR] error: object file .git/objects/ab/794d61840189c19583b8c726edc88265dd5c51 is empty 0|mm | error: object file .git/objects/ab/794d61840189c19583b8c726edc88265dd5c51 is empty 0|mm | fatal: loose object ab794d61840189c19583b8c726edc88265dd5c51 (stored in .git/objects/ab/794d61840189c19583b8c726edc88265dd5c51) is corrupt 0|mm | fatal: the remote end hung up unexpectedly 0|mm | 0|mm | [19:35:46.793] [ERROR] (node:30362) UnhandledPromiseRejectionWarning: Error: Request failed with status code 503 0|mm | at createError (/home/danilo/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/createError.js:16:15) 0|mm | at settle (/home/danilo/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/settle.js:17:12) 0|mm | at IncomingMessage.handleStreamEnd (/home/danilo/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/adapters/http.js:236:11) 0|mm | at IncomingMessage.emit (events.js:187:15) 0|mm | at endReadableNT (_stream_readable.js:1090:12) 0|mm | at process._tickCallback (internal/process/next_tick.js:63:19) 0|mm | [19:35:46.796] [ERROR] (node:30362) 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) 0|mm | [19:35:46.797] [ERROR] (node:30362) [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.

NorthernMan54 commented 4 years ago

Similar issue appears randomly, looks like the code needs to catch this error and restart or retry

[2020-05-09 11:05:10.911] [LOG]    [GPHOTOS:CORE] Error: Client network socket disconnected before secure TLS connection was established
[2020-05-09 11:05:10.915] [ERROR]  (node:1243) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
    at connResetException (internal/errors.js:559:14)
    at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)
    at Object.onceWrapper (events.js:288:20)
    at TLSSocket.emit (events.js:205:15)
    at endReadableNT (_stream_readable.js:1154:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)
joshuaandrewsN commented 4 years ago

Speculation from a newbie. Seems to happen around the time the cache file in /MagicMirror/modules/MMM-GooglePhotos/cache is updated, which happens every 3 hours.
I set a every-15-minute cronjob to restart MM if no files in that directory are newer than 3hr 10min. Restarting MM creates a new file immediately.

thymon13 commented 4 years ago

@joshuaandrewsN Great !!

I have the same issue: No new photo displayed after a while. But without log error and without the files are 3hr old.

But when I clear this cache folder. The news photos appear !!! No needed to restart MM, it was instantly.

Thank you :)

Need a cronjob now :) :)

jenil commented 4 years ago

I'm stuck on this forever it seems. Tried everything I could. Here is the log:

0|mm     | [2020-07-15 12:31:35.975] [LOG]
0|mm     | [GPHOTOS:CORE] Getting Album info chunks.
0|mm     | [2020-07-15 12:31:37.004] [LOG]
0|mm     | [GPHOTOS:AUTH] Token is alive.
0|mm     | [2020-07-15 12:31:37.007] [LOG]    [GPHOTOS:CORE] Getting Album info chunks.
0|mm     | [2020-07-15 12:31:39.244] [LOG]
0|mm     | [GPHOTOS:CORE] Getting Album info chunks.
0|mm     | [2020-07-15 12:31:41.530] [LOG]
0|mm     | [GPHOTOS:CORE] Getting Album info chunks.
0|mm     | [2020-07-15 12:31:43.691] [LOG]
0|mm     | [GPHOTOS:CORE] Getting Album info chunks.
0|mm     | [2020-07-15 12:31:45.680] [LOG]
0|mm     | [GPHOTOS] Finish Album scanning. Properly scanned : 1
0|mm     | [2020-07-15 12:31:45.764] [LOG]
0|mm     | [GPHOTOS] Initialized
0|mm     | [2020-07-15 12:31:45.771] [LOG]    [GPHOTOS] Start first scanning.
0|mm     | [2020-07-15 12:31:45.777] [LOG]    [GPHOTOS] Start Album scanning
0|mm     | [2020-07-15 12:31:45.832] [LOG]
0|mm     | [GPHOTOS:AUTH] Token is alive.
0|mm     | [2020-07-15 12:31:45.849] [LOG]    [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:31:47.782] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:31:49.418] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:31:53.527] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:31:56.591] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:31:58.454] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:00.479] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:02.566] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:04.668] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:12.902] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:15.497] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:18.634] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:20.262] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:21.908] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:24.606] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:33.201] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:32:43.754] [LOG]
0|mm     | [GPHOTOS:CORE] Indexing photos now.
0|mm     | [2020-07-15 12:33:07.095] [LOG]    [GPHOTOS:CORE] Error: Client network socket disconnected before secure TLS connection was established
0|mm     | [2020-07-15 12:33:07.106] [ERROR]  (node:9987) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
0|mm     |     at connResetException (internal/errors.js:559:14)
0|mm     |     at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)
0|mm     |     at Object.onceWrapper (events.js:288:20)
0|mm     |     at TLSSocket.emit (events.js:205:15)
0|mm     |     at endReadableNT (_stream_readable.js:1154:12)
0|mm     |     at processTicksAndRejections (internal/process/task_queues.js:84:9)
0|mm     | [2020-07-15 12:33:07.110] [ERROR]  (node:9987) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
0|mm     |     at connResetException (internal/errors.js:559:14)
0|mm     |     at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)
0|mm     |     at Object.onceWrapper (events.js:288:20)
0|mm     |     at TLSSocket.emit (events.js:205:15)
0|mm     |     at endReadableNT (_stream_readable.js:1154:12)
0|mm     |     at processTicksAndRejections (internal/process/task_queues.js:84:9)
0|mm     | [2020-07-15 12:33:07.115] [ERROR]  (node:9987) 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)
0|mm     | [2020-07-15 12:33:07.117] [ERROR]  (node:9987) 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)
0|mm     | [2020-07-15 12:33:07.122] [ERROR]  (node:9987) [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.
0|mm     | [2020-07-15 12:33:07.141] [ERROR]  (node:9987) [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.
jenil commented 4 years ago

Fixed by increasing the pm2 memory limit on my rPi.

doscas commented 4 years ago

Hi @jenil, how did you

Fixed by increasing the pm2 memory limit on my rPi.

? Can you please detail or point some "how-to" link? Thank you

jenil commented 4 years ago

@doscas I ran pm2 start 0 --node-args="--max_old_space_size=1024"

doscas commented 4 years ago

Thanks. I believe that needs to be done after each reboot, no? I'm sorry, I'm no expert on this, not even close.

jenil commented 4 years ago

The issue is actually poorly written code here, the indexing of photos from any large album breaks the code due to lack of memory management (var list becomes too big)

doscas commented 4 years ago

And no one can solve that? As you put it, it does not seem something very complicated. I am only confortable in VBA. I guess I can learn something and try to do something about it, but it's going to take me a while. I bet someone would do it much faster... for a couple of beers! :)

Is the number 99999 the issue? I guess not, as my album is smaller than that. Is it the type of variable or something like it?

jenil commented 4 years ago

@doscas for now I've just made a smaller album with 50 photos and things seem to be working fine.

doscas commented 4 years ago

@jenil I get that. I have it with an album that gets all my kid's pictures automatically, so it piles pictures everyday. They love seeing their pictures showing up, specially of things that happened recently. If I could somehow script Google Photos, it would be easy to adapt the album to only retrieve certain dates or to shift those dates every day. I guess I'll need to find the time to learn javascript and get to fix that.

ChrisAcrobat commented 4 years ago

I do not think I have come across this, but could be that my Pi is not allowed to be running long enough. Is this still a problem?

tb1silkmatthew commented 4 years ago

Yes, I have the same problem. I have 335 photos in my Google album and have it running 24/7. I noticed that it seems to freeze after about 2 days of use. I have a workaround of a cron job that resets the pi every 2 days but would love not to do that.

ChrisAcrobat commented 4 years ago

Me too, this will probably affect me as well in the near future. Would someone like to submit a PR? I will hopefully have more time to look into this later, but until then.

hardj300 commented 4 years ago

I too can confirm this issue with a large album. I am in the same position as @doscas where I have a large album of constantly updating kid photos. I have yet to figure how to automate gPhotos to keep an album of 50 or less photos. Although it would be nice to have a hands on solution for MM, I will just wait to see if there is a confirmed fix here. Thanks for the help.

gonzonia commented 4 years ago

I ran pm2 start 0 --node-args="--max_old_space_size=1024"

@jenil I tried running this and it errored. Any other ideas on how to add this to start up?

jenil commented 4 years ago

@gonzonia reduce the number of photos in the album and it works.

gonzonia commented 4 years ago

@jenil It won't even run if I try that command bash: --max_old_space_size=1024: invalid option

jenil commented 4 years ago

@jenil It won't even run if I try that command bash: --max_old_space_size=1024: invalid option

@gonzonia no need to run the command if you just use a smaller album

gonzonia commented 4 years ago

@jenil Yeah, that defeats the reason for using something that connects to Google Photos for me. If I wanted to curate the photos, I'd move them locally. (I realize this sounds snarky, that's unintentional, just trying to indicate my use)

DaniloMagliarisi88 commented 4 years ago

this is my workaround for whenever it crashes. check the error log if the message that crashes googlephoto is present and if the error is present restart pm2. I put the file in the crontab which checks every 10 minutes. `cd /home/USER/.pm2/logs/ #Changing directory to your working directory File = mm-error.log
if grep -q UnhandledPromiseRejectionWarning "$File"; then echo "Issue with google photo" rm -rf /home/USER/.pm2/logs/mm-error.log #change USER directory pm2 restart mm #change mm with your pm2 script

else echo "No issue" fi`

roccodicarlo commented 4 years ago

I have noticed that in the last week or two, my googlephotos has not frozen anymore. Is it possible that google made a change so that it is not freezing. Is anyone else experiencing a change?

[3 weeks later] I think I spoke too soon. It started happening again. It freezes after a couple of days.

tb1silkmatthew commented 4 years ago

I have noticed that in the last week or two, my googlephotos has not frozen anymore. Is it possible that google made a change so that it is not freezing. Is anyone else experiencing a change?

Yes, now you say it. I have noticed the same, as I have not been restarting the service every other day. It's just the weekly Cron restart job, so I will turn that off as well and see how long it lasts.

bhaules commented 4 years ago

I'm having the same issue as you guys. I was on the older version and it was working with no issues. I wanted to get the nicer look so I upgraded. Now my photos change for about one hour and then it gets stuck until I restart magic mirror. I wanted to post my logs but I used @kisspachyousee 's script and deleted mm-error.log. I can see it started working for some of you. I'm not sure why or how.

Cheers

bhaules commented 4 years ago

On my end it works okay for a couple of hours and it then freezes. This is what I got from my logs. Thanks in advance for looking into this issue. [14:31:55.676] [LOG] [GPHOTOS] Getting album list 200266 [14:31:55.698] [LOG] [GPHOTOS:AUTH] Token is alive. 200267 [14:31:55.704] [LOG] [GPHOTOS:CORE] Getting Album info chunks. 200268 [14:31:57.345] [LOG] en 200269 [14:31:59.467] [LOG] [GPHOTOS:AUTH] Token is alive. 200270 [14:31:59.479] [LOG] [GPHOTOS:CORE] Getting Album info chunks. 200271 [14:32:01.470] [LOG] [GPHOTOS] Finish Album scanning. Properly scanned : 1 200272 [14:32:01.486] [LOG] [GPHOTOS] Initialized 200273 [14:32:01.488] [LOG] [GPHOTOS] Start first scanning. 200274 [14:32:01.490] [LOG] [GPHOTOS] Start Album scanning 200275 [14:32:01.512] [LOG] [GPHOTOS:AUTH] Token is alive. 200276 [14:32:01.515] [LOG] [GPHOTOS:CORE] Indexing photos now. 200277 [14:32:04.591] [LOG] [GPHOTOS:CORE] Indexing photos now. 200278 [14:32:07.367] [LOG] [GPHOTOS:CORE] Indexing photos now. 200279 [14:32:14.508] [LOG] [GPHOTOS:CORE] Indexing photos now. 200280 [14:32:17.644] [LOG] [GPHOTOS:CORE] Indexing photos now. 200281 [14:32:21.389] [LOG] [GPHOTOS:CORE] Indexing photos now. 200282 [14:32:24.499] [LOG] [GPHOTOS:CORE] Indexing photos now. 200283 [14:32:26.624] [LOG] [GPHOTOS:CORE] Indexing photos now. 200284 [14:32:31.804] [LOG] [GPHOTOS:CORE] Indexing photos now. 200285 [14:32:40.089] [LOG] [GPHOTOS:CORE] Indexing photos now. 200286 [14:32:42.327] [LOG] [GPHOTOS:CORE] Indexing photos now. 200287 [14:32:44.823] [LOG] [GPHOTOS:CORE] Indexing photos now. 200288 [14:32:48.189] [LOG] [GPHOTOS:CORE] Indexing photos now. 200289 [14:32:51.700] [LOG] [GPHOTOS:CORE] Indexing photos now. 200290 [14:32:55.122] [LOG] [GPHOTOS:CORE] Indexing photos now. 200291 [14:32:57.292] [LOG] [GPHOTOS:CORE] Indexing photos now. 200292 [14:32:59.371] [LOG] [GPHOTOS:CORE] Indexing photos now. 200293 [14:33:01.459] [LOG] [GPHOTOS:CORE] Indexing photos now. 200294 [14:33:04.559] [LOG] [GPHOTOS:CORE] Indexing photos now. 200295 [14:33:07.727] [LOG] [GPHOTOS:CORE] Indexing photos now. 200296 [14:33:11.384] [LOG] [GPHOTOS:CORE] Indexing photos now. 200297 [14:33:14.550] [LOG] [GPHOTOS:CORE] Indexing photos now. 200298 [14:33:17.683] [LOG] [GPHOTOS:CORE] Indexing photos now. 200299 [14:33:20.789] [LOG] [GPHOTOS:CORE] Indexing photos now. 200300 [14:33:22.969] [LOG] [GPHOTOS:CORE] Indexing photos now. 200301 [14:33:25.076] [LOG] [GPHOTOS:CORE] Indexing photos now. 200302 [14:33:27.435] [LOG] [GPHOTOS:CORE] Indexing photos now. 200303 [14:33:29.541] [LOG] [GPHOTOS:CORE] Indexing photos now. 200304 [14:33:32.729] [LOG] [GPHOTOS:CORE] Indexing photos now. 200305 [14:33:34.964] [LOG] [GPHOTOS:CORE] Indexing photos now. 200306 [14:33:38.083] [LOG] [GPHOTOS:CORE] Indexing photos now. 200307 [14:33:41.616] [LOG] [GPHOTOS:CORE] Indexing photos now. 200308 [14:33:44.829] [LOG] [GPHOTOS:CORE] Indexing photos now. 200309 [14:33:47.967] [LOG] [GPHOTOS:CORE] Indexing photos now. 200310 [14:33:50.417] [LOG] [GPHOTOS:CORE] Indexing photos now. 200311 [14:33:52.637] [LOG] [GPHOTOS:CORE] Indexing photos now. 200312 [14:33:54.691] [LOG] [GPHOTOS:CORE] Indexing photos now. 200313 [14:33:56.831] [LOG] [GPHOTOS:CORE] Indexing photos now. 200314 [14:34:04.977] [LOG] [GPHOTOS:CORE] Indexing photos now. 200315 [14:34:08.076] [LOG] [GPHOTOS:CORE] Indexing photos now. 200316 [14:34:10.056] [LOG] [GPHOTOS:CORE] Indexing photos now. 200317 [14:34:13.201] [LOG] [GPHOTOS:CORE] Indexing photos now. 200318 [14:34:15.483] [LOG] [GPHOTOS:CORE] Indexing photos now. 200319 [14:34:17.699] [LOG] [GPHOTOS:CORE] Indexing photos now. 200320 [14:34:19.788] [LOG] [GPHOTOS:CORE] Indexing photos now. 200321 [14:34:21.990] [LOG] [GPHOTOS:CORE] Indexing photos now. 200322 [14:34:23.988] [LOG] [GPHOTOS:CORE] Indexing photos now. 200323 [14:34:26.204] [LOG] [GPHOTOS:CORE] Indexing photos now. 200324 [14:34:28.344] [LOG] [GPHOTOS:CORE] Indexing photos now. 200325 [14:34:30.551] [LOG] [GPHOTOS:CORE] Indexing photos now. 200326 [14:34:32.753] [LOG] [GPHOTOS:CORE] Indexing photos now. 200327 [14:34:35.308] [LOG] [GPHOTOS:CORE] Indexing photos now. 200328 [14:34:37.895] [LOG] [GPHOTOS:CORE] Indexing photos now. 200329 [14:34:40.908] [LOG] [GPHOTOS:CORE] Indexing photos now. 200330 [14:34:43.001] [LOG] [GPHOTOS:CORE] Indexing photos now. 200331 [14:34:45.043] [LOG] [GPHOTOS:CORE] Indexing photos now. 200332 [14:34:48.138] [LOG] [GPHOTOS] Getting 2654 photo(s) list from 'FamilyPhotos' 200333 [14:34:48.144] [LOG] [GPHOTOS] Total indexed photos: 2654 200334 [14:34:51.483] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_Zmc9qDe3ItG 200335 [14:36:54.317] [LOG] Notification: GET_SOLAR Payload: [object Object] 200336 [14:37:32.239] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_YGSKIaYPIsO 200337 [14:40:11.219] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_ZBXOXEubtEV 200338 [14:41:54.317] [LOG] Notification: GET_SOLAR Payload: [object Object] 200339 [14:42:51.526] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_ZlySJ8PWJHk 200340 [14:45:31.222] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_Z-a2iQo4YN3 200341 [14:46:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200342 [14:48:11.485] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_YlzcXZ7zZKr 200343 [14:50:51.564] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_apR5RCTLTuV 200344 [14:51:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200345 [14:53:30.864] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_YmPDjqYqeHN 200346 [14:56:11.215] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_YyaCc0vaJKm 200347 [14:56:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200348 [14:58:52.127] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_ZIaeJ5dvuYT 200349 [15:01:31.575] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_bO5hmVIJvnO 200350 [15:01:54.316] [LOG] Notification: GET_SOLAR Payload: [object Object] 200351 [15:01:55.673] [LOG] NOAA3 weather updated.. next update in 1 hour 200352 [15:01:57.317] [LOG] en 200353 [15:04:12.174] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_a7-Jcx_hQXc 200354 [15:06:52.035] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/AFBm1_YMn59tu6FQf 200355 [15:06:54.316] [LOG] Notification: GET_SOLAR Payload: [object Object] 200356 [15:09:30.264] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontzLehyigmMj3nmGRQ=w1080-h1920 200357 [15:11:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200358 [15:12:10.208] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontDUS6s35-2gDofCHQ=w1080-h1920 200359 [15:14:50.113] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleuserconte18LPI58F-DpgNAQ=w1080-h1920 200360 [15:16:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200361 [15:17:30.222] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontU2FHxETNGAARAhrA=w1080-h1920 200362 [15:20:10.303] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontgSre-y9uVmFQA3bQ=w1080-h1920 200363 [15:21:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200364 [15:22:50.193] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontgk70l0k_-EdBnXVw=w1080-h1920 200365 [15:25:30.211] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercont7DBxBQwpRJqEsBpQ=w1080-h1920 200366 [15:26:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200367 [15:28:10.090] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontupfV9unszFgAARag=w1080-h1920 200368 [15:29:48.445] [LOG] [GPHOTOS] Start Album scanning 200369 [15:29:48.456] [LOG] [GPHOTOS:AUTH] Token is expired. 200370 [15:29:53.911] [LOG] [GPHOTOS:AUTH] Token is refreshed. 200371 [15:29:53.914] [LOG] [GPHOTOS:CORE] Indexing photos now. 200372 [15:29:57.389] [LOG] [GPHOTOS:CORE] Indexing photos now. 200373 [15:29:59.670] [LOG] [GPHOTOS:CORE] Indexing photos now. 200374 [15:30:01.751] [LOG] [GPHOTOS:CORE] Indexing photos now. 200375 [15:30:03.908] [LOG] [GPHOTOS:CORE] Indexing photos now. 200376 [15:30:06.085] [LOG] [GPHOTOS:CORE] Indexing photos now. 200377 [15:30:08.633] [LOG] [GPHOTOS:CORE] Indexing photos now. 200378 [15:30:11.671] [LOG] [GPHOTOS:CORE] Indexing photos now. 200379 [15:30:19.011] [LOG] [GPHOTOS:CORE] Indexing photos now. 200380 [15:30:21.214] [LOG] [GPHOTOS:CORE] Indexing photos now. 200381 [15:30:23.256] [LOG] [GPHOTOS:CORE] Indexing photos now. 200382 [15:30:25.579] [LOG] [GPHOTOS:CORE] Indexing photos now. 200383 [15:30:27.825] [LOG] [GPHOTOS:CORE] Indexing photos now. 200384 [15:30:29.977] [LOG] [GPHOTOS:CORE] Indexing photos now. 200385 [15:30:32.244] [LOG] [GPHOTOS:CORE] Indexing photos now. 200386 [15:30:39.319] [LOG] [GPHOTOS:CORE] Indexing photos now. 200387 [15:30:41.760] [LOG] [GPHOTOS:CORE] Indexing photos now. 200388 [15:30:45.183] [LOG] [GPHOTOS:CORE] Indexing photos now. 200389 [15:30:47.868] [LOG] [GPHOTOS:CORE] Indexing photos now. 200390 [15:30:50.205] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200391 [15:30:50.738] [LOG] [GPHOTOS:CORE] Indexing photos now. 200392 [15:30:53.971] [LOG] [GPHOTOS:CORE] Indexing photos now. 200393 [15:30:57.359] [LOG] [GPHOTOS:CORE] Indexing photos now. 200394 [15:30:59.420] [LOG] [GPHOTOS:CORE] Indexing photos now. 200395 [15:31:02.620] [LOG] [GPHOTOS:CORE] Indexing photos now. 200396 [15:31:06.183] [LOG] [GPHOTOS:CORE] Indexing photos now. 200397 [15:31:09.451] [LOG] [GPHOTOS:CORE] Indexing photos now. 200398 [15:31:12.233] [LOG] [GPHOTOS:CORE] Indexing photos now. 200399 [15:31:14.332] [LOG] [GPHOTOS:CORE] Indexing photos now. 200400 [15:31:17.934] [LOG] [GPHOTOS:CORE] Indexing photos now. 200401 [15:31:20.255] [LOG] [GPHOTOS:CORE] Indexing photos now. 200402 [15:31:22.363] [LOG] [GPHOTOS:CORE] Indexing photos now. 200403 [15:31:24.702] [LOG] [GPHOTOS:CORE] Indexing photos now. 200404 [15:31:27.805] [LOG] [GPHOTOS:CORE] Indexing photos now. 200405 [15:31:30.916] [LOG] [GPHOTOS:CORE] Indexing photos now. 200406 [15:31:33.203] [LOG] [GPHOTOS:CORE] Indexing photos now. 200407 [15:31:35.264] [LOG] [GPHOTOS:CORE] Indexing photos now. 200408 [15:31:37.547] [LOG] [GPHOTOS:CORE] Indexing photos now. 200409 [15:31:40.338] [LOG] [GPHOTOS:CORE] Indexing photos now. 200410 [15:31:43.347] [LOG] [GPHOTOS:CORE] Indexing photos now. 200411 [15:31:45.799] [LOG] [GPHOTOS:CORE] Indexing photos now. 200412 [15:31:47.934] [LOG] [GPHOTOS:CORE] Indexing photos now. 200413 [15:31:50.418] [LOG] [GPHOTOS:CORE] Indexing photos now. 200414 [15:31:54.316] [LOG] Notification: GET_SOLAR Payload: [object Object] 200415 [15:31:55.676] [LOG] NOAA3 weather updated.. next update in 1 hour 200416 [15:31:57.393] [LOG] en 200417 [15:31:57.542] [LOG] [GPHOTOS:CORE] Indexing photos now. 200418 [15:31:59.723] [LOG] [GPHOTOS:CORE] Indexing photos now. 200419 [15:32:02.886] [LOG] [GPHOTOS:CORE] Indexing photos now. 200420 [15:32:06.095] [LOG] [GPHOTOS:CORE] Indexing photos now. 200421 [15:32:13.348] [LOG] [GPHOTOS:CORE] Indexing photos now. 200422 [15:32:16.583] [LOG] [GPHOTOS:CORE] Indexing photos now. 200423 [15:32:18.807] [LOG] [GPHOTOS:CORE] Indexing photos now. 200424 [15:32:25.912] [LOG] [GPHOTOS:CORE] Indexing photos now. 200425 [15:32:28.100] [LOG] [GPHOTOS:CORE] Indexing photos now. 200426 [15:32:31.186] [LOG] [GPHOTOS:CORE] Indexing photos now. 200427 [15:32:33.223] [LOG] [GPHOTOS:CORE] Indexing photos now. 200428 [15:32:35.684] [LOG] [GPHOTOS:CORE] Indexing photos now. 200429 [15:32:37.715] [LOG] [GPHOTOS:CORE] Indexing photos now. 200430 [15:32:40.322] [LOG] [GPHOTOS:CORE] Indexing photos now. 200431 [15:32:43.982] [LOG] [GPHOTOS] Getting 2654 photo(s) list from 'FamilyPhotos' 200432 [15:32:43.989] [LOG] [GPHOTOS] Total indexed photos: 2654 200433 [15:32:47.872] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200434 [15:35:28.214] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200435 [15:36:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200436 [15:38:07.489] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200437 [15:40:48.181] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200438 [15:41:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200439 [15:43:28.367] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200440 [15:46:08.376] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200441 [15:46:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200442 [15:48:48.523] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200443 [15:51:27.556] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200444 [15:51:54.314] [LOG] Notification: GET_SOLAR Payload: [object Object] 200445 [15:54:07.143] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200446 [15:56:47.953] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200447 [15:56:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200448 [15:59:27.644] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200449 [16:01:54.315] [LOG] Notification: GET_SOLAR Payload: [object Object] 200450 [16:01:55.676] [LOG] NOAA3 weather updated.. next update in 1 hour 200451 [16:01:57.632] [LOG] en 200452 [16:02:07.799] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200453 [16:04:48.541] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200454 [16:06:54.315] [LOG] Notification: GET_SOLAR Payload: [object Object] 200455 [16:07:27.247] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200456 [16:10:07.610] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200457 [16:11:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200458 [16:12:48.487] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200459 [16:15:27.652] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200460 [16:16:54.312] [LOG] Notification: GET_SOLAR Payload: [object Object] 200461 [16:18:07.740] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200462 [16:20:47.874] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200463 [16:21:54.312] [LOG] Notification: GET_SOLAR Payload: [object Object] 200464 [16:23:27.561] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200465 [16:26:08.001] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200466 [16:26:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200467 [16:27:44.207] [LOG] [GPHOTOS] Start Album scanning 200468 [16:27:44.229] [LOG] [GPHOTOS:AUTH] Token is alive. 200469 [16:27:44.233] [LOG] [GPHOTOS:CORE] Indexing photos now. 200470 [16:27:47.855] [LOG] [GPHOTOS:CORE] Indexing photos now. 200471 [16:27:50.220] [LOG] [GPHOTOS:CORE] Indexing photos now. 200472 [16:27:52.249] [LOG] [GPHOTOS:CORE] Indexing photos now. 200473 [16:27:54.686] [LOG] [GPHOTOS:CORE] Indexing photos now. 200474 [16:27:56.804] [LOG] [GPHOTOS:CORE] Indexing photos now. 200475 [16:27:58.863] [LOG] [GPHOTOS:CORE] Indexing photos now. 200476 [16:28:01.585] [LOG] [GPHOTOS:CORE] Indexing photos now. 200477 [16:28:04.008] [LOG] [GPHOTOS:CORE] Indexing photos now. 200478 [16:28:07.214] [LOG] [GPHOTOS:CORE] Indexing photos now. 200479 [16:28:10.446] [LOG] [GPHOTOS:CORE] Indexing photos now. 200480 [16:28:18.181] [LOG] [GPHOTOS:CORE] Indexing photos now. 200481 [16:28:21.571] [LOG] [GPHOTOS:CORE] Indexing photos now. 200482 [16:28:23.616] [LOG] [GPHOTOS:CORE] Indexing photos now. 200483 [16:28:25.653] [LOG] [GPHOTOS:CORE] Indexing photos now. 200484 [16:28:27.719] [LOG] [GPHOTOS:CORE] Indexing photos now. 200485 [16:28:30.887] [LOG] [GPHOTOS:CORE] Indexing photos now. 200486 [16:28:32.979] [LOG] [GPHOTOS:CORE] Indexing photos now. 200487 [16:28:35.274] [LOG] [GPHOTOS:CORE] Indexing photos now. 200488 [16:28:37.241] [LOG] [GPHOTOS:CORE] Indexing photos now. 200489 [16:28:40.701] [LOG] [GPHOTOS:CORE] Indexing photos now. 200490 [16:28:43.137] [LOG] [GPHOTOS:CORE] Indexing photos now. 200491 [16:28:46.245] [LOG] [GPHOTOS:CORE] Indexing photos now. 200492 [16:28:48.223] [LOG] [GPHOTOS] Image loaded: https://lh3.googleusercontent.com/lr/ 200493 [16:28:49.529] [LOG] [GPHOTOS:CORE] Indexing photos now. 200494 [16:28:51.805] [LOG] [GPHOTOS:CORE] Indexing photos now. 200495 [16:28:53.782] [LOG] [GPHOTOS:CORE] Indexing photos now. 200496 [16:28:55.828] [LOG] [GPHOTOS:CORE] Indexing photos now. 200497 [16:28:58.881] [LOG] [GPHOTOS:CORE] Indexing photos now. 200498 [16:29:01.989] [LOG] [GPHOTOS:CORE] Indexing photos now. 200499 [16:29:05.070] [LOG] [GPHOTOS:CORE] Indexing photos now. 200500 [16:29:07.320] [LOG] [GPHOTOS:CORE] Indexing photos now. 200501 [16:29:09.519] [LOG] [GPHOTOS:CORE] Indexing photos now. 200502 [16:29:11.513] [LOG] [GPHOTOS:CORE] Indexing photos now. 200503 [16:29:13.649] [LOG] [GPHOTOS:CORE] Indexing photos now. 200504 [16:29:16.649] [LOG] [GPHOTOS:CORE] Indexing photos now. 200505 [16:29:18.728] [LOG] [GPHOTOS:CORE] Indexing photos now. 200506 [16:29:20.901] [LOG] [GPHOTOS:CORE] Indexing photos now. 200507 [16:29:22.972] [LOG] [GPHOTOS:CORE] Indexing photos now. 200508 [16:29:30.078] [LOG] [GPHOTOS:CORE] Indexing photos now. 200509 [16:29:32.281] [LOG] [GPHOTOS:CORE] Indexing photos now. 200510 [16:29:34.420] [LOG] [GPHOTOS:CORE] Indexing photos now. 200511 [16:29:36.616] [LOG] [GPHOTOS:CORE] Indexing photos now. 200512 [16:29:42.889] [LOG] [GPHOTOS:CORE] Indexing photos now. 200513 [16:29:46.002] [LOG] [GPHOTOS:CORE] Indexing photos now. 200514 [16:29:48.059] [LOG] [GPHOTOS:CORE] Indexing photos now. 200515 [16:29:50.190] [LOG] [GPHOTOS:CORE] Indexing photos now. 200516 [16:29:53.296] [LOG] [GPHOTOS:CORE] Indexing photos now. 200517 [16:29:55.389] [LOG] [GPHOTOS:CORE] Indexing photos now. 200518 [16:29:58.503] [LOG] [GPHOTOS:CORE] Indexing photos now. 200519 [16:29:59.159] [LOG] [GPHOTOS:CORE] Error: Request failed with status code 401 200520 [16:31:26.849] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200521 [16:31:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object] 200522 [16:31:55.676] [LOG] NOAA3 weather updated.. next update in 1 hour 200523 [16:31:57.315] [LOG] en 200524 [16:34:06.851] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200525 [16:36:46.833] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200526 [16:36:54.315] [LOG] Notification: GET_SOLAR Payload: [object Object] 200527 [16:39:26.906] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200528 [16:41:54.315] [LOG] Notification: GET_SOLAR Payload: [object Object] 200529 [16:42:07.163] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200530 [16:44:46.861] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200531 [16:46:54.315] [LOG] Notification: GET_SOLAR Payload: [object Object] 200532 [16:47:26.857] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200533 [16:50:06.892] [LOG] [GPHOTOS] Image loading fails. Check your network.: https://lh3.googleusercontent.com/lr/ 200534 [16:51:54.313] [LOG] Notification: GET_SOLAR Payload: [object Object]

aneaville commented 3 years ago

I also had this problem of freezing after a while. One contributing factor is that, if a scan isn't completely successfully, there is no way to recover. Scanning small albums does seem to be more reliable. Larger albums( I have 6500 photos) take 6500/50 = 130 api calls which usually takes ~4 mins, but could be longer. There are many reasons for an api request to fail(network or token expiration) and without any error handling it dies. Usually it will continue to show photos for a while after until the photo urls expire after 1 hour.

My fix was rather in depth as I fixed other issues along the way. Try as I might, I couldn't reliable catch the errors, so I ended up changing the flow. I still scan every hour, but I schedule the next scan before attempting to scan.

This is only partially helpful, since the photos will still expire after 1 hour. To combat this, I implemented another one of Google's api methods to 'refresh' the urls. Since this 'refresh' can be a single request, I find it to be extremely reliable.

Lastly, since the scans aren't always reliable, I save the photo list to the cache folder. Then on startup, the cache can be loaded and get photos displayed much faster, and even if the first scan fails, it will continue to work. Before this, it took 5 min to complete a scan and get the first pic to display. OR 1 hour if the first scan failed. Now the first picture shows up in less than 30 sec.

Although no where near my first programming project, this has been my first open source contribution, and first JavaScript project. So I look for guidance on how to pull my changes in. Should I issue a pull request to the master branch or to the 'dev' branch?

Any feedback, or people willing to test would be appreciated.

-Andrew

ChrisAcrobat commented 3 years ago

Although no where near my first programming project, this has been my first open source contribution, and first JavaScript project. So I look for guidance on how to pull my changes in. Should I issue a pull request to the master branch or to the 'dev' branch?

Any feedback, or people willing to test would be appreciated.

I think master is the best choice. I haven't experienced this problem or been able to reproduce it, but I can test it and see if it still runs. (which I expect you already have tested, so might not be that helpful.)

gonzonia commented 3 years ago

I'm happy to test but I haven't had a problem since I started using a variation of kisspachyousee's script with cron

aneaville commented 3 years ago

PR submitted. I'm not sure of the process now, but would appreciate your testing just to confirm I didn't break anything else. My biggest fear is that by trying to help, I end up messing up the great work done ahead of me.

What are the next steps?

ChrisAcrobat commented 3 years ago

My biggest fear is that by trying to help, I end up messing up the great work done ahead of me.

You and me both. (And most other also I guess. 😛)

I will take a look when I have time. I hope tomorrow.

ChrisAcrobat commented 3 years ago

I was not able to get the time to look at it this weekend. I'll try to take the time as soon as I can. @gonzonia would you be able to disable the cron job and download @aneaville's PR and check that it solves the problem for you?

DaniloMagliarisi88 commented 3 years ago

@ChrisAcrobat I'm trying the fix, I'll let you know in the next days if there are any problems.

DaniloMagliarisi88 commented 3 years ago

it seems to work well and the problem has not yet arisen!

ChrisAcrobat commented 3 years ago

Woho! Great work, @aneaville! 👍

gonzonia commented 3 years ago

I hadn't had a chance to test until now, sorry. I saw that it was merged though so I just went ahead and did a git pull. Just turned debugging on to get some extra log info and see how it's working. I'll let you know if I have a problem. Thanks @aneaville for taking this on!