Bug 385364 - Timezone RRULE entry has bot UNTIL and COUNT property
Summary: Timezone RRULE entry has bot UNTIL and COUNT property
Status: RESOLVED UPSTREAM
Alias: None
Product: korganizer
Classification: Applications
Component: timezones (show other bugs)
Version: unspecified
Platform: OpenSUSE Linux
: NOR normal with 22 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-04 15:13 UTC by peter.snauwaert
Modified: 2019-11-06 14:37 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example event exported as an ICS file. (4.27 KB, text/calendar)
2017-10-04 15:13 UTC, peter.snauwaert
Details
ICS file with invalid RRULE entry (1.29 KB, text/plain)
2018-11-10 16:09 UTC, Ingo
Details
Patch and adjusted SPEC file to build a "working" version of kcalcore for opensuse (3.44 KB, application/gzip)
2018-11-11 12:26 UTC, Ingo
Details
PKGBUILD for patched kcalcore 18.12.1 on Arch (1.05 KB, text/plain)
2019-01-17 20:37 UTC, Paul Gouin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peter.snauwaert 2017-10-04 15:13:20 UTC
Created attachment 108164 [details]
Example event exported as an ICS file.

Hi,

I am on Opensuse Tumbleweed, KOrganizer version 5.6.1

When creating a new event in KOrganizer (against Nextcloud calendar), some programs fail to synchronize because the Timezone data for the event holds a "Standard" timezone which has an RRULE entry that has both an UNTIL and a COUNT entry. This is apparently forbidden by RFC if I can believe the error message I get from Outlook CalDav Synchronizer.

This is a recent issue that popped up. Don't know when exactly, my wife started experiencing the synchronization errors "recently".

This is the entry I copied from an ICS file which causes the problem:

BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19790930T030000
RRULE:FREQ=YEARLY;UNTIL=19961027T030000;COUNT=17;BYDAY=-1SU;BYMONTH=9
END:STANDARD

Don't really see the point of that COUNT=17 to be honest, but then again I don't know this format.
Would love to see this fixed permanently but I am also wondering if there is a quick fix (template, setting or file I can change somewhere).

kind regards,
peter
Comment 1 Ingo 2018-11-10 16:09:21 UTC
Created attachment 116239 [details]
ICS file with invalid RRULE entry
Comment 2 Ingo 2018-11-10 16:29:03 UTC
Hi all,

I have the same problem on Opensuse Leap 15.0 with KOrganizer version 5.7.3.

As Peter before me, I use owncloud to hold my calendar, and when I want to sync events created with KOrganizer to Outlook via CalDav Synchronizer, the events are not accepted because of this line:

RRULE:FREQ=YEARLY;UNTIL=19961027T030000;COUNT=16;BYDAY=-1SU;BYMONTH=9

If I understand 3.3.10 Recurrence Rule in https://tools.ietf.org/html/rfc5545 correctly, UNTIL and COUNT are optional but must not both be specified at the same time

>>> The UNTIL or COUNT rule parts are OPTIONAL, but they MUST NOT occur in the same 'recur'.

