ICS format not valid

Discussions about the Calendar Tool at lds.org. Questions about the calendar on the classic site should be posted in the LUWS forum.
todd.weber
New Member
Posts: 4
Joined: Tue Mar 08, 2011 9:25 am

ICS format not valid

#1

Post by todd.weber »

ScottNussbaum wrote:New clue?

Perhaps there is a formatting issue with the ics file that is affecting me and others. Trying to import that data into an existing Google calendar from the saved file, I received the following error from Google:
"Failed to import events: Unable to process your iCal/CSV file..
Error at line 5872: Expected [VEVENT], read [VCALENDAR]"


I ran into the same error trying to sync with Google calendar. I then downloaded the ics file and tried importing it manually without success. Finally, I ran it through an ics validator (http://severinghaus.org/projects/icv/) and realized the ics file itself is not formatted correctly. The validator stopped the first time it ran into a truncated start date:
DTSTART:20110214

This should have been formatted so it included a time as well so it looked like this:
DTSTART:20110214T013000Z

As I manually looked at the ics file, I realized that most of the dates were wrong. An appointment that shows up on Feb 13th on the online calendar would be listed as Feb 14 (20110214) in the ics file.

I would appreciate it if someone else could look at their ics file and see if you have something similar going on. I recognize this may be a bit of a tangent from the main focus of this thread, but it could explain why a lot of people are having problems syncing since several descriptions I have read here (such as a long wait for a failed import in Google calendar) match what I am experiencing.

For what it is worth, I set up syncing with the new.lds.org feed in Google calendar a month or two ago without any problems, but the feed no longer is being updated. I tried to set up syncing with the new lds.org feed but no luck with that (or with the www trick) since it can't read the flawed ics file. I also used the wrapper script to download the ics file but, as expected, it shows the same flawed ics format (since it simply passes along the content).

Thanks!
User avatar
aebrown
Community Administrator
Posts: 15153
Joined: Tue Nov 27, 2007 8:48 pm
Location: Draper, Utah

#2

Post by aebrown »

todd.weber wrote:This should have been formatted so it included a time as well so it looked like this:
DTSTART:20110214T013000Z

I would appreciate it if someone else could look at their ics file and see if you have something similar going on. I recognize this may be a bit of a tangent from the main focus of this thread, but it could explain why a lot of people are having problems syncing since several descriptions I have read here (such as a long wait for a failed import in Google calendar) match what I am experiencing.
Yes, you're right about that particular failure to comply with the iCal spec (although another option within the iCal spec is to use "DTSTART;VALUE=DATE:20110214"). This problem has previously been noted in this post.
Questions that can benefit the larger community should be asked in a public forum, not a private message.
russellhltn
Community Administrator
Posts: 34422
Joined: Sat Jan 20, 2007 2:53 pm
Location: U.S.

#3

Post by russellhltn »

todd.weber wrote:The validator stopped the first time it ran into a truncated start date:
DTSTART:20110214

This should have been formatted so it included a time as well so it looked like this:
DTSTART:20110214T013000Z

Having you looked at the event itself to see why it might be like that? Is it a "all day" event?
Have you searched the Help Center? Try doing a Google search and adding "site:churchofjesuschrist.org/help" to the search criteria.

So we can better help you, please edit your Profile to include your general location.
User avatar
aebrown
Community Administrator
Posts: 15153
Joined: Tue Nov 27, 2007 8:48 pm
Location: Draper, Utah

#4

Post by aebrown »

RussellHltn wrote:Having you looked at the event itself to see why it might be like that? Is it a "all day" event?
Even if it is an "all day" event, theiCal spec says that the parameter for a DTSTART (and DTEND) must be a DATE-TIME (not a DATE), although the value type may be changed to DATE by specifying something like "DTSTART;VALUE=DATE:20110214".

The iCal format produced by the Church Calendar does not include either a time or a value parameter for DTSTART and DTEND on "all day" events, which is indeed a problem.

[NOTE: I moved this topic to a separate thread so that it wouldn't distract from the main thrust of the Workaround to fix calendar sync problems thread.]
Questions that can benefit the larger community should be asked in a public forum, not a private message.
todd.weber
New Member
Posts: 4
Joined: Tue Mar 08, 2011 9:25 am

#5

Post by todd.weber »

Thanks, aebrown, for your comments and for the pointer to the earlier discussion. I was able to manually search and replace the DTSTART instances where no time was listed with "DTSTART;VALUE=DATE:". I ran it through the validator and found a few DTEND instances that were also truncated, so mirrored the format for that as well "DTEND;VALUE=DATE:"

RussellHltn, it does appear the flawed DTSTART formatting is occurring for each all day event. Further, the flawed DTEND formatting appears to occur with all day events that are repeated for multiple days.

Once I made these changes, the ics file showed up as validated and, while it is taken a long time, the manual import process appears to be going successfully. This provides me with a static snapshot of the new ward/stake calendar as of the day I downloaded the ics file, but to have the sync work successfully on an ongoing basis the formatting change needs to occur on the server.

I will submit this using the feedback form on lds.org. Let me know if there are other feedback tools I should use instead.
User avatar
aebrown
Community Administrator
Posts: 15153
Joined: Tue Nov 27, 2007 8:48 pm
Location: Draper, Utah

#6

Post by aebrown »

todd.weber wrote:As I manually looked at the ics file, I realized that most of the dates were wrong. An appointment that shows up on Feb 13th on the online calendar would be listed as Feb 14 (20110214) in the ics file.

All the time stamps in an exported iCal file end with Z, which indicates that the time is not local time, but rather UTC time. For most locations in the US, that is 5-8 hours later than the scheduled time. So an evening event will appear to be in the early morning hours of the following day.

For example, I am in the Mountain Time Zone, which is UTC-0700. So I have an event that happened on February 9 at 6:30pm, and it appears in the iCal file as 20110210T013000Z (1:30am on February 10, UTC).
Questions that can benefit the larger community should be asked in a public forum, not a private message.
todd.weber
New Member
Posts: 4
Joined: Tue Mar 08, 2011 9:25 am

#7

Post by todd.weber »

Yep. I forgot to include that in my last post but the dates all matched up once I imported it into Google. Thanks again for your help!
russellhltn
Community Administrator
Posts: 34422
Joined: Sat Jan 20, 2007 2:53 pm
Location: U.S.

#8

Post by russellhltn »

aebrown wrote:Even if it is an "all day" event, theiCal spec says that the parameter for a DTSTART (and DTEND) must be a DATE-TIME (not a DATE), although the value type may be changed to DATE by specifying something like "DTSTART;VALUE=DATE:20110214".
Agreed. I was trying to find the source of the problem. Until it is fixed, it appears we should avoid scheduling an all day event. Otherwise we may find a number of users no longer get any updates.
Have you searched the Help Center? Try doing a Google search and adding "site:churchofjesuschrist.org/help" to the search criteria.

So we can better help you, please edit your Profile to include your general location.
User avatar
aebrown
Community Administrator
Posts: 15153
Joined: Tue Nov 27, 2007 8:48 pm
Location: Draper, Utah

#9

Post by aebrown »

RussellHltn wrote:Agreed. I was trying to find the source of the problem. Until it is fixed, it appears we should avoid scheduling an all day event. Otherwise we may find a number of users no longer get any updates.
Well, our stake has had many all-day events from the very beginning, and I have no intention of avoiding all-day events just to work around this bug. All-day events are the correct way to schedule many different events, and I'd prefer not to do some hack that will cause the main calendar display to be less than accurate. Since we've used all-day events from the beginning, no members of my stake will "no longer get any updates."

But of course, each stake can choose to implement such a limitation if they'd like.

One thing I don't quite understand: why does Google Calendar seem to choke on importing an .ics file with bad DTSTART/DTEND values, but when the sync feed is passed through Sam Liddicott's wrapper, it works just fine -- including all-day events? I guess it's possible that Google uses two different sets of code for processing "add by URL" and "import calendar" and the former is more forgiving.
Questions that can benefit the larger community should be asked in a public forum, not a private message.
todd.weber
New Member
Posts: 4
Joined: Tue Mar 08, 2011 9:25 am

#10

Post by todd.weber »

At least in my case, Liddicott's wrapper did not work. Google Calendar returns an error with the url that is generated from the wrapper. I also cannot important the ics file manually if I download the file after using the url from that site. To double check I tried subscribing again on two different computers using the wrapper and the direct URL and both still say they are "importing calendar from url" 10 minutes after I hit "Add Calendar".

As a test I downloaded Sunbird and tried creating a file using the URL directly from the lds.org, and it worked just fine (loaded in seconds). Tried it with Outlook 2007 with the same successful result. A friend tried it using iCal last night on his Mac with no luck. Clearly the different calendar programs handle inconsistent ics formatting (as well as other issues) quite differently...
Post Reply

Return to “Calendar”