function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alexey@YoxelAlexey@Yoxel 

REST API 500 Server Error when adding an Event attendee (EventRelation)

We're getting the following error from the REST API when adding an EventRelation (attendee + relation at the same time) for an existing Event
That is the only user/Org where we experience this. Hundreds of others are syncing fine.

500 Server Error
[{"message":"An unexpected error occurred. Please include this ErrorId if you contact support: 1396712998-62135 (381812194)","errorCode":"UNKNOWN_EXCEPTION"}]

Can the Salesforce development team look into this please?
pconpcon
There is nothing that anyone on the forums here can do for this.  You will need to reach out to Salesforce support directly and provide the error Id above and include the steps / files involved.
Alexey@YoxelAlexey@Yoxel
I read here that this is GACK and engineering would want to know about it
https://developer.salesforce.com/blogs/engineering/2015/02/gack.html

but my partner support does not know what to do. What do we do?
Gordon EngelGordon Engel
Based on the errorid, we think your internal error is: "java.lang.RuntimeException: java.util.zip.ZipException: unknown compression method".  Are you uploading a zip file?  Please test it and make sure it isn't corrupted.
Alexey@YoxelAlexey@Yoxel
Gordon, the error happens when we create an EventRelation object to add an attendee for a group event.
The event itself may have an attachment but this specific operation does not update the event, it simply refers to it through EventRelation.EventId.
This Org also has Platform Encryption turned on. I wonder if that breaks anything internally.

Our sync service runs hourly fo this user and tries to add attendees for a bunch of events. Here are more ErrorIds. Are they essentially all the same? 278636535-44273 (381812194), 1111500670-51708 (381812194), 502311785-47077 (381812194), 1207520037-49854 (381812194), 286898813-53530 (381812194), ...

Thank you 
Edward MaloneEdward Malone
When you insert an EventRelation we send an email to the contact (or whatever type it is).
If they are an invitee and it's an insert we include the Event's attachments, it's here that we are hitting the RuntimeException.

e.g, Inserting this EventRelation results in a call to get all attachments of the Event 00Uxx000000fTLA
EventRelation er = new EventRelation(EventId = '00Uxx000000fTLA', RelationId = '003xx000004TmVt');
insert er;

Like Gordon said, it's likely there's a corrupt attachment on the Event Object in question.
Alexey@YoxelAlexey@Yoxel
Edward, an email notification is not sent to any attendee (contact/user) when this is done through API. In UI yes, there is an option to send and update. The call to get all attachements may still be issues, for other reasons I guess.

We'll check your hypothesis but I don't believe the attachments are corrupt. After all, event creation with attachments works fine. It's adding an attending to an earlier created event that fails. I wonder if Salesforce platform itself makes them corrupt with the Platform Encryption feature in play.

Thank you
Alexey@YoxelAlexey@Yoxel
I am not sure what those attachments are, some binary files:  {"ContentType":"application/octet-stream","Id":"00P280000051k9tEAA","Name":"ATT90152"},{"ContentType":"application/octet-stream","Id":"00P280000051k9oEAA","Name":"ATT06115"}

We can load them back from the event via API, without any errors, using GET .../sobjects/Attachment/<id>/body

Would you be able to examine this case closer if we prepare a curl request for you?
Gordon EngelGordon Engel
I think you may be correct that PlatformEncryption does not consider this use case, and the encrypted attachment is being interpreted as a zip file.  I understand it can be difficult to open a case with our (Salesforce) Support team without the right contract, but can you try again, mention my name, and point them to this conversation?

If that doesn't work I will ask the Platform Encryption product owner for help.
Alexey@YoxelAlexey@Yoxel
Thank you Gordon. I updated my case. Hopefully the support folks will continue working on my case.