randomBrainstormer / MMM-GoogleCalendar

Google Calendar for MagicMirror²
MIT License
73 stars 45 forks source link

Could not fetch calendar #71

Closed pvtpalmer91 closed 1 month ago

pvtpalmer91 commented 2 months ago

I'm not really sure what information to give. I've been going in circles trying to get a private family calendar to populate with no luck.

CLI Error simply states:

[ERROR] MMM-GoogleCalendar Error. Could not fetch calendar: [redacted]@group.calendar.google.com {}

I'm on a fresh install of Raspberry OS, MagicMirror 2.28, and MMM-GoogleCalendar. I've verified my GoogleAPI is working as it shows current calendar events when I run authorize.js.

MagicMirror screen only mentions and error in the MMM-GoogleCalendar module and to check the logs. Although I'm not sure where those logs actually are.

I've checked the dev console for any errors pertaining to MMM-GoogleCalendar and it seems to have loaded everything fine with no errors.

My config.js

{
   module: 'MMM-GoogleCalendar',
   header: "Family Calendar",
   position: "top_left",
        config: {
            calendars: [
                {
                  symbol: "calendar-week",
                  calendarID: "[redacted]@group.calendar.google.com",
            },
        ],
    }
},

Any direction or guidance into more robust logs would be appreciated.

pvtpalmer91 commented 2 months ago

> magicmirror@2.28.0 start:dev
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js dev

[2024-08-29 09:02:22.784] [LOG]   Starting MagicMirror: v2.28.0
[2024-08-29 09:02:22.886] [LOG]   Loading config ...
[2024-08-29 09:02:22.897] [LOG]   config template file not exists, no envsubst
[2024-08-29 09:02:22.910] [LOG]   Loading module helpers ...
[2024-08-29 09:02:22.914] [LOG]   No helper found for module: alert.
[2024-08-29 09:02:22.948] [LOG]   Initializing new module helper ...
[2024-08-29 09:02:22.951] [LOG]   Module helper loaded: updatenotification
[2024-08-29 09:02:22.955] [LOG]   No helper found for module: clock.
[2024-08-29 09:02:30.261] [LOG]   Initializing new module helper ...
[2024-08-29 09:02:30.267] [LOG]   Module helper loaded: MMM-GoogleCalendar
[2024-08-29 09:02:30.271] [LOG]   No helper found for module: weather.
[2024-08-29 09:02:30.273] [LOG]   No helper found for module: weather.
[2024-08-29 09:02:30.275] [LOG]   All module helpers loaded.
[2024-08-29 09:02:30.309] [LOG]   Starting server on port 8080 ...
[2024-08-29 09:02:35.636] [LOG]   Server started ...
[2024-08-29 09:02:35.642] [LOG]   Connecting socket for: updatenotification
[2024-08-29 09:02:35.648] [LOG]   Starting module helper: updatenotification
[2024-08-29 09:02:35.655] [LOG]   Connecting socket for: MMM-GoogleCalendar
[2024-08-29 09:02:35.661] [LOG]   Starting node helper for: MMM-GoogleCalendar
[2024-08-29 09:02:35.665] [LOG]   Sockets connected & modules started ...
[2024-08-29 09:02:37.017] [LOG]   Launching application.
[2024-08-29 09:02:41.487] [INFO]  System information:
### SYSTEM:   manufacturer: Raspberry Pi Foundation; model: Raspberry Pi 2 Model B Rev 1.1; raspberry: [object Object]; virtual: false
### OS:       platform: linux; distro: Raspbian GNU/Linux; release: 12; arch: arm; kernel: 6.6.31+rpt-rpi-v7
### VERSIONS: electron: 31.1.0; used node: 20.14.0; installed node: 20.17.0; npm: 10.8.2; pm2: 5.4.1
### OTHER:    timeZone: America/Denver; ELECTRON_ENABLE_GPU: undefined
[2024-08-29 09:02:48.912] [INFO]  updatenotification: Updater Class Loaded!
[2024-08-29 09:02:48.921] [INFO]  updatenotification: Checking PM2 using...
[2024-08-29 09:02:50.989] [INFO]  Checking git for module: MMM-GoogleCalendar
[2024-08-29 09:02:53.889] [INFO]  Checking git for module: MagicMirror
[2024-08-29 09:02:53.989] [INFO]  updatenotification: [PM2] You are not using pm2
[2024-08-29 09:02:54.534] [LOG]   Fetching calendar data for: [redacted]@group.calendar.google.com
[2024-08-29 09:02:54.537] [LOG]   Parameters - fetchInterval: 300000, maximumEntries: 10, pastDaysCount: 0, identifier: module_3_MMM-GoogleCalendar
[2024-08-29 09:02:54.587] [ERROR] MMM-GoogleCalendar Error. Could not fetch calendar:  [redacted]@group.calendar.google.com {}

Screenshot from 2024-08-29 09-10-03 Screenshot from 2024-08-29 09-11-11

randomBrainstormer commented 2 months ago

Hi, thanks for opening the issue.

It seems like the error message isn't providing much detail where we'd expect, as indicated by the empty brackets in the MMM-GoogleCalendar Error line. Since your token seems to be working correctly when you run authorize.js, the issue likely occurs when the module attempts to use the token.

To help resolve this, I've updated the module to try fix that empty bracket and get to the bottom of this. Could you update the module then authorize again and retry checking the log?

pvtpalmer91 commented 1 month ago

@randomBrainstormer

I am not entirely sure what I did different, but it seems to be working. When you asked me to update the module, I must admit I'm not familiar with how to do that. Instead I decided to start from scratch. I follow the same steps as previously, this time however, it just worked.

Thanks for taking the time to look into my issue.