We are installing OneClick and in several attempts, we are having the error below. What would be the reason behind this failure?
In the attached postinst.11.46 log file:
********** Started: Tue Aug 30 12:06:58 2022 **********
running Custom Script Install-Tools/CUS/slmWebOp.cus
SLMDbMigrater: Memory Limit: 7,282.000 MB
SLMDbMigrater: SLMDatabase.create () starting
SLMDbMigrater: SLMDatabase.create () ending
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\create_schema200.sql
E:/Spectrum\Install-Tools\slm\sql\create_schema200.sql exitValue: 0
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema201.sql
ERROR 1054 (42S22) at line 49 in file: 'E:\Spectrum\Install-Tools\slm\sql\migrate_to_schema201.sql': Unknown column 'sm_monitors.userMH' in 'field list'
E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema201.sql exitValue: 1
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema301.sql
ERROR 1060 (42S21) at line 42 in file: 'E:\Spectrum\Install-Tools\slm\sql\migrate_to_schema301.sql': Duplicate column name 'activeTime'
E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema301.sql exitValue: 1
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema400.sql
E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema400.sql exitValue: 0
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema401.sql
E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema401.sql exitValue: 0
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema500.sql
ERROR 1060 (42S21) at line 28 in file: 'E:\Spectrum\Install-Tools\slm\sql\migrate_to_schema500.sql': Duplicate column name 'origServiceHealth'
E:/Spectrum\Install-Tools\slm\sql\migrate_to_schema500.sql exitValue: 1
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\create_oc_user_if_not_exists.sql
E:/Spectrum\Install-Tools\slm\sql\create_oc_user_if_not_exists.sql exitValue: 0
Executing command:
E:\Spectrum\mysql\bin\mysql.exe --login-path=myclient --defaults-file=E:/Spectrum\mysql/my-spectrum.cnf -e source E:/Spectrum\Install-Tools\slm\sql\create_oc_admin_if_not_exists.sql
E:/Spectrum\Install-Tools\slm\sql\create_oc_admin_if_not_exists.sql exitValue: 0
Script Install-Tools/CUS/slmWebOp.cus has FAILED
********** Completed: Tue Aug 30 12:06:59 2022 **********
*********CUSTOM SCRIPT SUMMARY**********
Script Install-Tools/CUS/slmWebOp.cus has failed
Errors occurred during the execution of
the custom scripts noted above. Please
refer to the appropriate install.log
file for specific information on the
error. These errors must be resolved
before installing any Service Packs or
hot fixes.
****************************************
** Error during running of custom scripts
------------------------------------------------------------------------
The slmWebOp.cus script calls the SLMDbMigrater javascript:
Here is the flow of when and why those sql scripts will be run :
slmWebOp.cus inturn executes SLMDbMigrater.java as below :
"$JAVA" -classpath "${CLASSPATH}" com.aprisma.slm.install.SLMDbMigrater -installDir $IROOT
Now SLMDbMigrater.java class first checks for table sm_schemaversion, if this table exist then it checks the maximum value of the versionID column(SELECT MAX(versionID) FROM sm_schemaversion).
mysql> select * from sm_schemaversion;
+-----------+-------------------------------------------+
| versionID | comments |
+-----------+-------------------------------------------+
| 200 | Initial version by: 24.3.11.0.10 install. |
| 201 | Migrated to by: 24.3.11.0.10 install. |
| 301 | Migrated to by: 24.3.11.0.10 install. |
| 400 | Migrated to by: 24.3.11.0.10 install. |
| 401 | Migrated to by: 24.3.11.0.10 install. |
| 500 | Migrated to by: 24.3.11.0.10 install. |
| 501 | Migrated to by: 24.3.11.0.10 install. |
+-----------+-------------------------------------------+
7 rows in set (0.03 sec)
If the maximum versionID is 501 then it does not execute any of the schema upgrade scripts and directly executes : create_oc_user_if_not_exists.sql and create_oc_admin_if_not_exists.sql
The slm tables(sm_schemaversion etc..) did not exist prior to upgrade and as a result it goes into the code section where it executes the create_schema200.sql followed by migrate_to_schema201.sql and then migrate_to_schema301.sql and so on and that is the reason you see all these sm_* tables created post upgrade. This scenario will not reoccur at next upgrade because the tables are already created so it directly goes to create_oc_user_if_not_exists.sql and create_oc_admin_if_not_exists.sql without executing those problematic scripts.
Verify the version of mysql is showing the correct max value and the version you have installed. For example this is showing 24.3.11 which is the version installed.
systemctl start processd
cd $SPECROOT/mysql/bin
././mysql --defaults-file=../my-spectrum.cnf -uroot -<password> reporting;
mysql> select * from sm_schemaversion;
If the version shows the release you just installed, then reinstall OneClick. The reinstall will see the version is actually 501 and will no longer fail and continue with the install.
If you do not use Service Manager you can ignore the error messages and run Spectrum. During the next upgrade the install will not fail as it will see the version and properly upgrade as needed.