KB-1577 "Expected 256, was 257" exception regarding Appian engine security token prevents engine startup

Symptoms

Appian engines fail to reach RUNNING state, PRIMARY mode, and the following exception is printed in the service_manager.log file (located at <APPIAN_HOME>/logs):

java.lang.IllegalArgumentException: byte array given isn't the right length. Expected 256, was 257.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146) ~[guava-19.0.jar:?]
at com.appian.komodo.gateway.model.SecurityToken.fromInputStream(SecurityToken.java:49) ~[core-1.83.0.jar:1.83.0]
at com.appian.komodo.config.ConfigurationModule.provideSecurityToken(ConfigurationModule.java:212) ~[core-1.83.0.jar:1.83.0]
at com.appian.komodo.config.ConfigurationModule_ProvideSecurityTokenFactory.get(ConfigurationModule_ProvideSecurityTokenFactory.java:31) ~[core-1.83.0.jar:1.83.0]
at com.appian.komodo.config.ConfigurationModule_ProvideSecurityTokenFactory.get(ConfigurationModule_ProvideSecurityTokenFactory.java:10) ~[core-1.83.0.jar:1.83.0]

Cause

The alpha-numeric string in the Appian engine security token, appian.sec (located at <APPIAN_HOME>/ear/suite.ear/conf), is being read as having 257 characters instead of 256 characters. This can happen when the appian.sec file is opened, even when the string contained in the file is not altered.

Action

Complete one of the following steps to resolve this issue:

  1. Generate a new Custom Security Token using the Appian documentation and replace the existing appian.sec file. Upon saving the file, ensure that the file contains exactly 256 characters.
  2. Delete the last character of the alpha-numeric string contained in the current appian.sec file. Upon saving the file, ensure that the file contains exactly 256 characters.

Note: for High Availability and Distributed Installations, the appian.sec file must be exactly the same across each server to enable authorized connections between the engines and specified application servers.

Affected Versions

This article applies to Appian 17.3 and later.

Last Reviewed: May 2018

Related
Recommended