I experience a similar issue with several public Google calendars. However, it’s not unique to ICSx5, but happens on other clients too, including Mozilla Thunderbird and Mailfence. Basically, what I am observing is the following:
On adding the calendar, the client is generally able to fetch all events. But on subsequent tries to refresh, it fails.
A public Google calendar (https://calendar.google.com/calendar/ical/aikfotboll2019%40gmail.com/public/basic.ics) that I have subscribed to for several months sporadically fails with the infamous error “failed to connect to calendar.google.com …”. However, I have reason to believe that it occasionally succeeds, because there are events in my calendar that I don’t think were there at the time of subscribing.
An hour ago, I tried adding another public Google calendar (https://calendar.google.com/calendar/ical/sv.swedish%23holiday%40group.v.calendar.google.com/public/basic.ics) to Thunderbird. Again, adding it succeeded, and events showed up as expected. However, it soon changed status to “The calendar … is momentarily not available” and has stayed that way since.
Just now, I’ve been trying to subscribe to several public calendars that are not hosted by Google, e.g. webcal://www.allsvenskan.se/prenumerera-pa-matcherna-i-din-kalender/aik.ics and https://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics. However, both of them fail the “Validating calendar resource…” step.
If my guess is correct that the background synchronization occasionally succeeds, I believe it would be an improvement to let the user add the calendar regardless of the outcome of the calendar resource validation. Perhaps a button “Add anyway” in the failure dialog. That way, the app would periodically retry fetching it for me in the background.
EDIT: Here’s some output from adb logcat '*:W' 'icsx5:V' when pulling to refresh in ICSx5 with a single calendar subscription:
03-13 14:40:11.415 23218 23218 D icsx5 : Sync running: false
03-13 14:40:11.416 23218 23441 I icsx5 : Synchronizing Calendar subscriptions
03-13 14:40:11.417 23218 23218 D icsx5 : Sync running: true
03-13 14:40:11.433 23218 23442 I icsx5 : Synchronizing https://calendar.google.com/calendar/ical/aikfotboll2019@gmail.com/public/basic.ics
03-13 14:40:12.680 1451 1451 W Looper : Slow dispatch took 259ms main h=android.app.ActivityThread$H c=android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA@9b649a9 m=0
03-13 14:40:12.680 1451 1451 W Looper : Slow delivery took 268ms main h=android.app.ActivityThread$H c=android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA@ec50b2e m=0
03-13 14:40:12.713 1451 1487 W Searchables: No global search activity found
03-13 14:40:12.715 1451 1487 W VoiceInteractionManagerService: no available voice interaction services found for user 0
03-13 14:40:13.952 1451 1451 W Looper : Drained
03-13 14:40:18.018 18028 21550 W AlarmSleepTimer: Setting alarm to wake up in 55000ms.
03-13 14:40:18.024 18028 21551 W AlarmSleepTimer: Setting alarm to wake up in 55000ms.
03-13 14:40:18.025 18028 18028 W AlarmSleepTimer: Waking up.
03-13 14:40:32.068 23218 23442 W icsx5 : Sync error
03-13 14:40:32.068 23218 23442 W icsx5 : java.net.SocketTimeoutException: failed to connect to calendar.google.com/2a00:1450:400f:803::200e (port 443) from /fc00:bbbb:bbbb:bb01::8:358e (port 38126) after 10000ms
03-13 14:40:32.068 23218 23442 W icsx5 : at libcore.io.IoBridge.connectErrno(IoBridge.java:191)
03-13 14:40:32.068 23218 23442 W icsx5 : at libcore.io.IoBridge.connect(IoBridge.java:135)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.net.Socket.connect(Socket.java:621)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:120)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
03-13 14:40:32.068 23218 23442 W icsx5 : at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
03-13 14:40:32.068 23218 23442 W icsx5 : at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:129)
03-13 14:40:32.068 23218 23442 W icsx5 : at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:44)
03-13 14:40:32.068 23218 23442 W icsx5 : at at.bitfire.icsdroid.ProcessEventsTask.processEvents(ProcessEventsTask.kt:101)
03-13 14:40:32.068 23218 23442 W icsx5 : at at.bitfire.icsdroid.ProcessEventsTask.run(ProcessEventsTask.kt:34)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-13 14:40:32.068 23218 23442 W icsx5 : at java.lang.Thread.run(Thread.java:919)
03-13 14:40:32.068 23218 23442 W icsx5 : Suppressed: java.net.SocketTimeoutException: failed to connect to calendar.google.com/142.250.74.110 (port 443) from /10.71.53.143 (port 47555) after 10000ms
03-13 14:40:32.068 23218 23442 W icsx5 : ... 32 more
03-13 14:40:32.114 15710 17155 W ContentResolver: Failed to get type for: content://com.android.calendar (Unknown URL content://com.android.calendar)
03-13 14:40:32.129 23218 23442 I icsx5 : iCalendar file completely processed
03-13 14:40:32.162 23218 23218 D icsx5 : Sync running: false
EDIT(2): After restarting my phone, synchronization succeeded. Logs:
03-13 14:53:22.881 5684 5684 D icsx5 : Sync running: false
03-13 14:53:22.882 5684 6315 I icsx5 : Synchronizing Calendar subscriptions
03-13 14:53:22.891 5684 5684 D icsx5 : Sync running: true
03-13 14:53:22.941 5684 6316 I icsx5 : Synchronizing https://calendar.google.com/calendar/ical/aikfotboll2019@gmail.com/public/basic.ics
03-13 14:53:23.441 5684 6316 W itfire.icsdroi: Accessing hidden field Ljava/util/Collections$SynchronizedCollection;->mutex:Ljava/lang/Object; (greylist-max-o, reflection, denied)
03-13 14:53:23.441 5684 6316 W itfire.icsdroi: Accessing hidden method Ljava/util/Collections$SynchronizedSet;-><init>(Ljava/util/Set;Ljava/lang/Object;)V (greylist-max-o, reflection, denied)
03-13 14:53:23.441 5684 6316 W itfire.icsdroi: Accessing hidden method Ljava/util/Collections$SynchronizedCollection;-><init>(Ljava/util/Collection;Ljava/lang/Object;)V (greylist-max-o, reflection, denied)
03-13 14:53:23.449 2516 2516 W AvrcpMediaPlayerWrapper: The session was destroyed org.thoughtcrime.securesms
03-13 14:53:23.566 5684 6316 I icsx5 : Processing 102 events
03-13 14:53:23.566 5684 6316 D icsx5 : Found VEVENT: 5e4a2t8cu0jr6itjfvi0rt59os@google.com
03-13 14:53:23.571 5684 6316 D icsx5 : 5e4a2t8cu0jr6itjfvi0rt59os@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T135817Z
03-13 14:53:23.571 5684 6316 D icsx5 : 5e4a2t8cu0jr6itjfvi0rt59os@google.com has not been modified since last sync
03-13 14:53:23.571 5684 6316 D icsx5 : Found VEVENT: 6hpp58n511h6vvnv6tsfgq8c9r@google.com
03-13 14:53:23.574 5684 6316 D icsx5 : 6hpp58n511h6vvnv6tsfgq8c9r@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T135652Z
03-13 14:53:23.574 5684 6316 D icsx5 : 6hpp58n511h6vvnv6tsfgq8c9r@google.com has not been modified since last sync
03-13 14:53:23.574 5684 6316 D icsx5 : Found VEVENT: 0p3vad213ak6ods0he6r4lb3r2@google.com
03-13 14:53:23.577 5684 6316 D icsx5 : 0p3vad213ak6ods0he6r4lb3r2@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T135457Z
03-13 14:53:23.577 5684 6316 D icsx5 : 0p3vad213ak6ods0he6r4lb3r2@google.com has not been modified since last sync
03-13 14:53:23.577 5684 6316 D icsx5 : Found VEVENT: 22rv6n2d1usnuvceof1u1ofu24@google.com
03-13 14:53:23.580 5684 6316 D icsx5 : 22rv6n2d1usnuvceof1u1ofu24@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T135345Z
03-13 14:53:23.580 5684 6316 D icsx5 : 22rv6n2d1usnuvceof1u1ofu24@google.com has not been modified since last sync
03-13 14:53:23.580 5684 6316 D icsx5 : Found VEVENT: 2liakem1g049dnq4a5oi5h0a0h@google.com
03-13 14:53:23.583 5684 6316 D icsx5 : 2liakem1g049dnq4a5oi5h0a0h@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T135152Z
03-13 14:53:23.583 5684 6316 D icsx5 : 2liakem1g049dnq4a5oi5h0a0h@google.com has not been modified since last sync
03-13 14:53:23.584 5684 6316 D icsx5 : Found VEVENT: 2calf7fa7kp2ied7c8u7a2u7g9@google.com
03-13 14:53:23.587 5684 6316 D icsx5 : 2calf7fa7kp2ied7c8u7a2u7g9@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T135044Z
03-13 14:53:23.587 5684 6316 D icsx5 : 2calf7fa7kp2ied7c8u7a2u7g9@google.com has not been modified since last sync
03-13 14:53:23.587 5684 6316 D icsx5 : Found VEVENT: 57cpoei5m4vrtmg1n44l64oo81@google.com
03-13 14:53:23.591 5684 6316 D icsx5 : 57cpoei5m4vrtmg1n44l64oo81@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T134920Z
03-13 14:53:23.591 5684 6316 D icsx5 : 57cpoei5m4vrtmg1n44l64oo81@google.com has not been modified since last sync
03-13 14:53:23.591 5684 6316 D icsx5 : Found VEVENT: 1smup6s5acid4nuposhb7js8b3@google.com
03-13 14:53:23.594 5684 6316 D icsx5 : 1smup6s5acid4nuposhb7js8b3@google.com already in local calendar, lastModified = LAST-MODIFIED:20210312T134753Z
...
03-13 14:53:23.859 5684 6316 D icsx5 : 5gba371of6t628497692eo6atq@google.com has not been modified since last sync
03-13 14:53:23.859 5684 6316 D icsx5 : Found VEVENT: 5562cqun5gv3cjh4114i8gfc1e@google.com
03-13 14:53:23.866 5684 6316 D icsx5 : 5562cqun5gv3cjh4114i8gfc1e@google.com already in local calendar, lastModified = LAST-MODIFIED:20190115T140451Z
03-13 14:53:23.866 5684 6316 D icsx5 : 5562cqun5gv3cjh4114i8gfc1e@google.com has not been modified since last sync
03-13 14:53:23.866 5684 6316 D icsx5 : Found VEVENT: 4i4t02j4ionf9drpd6nb16oqtu@google.com
03-13 14:53:23.874 5684 6316 D icsx5 : 4i4t02j4ionf9drpd6nb16oqtu@google.com already in local calendar, lastModified = LAST-MODIFIED:20181204T101951Z
03-13 14:53:23.874 5684 6316 D icsx5 : 4i4t02j4ionf9drpd6nb16oqtu@google.com has not been modified since last sync
03-13 14:53:23.874 5684 6316 D icsx5 : Found VEVENT: 0emnlecr2lvt1u6u47r5if5fug@google.com
03-13 14:53:23.881 5684 6316 D icsx5 : 0emnlecr2lvt1u6u47r5if5fug@google.com already in local calendar, lastModified = LAST-MODIFIED:20181204T101812Z
03-13 14:53:23.881 5684 6316 D icsx5 : 0emnlecr2lvt1u6u47r5if5fug@google.com has not been modified since last sync
03-13 14:53:23.881 5684 6316 D icsx5 : Found VEVENT: 7127o5n2ljntc4fgi8d4e8i921@google.com
03-13 14:53:23.890 5684 6316 D icsx5 : 7127o5n2ljntc4fgi8d4e8i921@google.com already in local calendar, lastModified = LAST-MODIFIED:20181204T101610Z
03-13 14:53:23.890 5684 6316 D icsx5 : 7127o5n2ljntc4fgi8d4e8i921@google.com has not been modified since last sync
03-13 14:53:23.890 5684 6316 I icsx5 : Deleting old events (retaining 102 events by UID) …
03-13 14:53:23.917 5684 6316 I icsx5 : … 0 events deleted
03-13 14:53:23.917 5684 6316 I icsx5 : Calendar sync successful, ETag=null, lastModified=null
03-13 14:53:23.927 5156 5499 W ContentResolver: Failed to get type for: content://com.android.calendar (Unknown URL content://com.android.calendar)
03-13 14:53:23.948 5684 6316 I icsx5 : iCalendar file completely processed
03-13 14:53:23.978 5684 5684 D icsx5 : Sync running: false