hermanho / MMM-GooglePhotos

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

Stuck on Loading forever #106

Closed iyashwant closed 3 years ago

iyashwant commented 3 years ago

After starting magic mirror, its just stuck on Loading..

I even regenerated tokens

Below is the error log



[09.04.2021 21:18.27.742] [LOG]   Starting MagicMirror: v2.15.0
[09.04.2021 21:18.27.748] [LOG]   Loading config ...
[09.04.2021 21:18.27.754] [LOG]   Loading module helpers ...
[09.04.2021 21:18.27.756] [LOG]   No helper found for module: alert.
[09.04.2021 21:18.27.929] [LOG]   Initializing new module helper ...
[09.04.2021 21:18.27.930] [LOG]   Module helper loaded: updatenotification
[09.04.2021 21:18.28.229] [LOG]   Initializing new module helper ...
[09.04.2021 21:18.28.229] [LOG]   Module helper loaded: MMM-GooglePhotos
[09.04.2021 21:18.28.230] [LOG]   All module helpers loaded.
[09.04.2021 21:18.28.318] [LOG]   Starting server on port 8080 ... 
[09.04.2021 21:18.28.333] [LOG]   Server started ...
[09.04.2021 21:18.28.334] [LOG]   Connecting socket for: updatenotification
[09.04.2021 21:18.28.335] [LOG]   Connecting socket for: MMM-GooglePhotos
[09.04.2021 21:18.28.336] [LOG]   Sockets connected & modules started ...
[09.04.2021 21:18.28.605] [LOG]   Launching application.
[09.04.2021 21:18.30.208] [INFO]  Checking git for module: MMM-GooglePhotos
[09.04.2021 21:18.31.331] [ERROR] Failed to fetch git data for MMM-GooglePhotos: Error: block timeout reached
[09.04.2021 21:18.32.341] [ERROR] (node:3085) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
[09.04.2021 21:18.32.342] [ERROR] (node:3085) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
[09.04.2021 21:18.32.343] [ERROR] (node:3085) [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.
[09.04.2021 21:18.32.435] [ERROR] Failed to fetch git data for default: Error: block timeout reached
[09.04.2021 21:19.31.509] [ERROR] (node:3085) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
[09.04.2021 21:19.31.511] [ERROR] (node:3085) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
[09.04.2021 21:20.30.765] [ERROR] (node:3085) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
[09.04.2021 21:20.30.766] [ERROR] (node:3085) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
[09.04.2021 21:21.31.450] [ERROR] (node:3085) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

aneaville commented 3 years ago

How long is 'forever'? 5 min, 5 hours, 5 days? This will help me diagnose. Has the module ever worked, or is this your first time trying? How many photos are in the album you are trying to use? And how many albums?

Can you add the following line to the bottom of your MMM-GooglePhotos config: debug: true, This will put more debugging information in the window which will also be helpful.

iyashwant commented 3 years ago

This is the first time I've tried it and then forever as in it never was able to fetch the pictures, maximum time i waited was around 40 mins and the album I'm trying to display has 10 pictures, I'll do debug: true and send you the info here

rdehler commented 3 years ago

Same issue encountered here, new install that never worked. No issues on setup. token.js is there. Adding debug: true did not change the output at all, same result as above. Trying on an album with 1 image, never loads.

NicBetts commented 3 years ago

same issue. stopped working about 2 weeks ago. UnhandledPromiseRejectionWarning all over the log files

nirvine commented 3 years ago

Exactly the same problem here. New setup, photos stuck on "Loading" for at least three hours. Is there a solution in sight?

aneaville commented 3 years ago

Some details that would help troubleshoot from most to least important: logs - specifically with debug: true. Although not drastic, this should add some things to the log file that can help pinpoint where the issue is happening. A note on errors - prior to the last changes that I made, any single error would leave the module dead. I couldn't fix the underlying errors, but I did make things 'retry' such that having errors in the log isn't abnormal, but the module should keep functioning. Some info about your setup - I presume most people are using a raspberry pi a single server/viewer. Also if you are running a docker container or not. Some info about your albums - how many albums, and how many pictures per album. And if the albums are yours or someone else's that has shared them with you.

I'll provide hope that my setup is working quite well. It was installed several months ago, so I guess it's possible that the magic mirror has moved on and left something with this module broken.

nirvine commented 3 years ago

Raspberry Pi 3, running Raspberry OS. OS is up to date. I have followed the instructions given, created a token.js file. Photo album called "Test" created with only 4 photos. I do not know where to find the logs, but am happy to provide them if you can tell me where!

aneaville commented 3 years ago

Assuming you are running the Magic Mirror from the command line, the log is the info that comes up after you hit enter. The command line gets 'hidden' by the mirror. If you press Control + M, it will minimize the mirror to see the command line.

Please add "debug: true," to your config to add the extra debugging lines.

nirvine commented 3 years ago

Log attached. Thanks! MMM-GooglePhotos_log.txt

aneaville commented 3 years ago

Your logs have the 403 error. I believe this means something with your google cloud account is not set up correctly. There is another open issues 104. It has a possible solution in the bottom. No one has reported back that it works or not. I'll copy the info here:

Upon debugging more with the 403 error, I saw this in the logs:

Photos Library API has not been used in project XXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/photoslibrary.googleapis.com/overview?project={XXX my unique Id} then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry

You have to enable the photos library API it looks like.

If this fixes your issue, please report back. And if you could provide some more details on how to do it, it will certainly help others who have the same issue.

nirvine commented 3 years ago

Fixed! I went to the Google Project, and the first screen that showed was one requesting me to enable. I thought I had completed this part of the setup 48 hours earlier, but it appears not. Many Thanks.

diogocaetano commented 3 years ago

I had the same problem with a fresh install. The @aneaville comment solved for me.

OBS: I had to wait 1 hour after activate for the propagate API.

Thank you.

LoganMood commented 3 years ago

Is there anyway to get the Module to reference the default location of photos in Google. So instead of an "Album" look at default?

Thanks

aneaville commented 3 years ago

@LoganMood You should really start a new issue to avoid future confusion. The module is really set up to scan an album. There may be a way to look at 'default', but it would probably take a bit of investigation on your part to figure that out.

The easiest way to get it work is to create a live album and have google put everything in it automatically. Here are some instruction on how to create one: https://support.google.com/photos/answer/6128849?hl=en

Once created, you can have the module grab photos from this new album.