SRM Not Starting - Error Caused by: MySQLSyntaxErrorException : Duplicate column name 'isClusterEntity'
Release: Any
Component: Spectrum Report Manager
This can happen because SRM is failing to apply schema change to add the isClusterEntity column to the model table for cluster information.
The below error can be found in $SPECROOT/tomcat/logs/stdout.log (or catalina.out) file:
Caused by: com.aprisma.spectrum.app.web.db.schemachange.SchemaChangeException: SQLException while running RuntimeSchemaChange1068 Schema Change Errorcode: 1060
at com.aprisma.spectrum.app.repmgr.dc.db.changes.RuntimeSchemaChange1068.doSchemaChange(Unknown Source)
at com.aprisma.spectrum.app.web.db.schemachange.RuntimeStatementSchemaChange.doSchemaChange(RuntimeStatementSchemaChange.java:73)
at com.aprisma.spectrum.app.web.db.schemachange.BaseSchemaChange.applySchemaChange(BaseSchemaChange.java:185)
... 70 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'isClusterEntity'
As per the output of the following MySQL query, the 'isClusterEntity' column already exists in the model table. Please do the following:
1. Log into the system as the use that owns the Spectrum installation
2. If on Windows, start a bash shell by running "bash -login"
3. cd to the $SPECROOT/mysql/bin directory and enter the following command to log into mysql:
./mysql --defaults-file=../my-spectrum.cnf -uroot -p<PASSWD> reporting
4. Enter the following command at the mysql prompt:
Select * from schemaversion where schema_comments='Adding isClusterEntity column to model table for cluster information'\G
The following is an example of the output:
From the above output, the state "F" needs to be changed.
1. Make a note of the change_id. From the above screenshot it is "137"
2. Run the following mysql command at the mysql prompt to change the state column from "F" to "A" replacing "137" with the change_id from your mysql command above.
update schemaversion set state='A' where change_id=137;
Note : Change_id will differ from database to database, please make a note of it accordingly.
3. Stop / Start the Spectrum Tomcat service for the changes to take place.