UPI (Unified Product Installer) upgrade fails with the following error:

SCENARIO #1:
<bsainstallupgrade.log> shows the following:
(Mar 21 2021 03:39:11.239 PM +1000),SEVERE,com.bmc.install.product.bladelogic.upgrade.mig.DeploymentOptionsMigratorRunner,
THROWABLE EVENT {Description=[Options migration failed for host [jobserver01].]},
Throwable=[java.lang.NullPointerException
com.bmc.install.product.bladelogic.upgrade.mig.DeploymentOptionsMigrator.createNewValueForSpecificCase(DeploymentOptionsMigrator.java:317)
...
(Mar 21 2021 03:39:11.309 PM +1000),SEVERE,com.bmc.install.product.bladelogic.upgrade.BlUpgStatelessConfigurationCreator,
LOG EVENT {Description=[Pre Upgrade execution could not be completed Successfully. Pre Upgrade Execution Summary:
Configuration Collection: STATUS_SUCCESSFUL
Configuration Migration: STATUS_NOT_ATTEMPTED
Options Migration: STATUS_NOT_ATTEMPTED
Application Server Stop Execution: STATUS_NOT_ATTEMPTED
Database Migration: STATUS_NOT_ATTEMPTED
Persisting Configuration into Database: STATUS_NOT_ATTEMPTED
]}
...
(Mar 21 2021 03:39:11.756 PM +1000),INFO,com.bmc.install.product.bladelogic.task.upgrade.BlUpgCollectPersistConfigErrorsTask, LOG EVENT {Description=[Validation error],Detail=[Failed to migrate deployment configuration to latest version.<br><b>Remediation steps:</b><br>1. Please refer to the installation log file bsainstallupgrade.log located in the host computer's temporary directory to understand the cause for the deployment migration failure.<br>2. If you are not able to determine the problem from the installation log file, please contact BMC support.
CONFIGURATOR_EXECUTION_FAILED]}
...
SCENARIO #2:
<bsainstallupgrade.log> shows the following:
(Mar 19 2024 12:47:03.487 PM +0800),SEVERE,com.bmc.install.product.bladelogic.upgrade.BlUpgStatelessConfigurationCreator,
LOG EVENT {Description=[Pre Upgrade execution could not be completed Successfully. Pre Upgrade Execution Summary:
Configuration Collection: STATUS_NOT_ATTEMPTED
Configuration Migration: STATUS_NOT_ATTEMPTED
Options Migration: STATUS_NOT_ATTEMPTED
Application Server Stop Execution: STATUS_NOT_ATTEMPTED
Database Migration: STATUS_FAILED
Persisting Configuration into Database: STATUS_NOT_ATTEMPTED
]}
(Mar 19 2024 12:47:03.487 PM +0800),SEVERE,com.bmc.install.product.bladelogic.task.upgrade.BlUpgPersistConfigurationIntoDatabaseTask,
THROWABLE EVENT {Description=[Database migration failed.],Detail=[Database migration failed.]},
Throwable=[com.bmc.install.product.bladelogic.common.BladelogicUpgradeException
com.bmc.install.product.bladelogic.action.others.BlDatabaseUpgradeAction.execute(BlDatabaseUpgradeAction.java:86)
com.bmc.install.product.bladelogic.upgrade.BlUpgStatelessConfigurationCreator.runDatabaseMigration(BlUpgStatelessConfigurationCreator.java:257)
com.bmc.install.product.bladelogic.upgrade.BlUpgStatelessConfigurationCreator.execute(BlUpgStatelessConfigurationCreator.java:81)
com.bmc.install.product.bladelogic.upgrade.BlUpgradeManager.runPreUpgrade(BlUpgradeManager.java:138)
com.bmc.install.product.bladelogic.task.upgrade.BlUpgPersistConfigurationIntoDatabaseTask.createStatelessConfiguration(BlUpgPersistConfigurationIntoDatabaseTask.java:173)
com.bmc.install.product.bladelogic.task.upgrade.BlUpgPersistConfigurationIntoDatabaseTask.execute(BlUpgPersistConfigurationIntoDatabaseTask.java:96)
com.bmc.install.task.InstallationTask.run(InstallationTask.java:93)
java.base/java.lang.Thread.run(Unknown Source)]
...
(Mar 19 2024 12:47:03.800 PM +0800),INFO,com.bmc.install.product.bladelogic.task.upgrade.BlUpgCollectPersistConfigErrorsTask,
LOG EVENT {Description=[Validation error],Detail=[Failed to migrate TrueSight Server Automation database.<br><b>Remediation steps:</b><br>1. Please refer blmigration.log file located in the <Installation Directory>/NSH/br directory.<br>2. Please refer to the installation log file bsainstallupgrade.log located in the host computer's temporary directory to understand the cause for the database migration failure.<br>3. If you are not able to determine the problem from the installation log file, please contact BMC support.
CONFIGURATOR_EXECUTION_FAILED]}
SCENARIO #3:
<bsainstallupgrade.log> shows the following:
SEVERE,com.bmc.install.product.bladelogic.fresh.BladelogicFreshInstallManager,
THROWABLE EVENT {Description=[A component installation has failed.],Detail=[The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo'.]},
Throwable=[com.bmc.install.product.bladelogic.common.BladelogicInstallException
com.bmc.install.product.bladelogic.utils.BladelogicDBSchemaCreation.executeSql(BladelogicDBSchemaCreation.java:79)
com.bmc.install.product.bladelogic.utils.BladelogicDBSchemaCreation.createDBSchema(BladelogicDBSchemaCreation.java:183)
com.bmc.install.product.bladelogic.common.BladelogicInstallComponentsTask$BladelogicCallableTask.installComponent(BladelogicInstallComponentsTask.java:421)
com.bmc.install.product.bladelogic.common.BladelogicInstallComponentsTask$BladelogicCallableTask.call(BladelogicInstallComponentsTask.java:296)
com.bmc.install.product.bladelogic.common.BladelogicInstallComponentsTask$BladelogicCallableTask.call(BladelogicInstallComponentsTask.java:278)
java.base/java.util.concurrent.FutureTask.run(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base/java.lang.Thread.run(Unknown Source)]