I have a beta managed package installed in a sandbox org. I am able to create triggers in my sandbox org that subscribe to a platform event from that managed package when creating the trigger through the ui, and the triggers function properly. Whenever I try to create or update a trigger through a metadata api deployment, even when I'm deploying a trigger that I just retrieved, the deployment fails with a gack:

An unexpected error occurred. Please include this ErrorId if you contact support: 1818144128-20982 (-359002871)

Has anyone encountered this error before, and is it specific to sandbox orgs or beta managed packages? My biggest concern here is getting the trigger deployed up to production when the time comes. I haven't tried using change sets yet, but I would be open to any work around if it works.

Here's some more details of a simple retrieve/deploy I ran where the deployment failed:

[martin@localhost ret3]$ ls
[martin@localhost ret3]$ cat package.xml 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
[martin@localhost ret3]$ retrieve staging
submitted retrieve request: 09Sp0000001H0cIEAS
request : Succeeded
[martin@localhost ret3]$ ls -R
package.xml  retrieve_staging_1.zip  triggers

YouzanOrderDetailsUpdated.trigger  YouzanOrderDetailsUpdated.trigger-meta.xml
[martin@localhost ret3]$ cat triggers/*
trigger YouzanOrderDetailsUpdated on Youzan__OrderDetailsUpdated__e (after insert) {

    new Trg_YouzanOrderDetailsUpdatedCreateOrder( Trigger.new );

}<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
[martin@localhost ret3]$ deploy staging
submitted deploy request: 0Afp000000ERZZpCAP
InProgress completed 0 / 0 tests 0 errors
Failed completed 0 / 0 tests 0 errors
Total Time: 0.0 ms

1 Answer 1


When you are deploying triggers on platform events, make sure that the version number in your deployment package is >= 37.0

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .