KB-1041 "Empty result set, expected one row" thrown during JBoss startup

Symptoms

When starting JBoss, the following error is printed in application server log found under <JBOSS_HOME>/standalone/logs:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/suite]] (ServerService Thread Pool -- 52) JBWEB000287: Exception sending context initialized event to listener instance of class com.appiancorp.common.config.ConfigurationLoader: com.appiancorp.common.config.FatalConfigurationException: com.appiancorp.suiteapi.common.exceptions.AppianException: An unexpected error occurred while trying to initialize and validate the Appian data source. (APNX-1-4179-004)
...
Caused by: java.lang.IllegalStateException: [jdbc/AppianPrimaryDS] Error during schema migration.
...
Caused by: java.lang.IllegalStateException: liquibase.exception.LockException: liquibase.exception.DatabaseException: Empty result set, expected one row
...
Caused by: liquibase.exception.LockException: liquibase.exception.DatabaseException: Empty result set, expected one row
...
Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row

JBoss then fails to deploy.

Cause

This error message is returned when the DATABASECHANGELOCK table of the Appian data source is empty. The cause of an empty table is a manual error that resulted in the table being cleared.

Note: This error can disguise the broader issue of all tables of the data source being empty.

Action

Make sure that the DATABASECHANGELOCK table (and only that table) is empty by accessing the Appian data store from the database side. If it is empty, use the following SQL command to repopulate the table:

INSERT INTO DATABASE.CHANGELOGLOCK VALUES (1, 0, NULL,NULL)

Note: This command applies to a MySQL database; please adapt the command to the database vendor.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: February 2017

Related
Recommended