Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

What's the best approach to resetting Calendar data on Server?

I have a database format error in a calendar that I only noticed after the migration to Server on Yosemite. I'll paste a snippet from the Error Log in at the bottom that shows the error - I've highlighted the description of the problem in red.


I found a pretty cool writeup from Linc in a different thread, but it's aimed at fixing a similar problem for a local user on their own machine rather that an iCal server like what we're running. Here's the link to that thread: Re: Calendar crashes on open For example, does something like Calendar Cleaner work on our server database as well?


In my case I think I'd basically like to gracefully remove all the Calendar databases from Server and start fresh (all the users' calendars are backed up on their local machines, so they can just import them into fresh/empty calendars once I've cleaned out the old stuff). Any thoughts on "best approach" would be much appreciated.


Here's the error log...


File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 1099, in _inlineCallbacks

2015-01-31 07:14:41-0600 [-] [caldav-0] result = g.send(result)

2015-01-31 07:14:41-0600 [-] [caldav-0] File "/Applications/Server.app/Contents/ServerRoot/Library/CalendarServer/lib/python 2.7/site-packages/txdav/caldav/datastore/sql.py", line 3635, in component

2015-01-31 07:14:41-0600 [-] [caldav-0] e, self._resourceID

2015-01-31 07:14:41-0600 [-] [caldav-0] txdav.common.icommondatastore.InternalDataStoreError: Data corruption detected (Invalid property: GEO:33.4341666667\\;-112.008055556

2015-01-31 07:14:41-0600 [-] [caldav-0] BEGIN:VCALENDAR

2015-01-31 07:14:41-0600 [-] [caldav-0] VERSION:2.0

2015-01-31 07:14:41-0600 [-] [caldav-0] CALSCALE:GREGORIAN

2015-01-31 07:14:41-0600 [-] [caldav-0] PRODID:-//Apple Inc.//Mac OS X 10.8.2//EN

2015-01-31 07:14:41-0600 [-] [caldav-0] BEGIN:VEVENT

2015-01-31 07:14:41-0600 [-] [caldav-0] UID:e24ac522-7050-4c4a-a759-19d532345d1a@hipmunk.com

2015-01-31 07:14:41-0600 [-] [caldav-0] DTSTART:20121114T215900Z

2015-01-31 07:14:41-0600 [-] [caldav-0] DTEND:20121114T232700Z

2015-01-31 07:14:41-0600 [-] [caldav-0] CLASS:PUBLIC

2015-01-31 07:14:41-0600 [-] [caldav-0] CREATED:20121108T123850Z

2015-01-31 07:14:41-0600 [-] [caldav-0] DESCRIPTION:Flight leg 2 of 2 for trip from MSP to LAX\\nhttp://www.google.

2015-01-31 07:14:41-0600 [-] [caldav-0] com/search?q=US+29+flight+status\\nBooked on November 8\\, 2012\\n

2015-01-31 07:14:41-0600 [-] [caldav-0] DTSTAMP:20121114T210756Z

2015-01-31 07:14:41-0600 [-] [caldav-0] GEO:33.4341666667\\;-112.008055556

2015-01-31 07:14:41-0600 [-] [caldav-0] LAST-MODIFIED:20121108T123850Z

2015-01-31 07:14:41-0600 [-] [caldav-0] LOCATION:Sky Harbor International Airport\\, Phoenix\\, AZ

2015-01-31 07:14:41-0600 [-] [caldav-0] SEQUENCE:0

2015-01-31 07:14:41-0600 [-] [caldav-0] STATUS:CONFIRMED

2015-01-31 07:14:41-0600 [-] [caldav-0] SUMMARY:US 29 from PHX to LAX

2015-01-31 07:14:41-0600 [-] [caldav-0] URL:http://www.hipmunk.com/flights/MSP-to-LAX#!dates=Nov14,Nov17&group=1&s

2015-01-31 07:14:41-0600 [-] [caldav-0] elected_flights=96f6fbfd91,be8b5c748d;kind=flight&locations=MSP,LAX&dates=

2015-01-31 07:14:41-0600 [-] [caldav-0] Nov14,Nov16&group=1&selected_flights=96f6fbfd91,

2015-01-31 07:14:41-0600 [-] [caldav-0] END:VEVENT

2015-01-31 07:14:41-0600 [-] [caldav-0] BEGIN:X-CALENDARSERVER-PERUSER

2015-01-31 07:14:41-0600 [-] [caldav-0] UID:e24ac522-7050-4c4a-a759-19d532345d1a@hipmunk.com

2015-01-31 07:14:41-0600 [-] [caldav-0] X-CALENDARSERVER-PERUSER-UID:D0737009-CBEE-4251-A288-E6FCE5E00752

2015-01-31 07:14:41-0600 [-] [caldav-0] BEGIN:X-CALENDARSERVER-PERINSTANCE

2015-01-31 07:14:41-0600 [-] [caldav-0] TRANSP:OPAQUE

2015-01-31 07:14:41-0600 [-] [caldav-0] BEGIN:VALARM

2015-01-31 07:14:41-0600 [-] [caldav-0] ACKNOWLEDGED:20121114T210756Z

2015-01-31 07:14:41-0600 [-] [caldav-0] ACTION:AUDIO

2015-01-31 07:14:41-0600 [-] [caldav-0] ATTACH:Basso

2015-01-31 07:14:41-0600 [-] [caldav-0] TRIGGER:-PT2H

2015-01-31 07:14:41-0600 [-] [caldav-0] UID:040C4AB7-EF30-4F0C-9D46-6A85C7250444

2015-01-31 07:14:41-0600 [-] [caldav-0] X-APPLE-DEFAULT-ALARM:TRUE

2015-01-31 07:14:41-0600 [-] [caldav-0] X-WR-ALARMUID:040C4AB7-EF30-4F0C-9D46-6A85C7250444

2015-01-31 07:14:41-0600 [-] [caldav-0] END:VALARM

2015-01-31 07:14:41-0600 [-] [caldav-0] END:X-CALENDARSERVER-PERINSTANCE

2015-01-31 07:14:41-0600 [-] [caldav-0] END:X-CALENDARSERVER-PERUSER

2015-01-31 07:14:41-0600 [-] [caldav-0] END:VCALENDAR

2015-01-31 07:14:41-0600 [-] [caldav-0] ) in id: 3405

