Today I updated my openhab (openhabian), uninstalled gcal, deleted gcal_oauth2_token, created a new project in the google api console (+all additional steps (Api, cliend,…)), updated my client_id and client_secret in the cfg, installed gcal again and entered the code in ‘https://www.google.com/device’.
Log:
2018-03-13 20:10:52.895 [INFO ] [b.core.service.AbstractActiveService] - Google Calendar Event Downloader has been shut down
2018-03-13 20:23:22.206 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - ################################################################################################
2018-03-13 20:23:22.210 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - # Google-Integration: U S E R I N T E R A C T I O N R E Q U I R E D !!
2018-03-13 20:23:22.213 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - # 1. Open URL 'https://www.google.com/device'
2018-03-13 20:23:22.215 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - # 2. Type provided code JQBD-CGBG
2018-03-13 20:23:22.219 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - # 3. Grant openHAB access to your Google calendar
2018-03-13 20:23:22.222 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - # 4. openHAB will automatically detect the permiossions and complete the authentication process
2018-03-13 20:23:22.224 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - # NOTE: You will only have 1800 mins before openHAB gives up waiting for the access!!!
2018-03-13 20:23:22.227 [INFO ] [openhab.io.gcal.auth.GCalGoogleOAuth] - ################################################################################################
2018-03-13 20:24:05.796 [INFO ] [b.core.service.AbstractActiveService] - Google Calendar Event Downloader has been started
2018-03-13 20:24:06.868 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread Google Calendar Event Downloader
java.lang.NullPointerException: null
at org.openhab.io.gcal.internal.GCalEventDownloader.processEntries(GCalEventDownloader.java:276) [236:org.openhab.io.gcal:1.11.0]
at org.openhab.io.gcal.internal.GCalEventDownloader.execute(GCalEventDownloader.java:140) [236:org.openhab.io.gcal:1.11.0]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [219:org.openhab.core.compat1x:2.2.0]
2018-03-13 20:25:07.256 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread Google Calendar Event Downloader
java.lang.NullPointerException: null
at org.openhab.io.gcal.internal.GCalEventDownloader.processEntries(GCalEventDownloader.java:276) [236:org.openhab.io.gcal:1.11.0]
at org.openhab.io.gcal.internal.GCalEventDownloader.execute(GCalEventDownloader.java:140) [236:org.openhab.io.gcal:1.11.0]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [219:org.openhab.core.compat1x:2.2.0]
2018-03-13 20:26:07.680 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread Google Calendar Event Downloader
java.lang.NullPointerException: null
...
My gcal.cfg only has credentials in it. Refresh rate was not set, so it should’ve been set to 900000 by default. However, the updates posted came every second.
I now set it manually to 900000, saved, restarted the bundle and then removed and restarted it again, so now it’s updating in the default rate.
Digging through the log files I saw that it started just before an all-day event started with this:
2020-01-01 23:59:59.399 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread Google Calendar Event Downloader
java.lang.NullPointerException: null
at org.openhab.io.gcal.internal.GCalEventDownloader.createTriggerAndSchedule(GCalEventDownloader.java:428) ~[?:?]
at org.openhab.io.gcal.internal.GCalEventDownloader.processEntries(GCalEventDownloader.java:307) ~[?:?]
at org.openhab.io.gcal.internal.GCalEventDownloader.execute(GCalEventDownloader.java:144) ~[?:?]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [251:org.openhab.core.compat1x:2.5.0.M4]
and then continued every second until I stopped the bundle. Today (no event) I don’t get any errors, just this:
2020-01-03 07:41:08.767 [INFO ] [b.core.service.AbstractActiveService] - Google Calendar Event Downloader has been started
2020-01-03 07:41:08.769 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Got calendar Arbeiten CalendarID: ---@group.calendar.google.com
2020-01-03 07:41:08.774 [DEBUG] [io.gcal.internal.GCalEventDownloader] - Downloading calendar feed for time interval: 2020-01-03T07:41:08.772+01:00 to 2020-01-03T08:11:08.772+01:00
2020-01-03 07:41:08.781 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Loaded credential
2020-01-03 07:41:08.783 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device access token: ya29.---
2020-01-03 07:41:08.785 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device refresh_token: ---
2020-01-03 07:41:08.787 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device expires_in: 1578037053054
2020-01-03 07:41:08.989 [DEBUG] [io.gcal.internal.GCalEventDownloader] - gcal feed contains no events ...
The logfile shows a lot of this though:
2019-12-29 14:03:26.507 [ERROR] [io.gcal.internal.GCalEventDownloader] - Event fetch failed: connect timed out
2019-12-29 14:06:54.778 [ERROR] [io.gcal.internal.GCalEventDownloader] - Event fetch failed: www.googleapis.com
2019-12-29 14:07:01.085 [ERROR] [io.gcal.internal.GCalEventDownloader] - Event fetch failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2019-12-30 13:33:30.693 [ERROR] [io.gcal.internal.GCalEventDownloader] - Event fetch failed: No route to host (Host unreachable)
When I tested it previously with non-all-day events (but instead starting at a specific time), it did work for me.
So we’re kind of stuck if you’re not getting any events. Our code just calls on the google api to fetch events. That call appears to be returning nothing…
Just checked the Google dashboard and noted that on Jan 2nd between 2pm and 6pm the API request traffic dropped to 0.
I didn’t change anything in that time period though, neither in the API nor in the Openhab settings…
Since I don’t get any error messages on both token and used calender, accessing the right feed shouldn’t be the issue, right?
Do you know of any hurdles that can prevent gcal from finding the events…?
One thing you might try:
shutdown, clear cache, remove or falsify the gcal credentials in the config, restart; this should generate some sort of login error. You can then reset to the right credentials and see if normal behavior is restored.