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
CliffACliffA 

How do you debug package install script failures?

We're using the new Apex Install Script feature and we're getting an error on package install.

 

When the attempt to install the package fails we receive the following email from Salesforce:

 

The package installation failed. Please provide the following information to the publisher:

 

Organization Name: [org name] Organization ID: [org id]

Package: [package name]

Version: 6.2

Error Message: The post install script failed.

 

Thank You,

salesforce.com

 

That doesn't really give us much to go on.  Does anyone know of a way to get more details about the failure?  Ideally we want to know what line number of the install handler or the exception that caused the problem.

Best Answer chosen by Admin (Salesforce Developers) 
A_SmithA_Smith

You need to make sure your package has a user specified in the Nofiy on Apex Error field in the managed package dev org.  The email address of that user should receive the details (unless this is a sandbox org). 

All Answers

A_SmithA_Smith

You need to make sure your package has a user specified in the Nofiy on Apex Error field in the managed package dev org.  The email address of that user should receive the details (unless this is a sandbox org). 

This was selected as the best answer
CliffACliffA

Hi Andrew,

Thanks, that was it.  I just wasn't patient enough to wait for the email to come through. 

elessenger_ctelessenger_ct

How can I confirm that the "Notify on Apex Error" address is working properly? I definitely have it sent, and I have tested deliverability of the email address, but am not receiving any errors when the Install Script fails. Is there anything else I need to do on either the dev org side or in the target org?

A_SmithA_Smith

It may take a couple times for the change to populate.  You won't receive notifications from sandbox orgs.  I also don't believe you receive notifications from beta packages, but don't hold me to it.  

EJWEJW

It's extremely difficult to debug this if we don't get notifications from beta packages (and I'm not) when the post install script fails.  The only feedback I'm getting is the e-mail to the installer stating the the install failed because the post install script failed with no further details.

 

In my case it passes my fresh install unit tests without issue, yet fails during install.  I can't upload a release version of the package yet as that will lock in all object changes, VF page API names, etc...

rob_rob_

What is the reasoning behind no notifications from sandbox orgs? We often install our package in sandbox orgs first for customer testing before installing in production. If we can't find out why our script fails in the sandbox, how can we know it's all good to install in prod? Is there another way to find out what the actual install script error is?