I did not have this problem when I was still on Opensuse Leap 42.3 (don't remember the KOrganizer version; KDE app suite was 17.04.2).

Could this be fixed, please?

Cheers,
Ingo
Comment 3 Ingo 2018-11-10 16:39:22 UTC
> Would love to see this fixed permanently but I am also wondering if there is
> a quick fix (template, setting or file I can change somewhere).

At the moment I log into the server that runs the owncloud instance, stop the web server, and use the sqlite3 CLI to manually fix the entries like this:

update oc_calendarobjects
set calendardata = replace(calendardata, 'RRULE:FREQ=YEARLY;UNTIL=19961027T030000;COUNT=16;BYDAY=-1SU;BYMONTH=9', 'RRULE:FREQ=YEARLY;UNTIL=19961027T030000;BYDAY=-1SU;BYMONTH=9')
where calendardata like '%RRULE%UNTIL%COUNT%';
Comment 4 Ingo 2018-11-11 12:26:47 UTC
Created attachment 116243 [details]
Patch and adjusted SPEC file to build a "working" version of kcalcore for opensuse
Comment 5 Ingo 2018-11-11 12:36:00 UTC
Hi Peter,

I've been digging around a bit for a workaround that helps me now. With "ldd korganizer" I looked at the libraries it uses and with an educated guess found that the problem is likely to come from package kcalcore instead of korganizer. And looking at the commit history of kcalcore I found the change that caused this behavior: https://bugs.kde.org/show_bug.cgi?id=382712 (the actual code change is https://commits.kde.org/kcalcore/0fd1f0fae1de743da5bc9d56577541442e84799b).

I hadn't noticed any problem for me when I was at the older version not including that change, so I downloaded the source RPM of kcalcore and added a reverse patch to get rid of that change. Then I built the package myself and installed it. Now, new events no longer have both COUNT and UNTIL.

Of course I'm not fully sure about potential side effects, but again, before the kcalcore change mentioned above I didn't have problems with time zone. So I decided it's ok for me now.

If you want to do the same, I have provided an attachment in case you want to build a working version for yourself on opensuse, too. Download the file https://bugs.kde.org/attachment.cgi?id=116243 and then on the command line (as root):

zypper si libKF5CalendarCore5
cd /
tar xfz /path/to/downloaded/workaround_385364.tar.gz
rpmbuild -ba /usr/src/packages/SPECS/kcalcore.spec
rpm -Uhv /usr/src/packages/RPMS/x86_64/libKF5CalendarCore5-17.12.3-lp150.2.2.x86_64.rpm

You may have to install rpmbuild first and also add the source repository corresponding to openSUSE-Leap-15.0-Oss ("zypper addrepo http://download.opensuse.org/source/distribution/leap/15.0/repo/oss/ openSUSE-Leap-15.0-Oss_Src"; change "Leap-15.0" to your opensuse version).
Comment 6 Paul Gouin 2019-01-17 20:37:39 UTC
Created attachment 117519 [details]
PKGBUILD for patched kcalcore 18.12.1 on Arch

PKGBUILD for patched kcalcore 18.12.1 on Arch
Comment 7 Paul Gouin 2019-01-17 20:41:45 UTC
Comment on attachment 117519 [details]
PKGBUILD for patched kcalcore 18.12.1 on Arch

Same issue here with kcalcore 18.12.1 on Arch Linux.

Thanks to Ingo's helpful comments, I was able to patch it with the attached PKGBUILD.
Comment 8 Etienne 2019-04-05 12:03:28 UTC
Hello,
I do have this problem too here with Kubuntu 18.04 with korganizer (4:17.12.3-0ubuntu2).

I use nextcloud as server, event display well online, sync work well with Korganizer but don't with Outlook Caldav Synchronizer wich is problem for team work.

Not enough experimented with building to try something in Ubuntu.
Comment 9 Alexander Potashev 2019-05-15 02:06:28 UTC
duplicate of https://bugs.kde.org/show_bug.cgi?id=405884
Comment 10 peter.snauwaert 2019-05-15 08:58:30 UTC
This is still bugging me but apparently it is in https://github.com/libical/libical/issues/370 now, originating from a much more recent bug report here that this  one seems to be a duplicate of. Wonder why it is not the other way around as this has been open for a year and a half and may stress the urgency somewhat.

The bug was tagged to be solved in the just released libical 3.0.5 version but was changed to 3.0.6, so we are not there yet. Moreover I seem to remember that 3.0.6 may not be released, so hopefully it doesn't fall through the cracks.

Thanks for the patches Ingo but I think it really needs fixing upstream.

You can't build an RFC compliant library and violate that RFC, it seems important enough to get more attention I feel, but I can see how they have a lot on their plates. Meanwhile I keep deleting events from korganizer and manually reentering them in calendars via the Nextcloud website.
Comment 11 Sammy Bresel 2019-05-23 12:41:47 UTC
I have the same Problem with KORganizer Version 5.7.3 on Ubuntu 18.04.2. It occours when i create events with KOrganizer and want to sync them with posteo.de which uses CalDAV. The events are synced on the Server, are synced between KDE clients, but in Outlook with CalDav Synchronizer (3.6.1.0) i get the error.
Comment 12 Allen Winter 2019-09-16 15:48:10 UTC
I release Libical 3.0.6 over the weekend.
We'll need the distros to start using this version of libical in order to fix this one.
Comment 13 Till Schäfer 2019-11-06 14:37:07 UTC
Version 3.0.6 of libical now produces completely invalid RRULE entries: "RRULE:ERROR: No Value" (Bug 412751)