Error "Cannot invoke method getName() on null object" when trying to enable Infrastructure Cartridge
FMS Logs show the following:
ERROR [cvqckqqbhr:217406091142117590246713] com.quest.nitro.service.cartridge.api.CartridgeManager - Cartridge Infrastructure-5.7.1 could not be enabled. Enabling component CreateLocalUserCredentials- failed with error: com.quest.nitro.service.cartridge.api.CartridgeDeploymentException: Error invoking cartridge lifecycle script. All components of Infrastructure-5.7.1 will be disabled.
com.quest.nitro.service.cartridge.api.CartridgeDeploymentException: Error invoking cartridge lifecycle script
at com.quest.nitro.service.cartridge.deployment.PersistentLifecycleDeploymentHandler.runScript(PersistentLifecycleDeploymentHandler.java:126)
...
at java.lang.Thread.run(Thread.java:662)
Caused by: com.quest.nitro.service.sl.interfaces.scripting.ScriptingException: com.quest.nitro.service.sl.interfaces.scripting.ScriptAbortException: java.lang.NullPointerException: Cannot invoke method getName() on null object
----script start------
// check to see if the credential has already been created for some reason
def credential = getCredentials( lockbox ).find{ credential ->
def type = credential.getType();
def name = credential.getName();
return LOCAL_USER == type && name == "${NAME_PREFIX} ${p}";
}
if ( null == credential ) {
log.info( "adding a new ${p} credential to ${lockbox.getName()}" );
try {
def editor = c.createCredentialEditor( lockbox );
credential = editor.createCredential();
credential.setCredentialName( "${NAME_PREFIX} ${p}" );
def data = credential.getCredentialData();
data.setType( LOCAL_USER );
credential = editor.endUpdate( credential );
---- script end ------