iCal returns a "Server responded with "502" when trying to Save an Edited Event

Preface: This page is receiving a fair amount of traffic. I believe it is due to people looking for a solution to a 502 error when trying to change the calendar of an event stored on a WebDAV Server. Make sure to check out my new post on that at iCal returns a ""Server responded with "502" when trying to Save an Edited Event-Redux | Troubleshooring | iTechieGuy.com

One thing that disappointed me about MobileMe's last calendar update which is also carried through to iCloud, is the automatic deleting of older calendar events. I want to preserve the history of my calendar events so I can refer to them later. My calendar events are not only for things to happen but also when things happened. My dog unfortunately has seizures. We note those on the calendar so that we have a history of them. In the note, I, track how long they were and how serious they were. If those events got deleted, gone is a valuable and important history.

Having a Mac-based server at home, I decided to set up a CalDAV server. With that, I am able to store our calendars without the fear of losing past events.

This change has not been without problems, though. Seemingly, Every once in a while, when editing an event, I would get an error. Here is the error dialog that I would see:

iCal Error

Here is the text of the error message:

The Server responded with a error
The request for "Event" in "Calander" in account "Account" failed.
The Server responded with "502" to operation CalDAVMoveEntityQueueableOpertation.

I have researched this before and found other people with this problem but I have not found a solution. The other day, I recognize that it didn't happen with every edit. Most edits of an event would work just fine. The only time an error would be generated is when I tried to use iCal or the calendar on the iPhone to change the calendar of the event. So, i went looking, again.

This time, I got lucky and found this link: https://discussions.apple.com/message/10786463#10786463.

Finally, a real clue. I checked the port number in the troubling account and found the port was set to auto. Per the suggestion in the link above to change the port to 8008. I could now edit events to my hearts desire without getting any errors.

The port is reset in iCal>>Preferences>>Accounts. Once there, click on an account and then click the Account's Server Settings. There you will find the text box for setting the port.

While researching this problem, I found people that said this error only happen on some accounts and not other accounts. I bet the accounts that weren't working correctly had their port set to auto.