Cannot generate a new CEM Installation Package for Mac OS clients: Failed to generate package. Object reference not set to an instance of an object
search cancel

Cannot generate a new CEM Installation Package for Mac OS clients: Failed to generate package. Object reference not set to an instance of an object

book

Article ID: 219691

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite

Issue/Introduction

You are getting an error while trying to create a new CEM package (Under SMP Console>Settings>Notification Server>Cloud-Enabled Management>Setup>Cloud-enabled Management Setup>Symantec Management Agent Configuration>Generate and download Symantec Management Agent installation package) for a MAC machine.

You get the following error:

Failed to generate package. Object reference not set to an instance of an object

The NS logs show the following errors:

Error 1:

Error executing Task (e8b9fb3c-3f82-4a3b-b55e-6ba8be5ff388). Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Altiris.Agent.Unix.PackageGenerators.CemPackageGenerator.GenerateCrossPatformPackage(Guid packageGuid, String createDir, AgentPackageParameters packageParams, String family)
at Altiris.Agent.Unix.PackageGenerators.BuildCemPackageTaskMac.BuildSitePackageFile(String siteIdentifier, String createDir, AgentPackageParameters packageParams)
at Altiris.NS.AgentManagement.BuildAgentPackageItemTask.ExecuteTask(Hashtable taskArgs, ItemTaskState state)
-----------------------------------------------------------------------------------------------------
Date: 7/9/2021 3:57:02 PM, Tick Count: 1700892953 (19.16:28:12.9530000), Size: 885 B
Process: AeXSvc (19572), Thread ID: 179, Module: AeXSVC.exe
Priority: 1, Source: Altiris.NS.AgentManagement.BuildAgentPackageItemTask.ExecuteTask

 

Error 2:

Failed to generate agent package

