KB-1147 Fatal errors related to importing system.zip during "Loading system objects" stage of JBoss startup

Symptoms

After upgrading to a new version of Appian, JBoss fails to start with the following messages in the application server log

ERROR com.appiancorp.ix.diagnostics.Diagnostics - content SYSTEM_SYSRULES_util_isFolderValid The content [id= uuid=SYSTEM_SYSRULES_util_isFolderValid] was not imported because a required precedent is missing: content ##UUID## (Expression Rule Definition) cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)

##FOLLOWED BY RULE DEFINITION##

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/suite]] (ServerService Thread Pool -- 93) JBWEB000287: Exception sending context initialized event to listener instance of class com.appiancorp.applications.BundledApplicationsLoader: com.appiancorp.common.config.FatalConfigurationException: com.appiancorp.suiteapi.common.exceptions.AppianException: A fatal error occurred when importing system packages: Found 1 failures when importing. Will try again upon restart: \ear\suite.ear\web.war\WEB-INF\bundled-apps\system.zip (APNX-1-4262-001)

Or

ERROR com.appiancorp.ix.diagnostics.Diagnostics - content SYSTEM_SYSRULES_deleteDocument An error occurred while creating content [uuid=SYSTEM_SYSRULES_deleteDocument]: The rule [name=deleteDocument uuid=SYSTEM_SYSRULES_deleteDocument] was not created because an expression function with the same name already exists. (APNX-1-4072-001) (APNX-1-4071-007)

##FOLLOWED BY RULE DEFINITION##

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/suite]] (ServerService Thread Pool -- 59) JBWEB000287: Exception sending context initialized event to listener instance of class com.appiancorp.applications.BundledApplicationsLoader: com.appiancorp.common.config.FatalConfigurationException: com.appiancorp.suiteapi.common.exceptions.AppianException: A fatal error occurred when importing system packages: Found 1 failures when importing. Will try again upon restart: /ear/suite.ear/web.war/WEB-INF/bundled-apps/system.zip (APNX-1-4262-001)

Alternatively, an OOTB function fails to execute as expected with an error similar to the following:

Expression evaluation error at function a!oobfn [line xx]: Incorrect number of parameters for function; expected X parameters, but found Y parameters.

Cause

This is most likely caused by a name collision by one of the objects defined by designers and one of the base system objects. The environment had a rule or constant with the same name as that of the OOB function prior to the upgrade that was deleted. As a result, Appian assumes that it’s this rule or constant that is referenced in the expression and not the function.

Action

The steps to resolve these issues are listed below. They may vary depending on the nature of the observed issue.

If the application server had failed to start after the migration, then perform the following steps on the SOURCE environment and then redo the migration. Otherwise perform these steps on the migrated environment and restart the application server:

  1. Find the clashing object’s UUID if it isn’t already on the log.
    Note: You can use the Content Details By UUID plugin to get the UUID of the object in the original version of Appian. An example of using this plugin would be getConstantOrRuleUUIDByName("objectX"). For the purposes of this article, assume the object is objectX with an UUID of 1234.
  2. If the object was deleted a long time ago, create a dummy object with name objectX_test with a definition of ="".
  3. Export this object and delete it.
  4. If the original object was deleted a long time ago:
    1. In this step you will modify the object in the XML definition. Once you download the zip file after exporting the object, you will find an XML file in the content folder whose name is the UUID of the rule that it is defining. Open up the file and look for the UUID of this object and change it to 1234 (or in your case, the UUID of the old rule). An example of this is shown below: Initially the top part looks like this:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
          <rule>
              <name>test_KB1147</name>
              <uuid>_a-0001dcff-f301-8000-9ba2-011c48011c48_42670</uuid> 
      ...
      
      The value of the uuid element should be changed to the following:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
          <rule>
              <name>test_KB1147</name>
              <uuid>1234</uuid>
      ...
      
    2. After making the modification, you can simply drag and drop the file into the ZIP using Windows Explorer.
    3. Import this object back into the system. If you don’t need it, feel free to delete it.
  5. If the original object still exists:
    1. Export the object and remove the rule from the system.
    2. Modify the name in the XML file to something else. An example is shown below:
      XML snippet before changes:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
          <rule>
              <name>test_KB1147</name>
              <uuid>_a-0001dcff-f301-8000-9ba2-011c48011c48_42670</uuid> 
      ...
      
      XML snippet after changing the name:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
          <rule>
              <name>test_KB1147_name_change</name>
              <uuid>_a-0001dcff-f301-8000-9ba2-011c48011c48_42670</uuid> 
      ...
      
  6. Import the XML file again. This way you won’t have to update precedents of the objects.
  7. If you don’t see a rule with the name that’s clashing on your system, this could be also caused by a function in a plugin. To test this, you would simply remove the plugin from the <APPIAN_HOME>\_admin\plugins\ folder and then restart the application server.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: August 2016

Related
Recommended