2015-01-31 07:14:41-0600 [-] [caldav-0]

2015-01-31 07:16:39-0600 [-] [caldav-1] [-] [txdav.common.datastore.sql#error] Transaction abort too long: PG-TXN</Applications/Server.app/Contents/ServerRoot/Library/CalendarServer/lib/ python2.7/site-packages/calendarserver/tools/purge.py#1032$_cancelEvents>, Statements: 5, IUDs: 0, Statement: None

2015-01-31 08:08:40-0600 [-] [caldav-1] [AMP,client] [calendarserver.tools.purge#warn] Cleaning up future events for principal A95C9DB2-9757-46B2-ADF6-4DECE2728820 since they are no longer in directory

2015-01-31 08:09:10-0600 [-] [caldav-1] [-] [twext.enterprise.jobqueue#error] JobItem: 39, WorkItem: 762001 failed: ERROR: canceling statement due to statement timeout

2015-01-31 08:09:10-0600 [-] [caldav-1]

2015-01-31 08:13:40-0600 [-] [caldav-1] [-] [txdav.common.datastore.sql#error] Transaction abort too long: PG-TXN</Applications/Server.app/Contents/ServerRoot/Library/CalendarServer/lib/ python2.7/site-packages/calendarserver/tools/purge.py#1032$_cancelEvents>, Statements: 5, IUDs: 0, Statement: None


Posted on Jan 31, 2015 6:33 AM

Reply
2 replies

Jan 31, 2015 8:55 AM in response to OConnorStP

Here's another snippet of error logs -- showing how hard the poor database engine is working to get rid of the cruft in that database. None of us were paying attention to how far back our calendars were being kept, so we've got a boatload of old entries that could be deleted. So I logged into one of the calendars with the Calendar.app and started deleting old stuff. That server is unhappy about that as well. That's part of why I'm thinking that just removing the database probably the best approach. But again, if there are "clean up" utilities, that would be even better.



2015-01-31 10:39:41-0600 [-] [caldav-2] [AMP,client] [calendarserver.tools.purge#warn] Cleaning up future events for principal A95C9DB2-9757-46B2-ADF6-4DECE2728820 since they are no longer in directory

2015-01-31 10:40:12-0600 [-] [caldav-2] [-] [twext.enterprise.jobqueue#error] JobItem: 43372, WorkItem: 805334 failed: ERROR: canceling statement due to statement timeout

2015-01-31 10:40:12-0600 [-] [caldav-2]

2015-01-31 10:43:57-0600 [-] [caldav-2] [-] [txweb2.channel.http#error] Connection aborted - took too long to close: IPv4Address(TCP, '64.33.171.139', 49337)

2015-01-31 10:44:42-0600 [-] [caldav-2] [-] [txdav.common.datastore.sql#error] Transaction abort too long: PG-TXN</Applications/Server.app/Contents/ServerRoot/Library/CalendarServer/lib/ python2.7/site-packages/calendarserver/tools/purge.py#1032$_cancelEvents>, Statements: 5, IUDs: 0, Statement: None


Jan 31, 2015 2:49 PM in response to OConnorStP

<facepalm> Well, there you go. It turns out I was over-thinking this. The Calendar app on a Mac can manage this database just fine. Sorry about that. There may be an easier way to do this, but here's how I did it.


Use the Calendar.app on a local computer to:


- Export the corrupted calendar to an ICS file on the local computer (Calendar -> File -> Export -> Export)

- Create a new local calendar (Calendar -> File -> New Calendar -> On My Mac)

- Import the corrupted calendar into the new/empty local calendar (Calendar -> File -> Import...)

- Delete years and years of old events, including the one that was triggering that error message

- Export the (now much smaller) local calendar to another ICS file on my computer (Calendar -> File -> Export -> Export)

- Create a new calendar on the server (Calendar -> File -> New Calendar -> in the offending server-based iCal account)

- Import the edited/fixed/smaller/no-longer-corrupted calendar into the new/empty server calendar (Calendar -> File -> Import...)

- Make the newly-created iCal calendar the primary calendar (drag it to the top of the list of calendars on the server)

- Delete the old/corrupted calendar (right-clicking on the bad calendar in the calendar list - you can only delete it once it's NOT the primary calendar any more)

What's the best approach to resetting Calendar data on Server?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.