Object reference not set to an instance of an object.
[Altiris.NS.Exceptions.AeXException @ Altiris.NS.StandardItems]
at Altiris.NS.StandardItems.AgentManagement.CEMPackageRegistrator.BuildSitePackage(PackageMode mode, String siteIdentifier, IEnumerable`1 gateways, IEnumerable`1 resourceTargets, IEnumerable`1 organizationalGroups, String additionalInstallParams, DateTime requestedPackageExpiry, AgentPackageParameters packageParams, DateTime& packageExpiry, String& installXML)
at Altiris.NS.UI.Admin.ClientManagement.IbcmAgentInstallationPackage.GenerateCEMPackage(AgentPackageParameters packageParams)
at Altiris.NS.UI.Admin.ClientManagement.IbcmAgentInstallationPackage.OnGeneratePackage(Object sender, EventArgs e)

Exception logged from:
at Altiris.NS.UI.Admin.ClientManagement.IbcmAgentInstallationPackage.ReportPackageGenrationException(Exception)
at Altiris.NS.UI.Admin.ClientManagement.IbcmAgentInstallationPackage.OnGeneratePackage(Object, EventArgs)
at Altiris.NS.UI.Admin.ClientManagement.IbcmAgentInstallationPackage.RaisePostBackEvent(String)
at System.Web.UI.Page.ProcessRequestMain(Boolean, Boolean)
at System.Web.UI.Page.ProcessRequest(Boolean, Boolean)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(System.Web.HttpContext)
at Altiris.NS.UI.Controls.PageCachePage.ProcessRequest(System.Web.HttpContext)
at Altiris.NS.UI.AltirisPage.ProcessRequest(System.Web.HttpContext)
at System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(System.Web.HttpApplication+IExecutionStep)
at System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication+IExecutionStep, Boolean&)
at System.Web.HttpApplication+PipelineStepManager.ResumeSteps(Exception)
at System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, AsyncCallback)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr, System.Web.RequestNotificationStatus&)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr, System.Web.RequestNotificationStatus&)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)

HTTP [POST]: http://smpserver.example.com/Altiris/NS/Admin/ClientManagement/IbcmAgentInstallationPackage.aspx
ip: [::1]; languages: [en-US]; content-length: [20824];
timings: [[R] 00:00:05.8990267(W: 00:00:00.0020032)];
response: [200 OK]; x-smp-nsversion: [8.5.5713.0];

-----------------------------------------------------------------------------------------------------
Date: 7/9/2021 3:57:03 PM, Tick Count: 1700893828 (19.16:28:13.8280000), Size: 3.36 KB
Process: w3wp (7004), Thread ID: 8, Module: w3wp.exe
Priority: 1, Source: Altiris.NS.UI.Admin.ClientManagement.IbcmAgentInstallationPackage.ReportPackageGenrationException

 

If you create a CEM package for a Windows machine, with no errors, the package is created.

Environment

ITMS 8.x

Cause

Using a debug Altiris.Agent.Unix.dll file with extra verbosity entries, we were able to identify the actual error:

Entry 1:
Loading plugin: E:\Program Files\Altiris\UNIX Agent\Plugins\Altiris.Agent.Unix.Plugins.Mac.dll
-----------------------------------------------------------------------------------------------------
Date: 7/14/2021 8:50:55 AM, Tick Count: 2107323406 (24.09:22:03.4060000), Size: 374 B
Process: AeXSvc (8576), Thread ID: 136, Module: Altiris.Agent.Unix.dll
Priority: 4, Source: Altiris.Agent.Unix.PlatformDetection.PlatformManager.PlatformsList

 

Entry 2:
Assembly loading failed

Could not load file or assembly 'file:///E:\Program Files\Altiris\UNIX Agent\Plugins\Altiris.Agent.Unix.Plugins.Mac.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
[System.IO.FileLoadException @ mscorlib]
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Altiris.Agent.Unix.PlatformDetection.PlatformManager.PlatformsList()

An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
[System.NotSupportedException @ ]

Exception logged from:
at Altiris.Agent.Unix.PlatformDetection.PlatformManager.PlatformsList()
at Altiris.Agent.Unix.PlatformDetection.PlatformManager.LoadFamily(String)
at Altiris.Agent.Unix.PackageGenerators.CemPackageGenerator.GenerateCrossPatformPackage(System.Guid, String, Altiris.NS.AgentManagement.AgentPackageParameters, String)
at Altiris.Agent.Unix.PackageGenerators.BuildCemPackageTaskMac.BuildSitePackageFile(String, String, Altiris.NS.AgentManagement.AgentPackageParameters)
at Altiris.NS.AgentManagement.BuildAgentPackageItemTask.ExecuteTask(System.Collections.Hashtable, Altiris.NS.ItemTaskManagement.ItemTaskState)
at Altiris.NS.TaskManagement.CoreTaskServiceThreadBase<T,TStartArgs>.ExecuteThreadProc(Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object)
at System.Threading.ThreadHelper.ThreadStart(Object)

-----------------------------------------------------------------------------------------------------
Date: 7/14/2021 8:50:55 AM, Tick Count: 2107323437 (24.09:22:03.4370000), Size: 3.21 KB
Process: AeXSvc (8576), Thread ID: 136, Module: Altiris.Agent.Unix.dll
Priority: 1, Source: Altiris.Agent.Unix.PlatformDetection.PlatformManager.PlatformsList

 

Resolution

  1. Go to <install drive>:\Program Files\Altiris\UNIX Agent\Plugins\Altiris.Agent.Unix.Plugins.Mac.dll


  2. Check if the Altiris.Agent.Unix.Plugins.Mac.dll is not "blocked". Most likely it was blocked by Windows upon copy.

    Note:
    After unblocking, restart the Altiris Service in services.msc on the Notification Server

    Right-click->Properties->General tab->Unblock in attributes.


Note:

If this "Altiris.Agent.Unix.Plugins.Mac.dll" is one that got recently updated after installing one of our ULM Pointfixes, if the pointfix was downloaded from our KB system and extracted by Windows native extractor, then "block" is inherited to all extracted files. If it was used by some other extractor like 7-zip for example, then extracted files are unblocked automatically.

Also, the Power Shell command helped to unblock all the files in PF's directory:

Get-ChildItem *.* -Recurse | Unblock-File


Note: 

Another trick to try is to rename the dll file from "Altiris.Agent.Unix.Plugins.Mac.dll" to "Altiris.Agent.Unix.Plugins.Mac.dll_old" and save it and then rename it back to "Altiris.Agent.Unix.Plugins.Mac.dll"