1
votes

When I am installing Sitecore update package 7.2 then Object reference not set to an instance of an object error shows up and the package is not installed:

Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] Sitecore.Update.InstallUpdatePackage.WriteMessage(Object message, Exception ex, Level level, Boolean isCommandText) +501
Sitecore.Update.InstallUpdatePackage.WriteSupportInstructions(String historyPath, Exception ex) +807
Sitecore.Update.InstallUpdatePackage.OnLoad(EventArgs e) +1055
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3177

Please go through the following details also:

Exception details: System.Exception: Cannot execute post installation action because installation data not found. at Sitecore.Update.InstallUpdatePackage.ExecutePostStep(MetadataView view) at Sitecore.Update.InstallUpdatePackage.OnLoad(EventArgs e)

1
Is it about the initial 7.2 package, Sitecore 7.2 rev. 140228.update ?, and is the Analyse task running well? in the temp folder you find a log file there you can see the latest steps, so you know on which file/item te update file.Jan Bluemink

1 Answers

1
votes

This is a very common error and can occur because of all kinds of reasons. The root cause really depends on the specific scenario that you've encountered.

If you are using an API or invoking methods that may return null then it's important to handle this gracefully. The main method above can be modified in such a way that the NullReferenceException should never be seen by a user:

static void Main(string[] args)
{
    var exampleClass = new ExampleClass();
    var returnedClass = exampleClass.ExampleMethod();

    if (returnedClass == null)
    {
        //throw a meaningful exception or give some useful feedback to the user!
        return;
    }

    returnedClass.AnotherExampleMethod();
}

Please check here for details.