Event Manager failed to upgrade 
search cancel

Event Manager failed to upgrade 

book

Article ID: 265673

calendar_today

Updated On:

Products

Spectrum Network Observability CA Performance Management

Issue/Introduction

Event Manager failed to upgrade 

Alarm Console Dashboard shows No Data to Display post upgrade

Performance Management Alarms console no longer getting alarms from Spectrum

No Spectrum alarm in PC/Portal web page

MySql errors after upgrading from 21.2.10 or earlier releases to 21.2.11 or later releases.

Error found in the EM/logs/wrapper-<DATE>.log file:

INFO   | jvm 1    | 2023/05/05 00:43:35 | ERROR | AlarmService/SpectrumAlarmTask-1 | 2023-05-05 00:43:35,907 | com.ca.im.portal.em.spectrum.subscription.AlarmProcessingTask    
INFO   | jvm 1    | 2023/05/05 00:43:35 |       | Handled unexpected Exception during new alarm processing - Exception:
INFO   | jvm 1    | 2023/05/05 00:43:35 | org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT IGNORE INTO alarms ( SourceID,LocalAlarmID,LocalID,CreatedOn,OIRuleName,SyslogHost,ModifiedOn,LastOccurredOn,Description,Severity,Acknowledged,UserClearable,Impact,CombinedImpact,SymptomCount,OriginatingEvent,Occurrences,CauseCode,CauseCount,TroubleTicketId,Troubleshooter,PeriodStartTime,PeriodEndTime,SyslogHitCount,DiscriminatorValues,UpdatedOn ) VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ON DUPLICATE KEY UPDATE ModifiedOn=VALUES(ModifiedOn),LastOccurredOn=VALUES(LastOccurredOn),Description=VALUES(Description),Severity=VALUES(Severity),Acknowledged=VALUES(Acknowledged),UserClearable=VALUES(UserClearable),Impact=VALUES(Impact),CombinedImpact=VALUES(CombinedImpact),SymptomCount=VALUES(SymptomCount),OriginatingEvent=VALUES(OriginatingEvent),Occurrences=VALUES(Occurrences),CauseCode=VALUES(CauseCode),CauseCount=VALUES(CauseCount),TroubleTicketId=VALUES(TroubleTicketId),Troubleshooter=VALUES(Troubleshooter),PeriodStartTime=VALUES(PeriodStartTime),PeriodEndTime=VALUES(PeriodEndTime),SyslogHitCount=VALUES(SyslogHitCount),DiscriminatorValues=VALUES(DiscriminatorValues),UpdatedOn=VALUES(UpdatedOn)]; nested exception is java.sql.BatchUpdateException: Unknown column 'DiscriminatorValues' in 'field list'
 
The em.alarms table is missing the DescriminatorValues field.
 
In the /opt/CA/PerformanceCenter/InstallLogs/emmigrate.log.<DATE> log file we may see one of these errors.
Mar 24, 2023 9:57:29 AM com.ca.im.installanywhere.util.DbMigrateApp mainSEVERE: com.ca.im.installanywhere.util.DbMigrateException: com.ca.im.installanywhere.util.DbMigrateException: An exception occurred on step 0 (upgrade/21.2.11.0/merge_old_event_partitions.sql) of loading /opt/CA/PerformanceCenter/Tools/bin/../../EM/SQL/upgrade/21.2.11.0/_upgrade.21.2.11.0.xmljava.sql.SQLException: Error executing command: CALL em.rotate_event_partitions() on line 65 in script /opt/CA/PerformanceCenter/Tools/bin/../../EM/SQL/upgrade/21.2.11.0/merge_old_event_partitions.sql  VALUES value for partition 'p20230324' must have type INT
 
Jun 30, 2023 7:37:54 AM com.ca.im.installanywhere.util.DbMigrateApp main SEVERE: com.ca.im.installanywhere.util.DbMigrateException: com.ca.im.installanywhere.util.DbMigrateException: An exception occurred on step 0 (upgrade/21.2.11.0/merge_old_event_partitions.sql) of loading /opt/CA/PerformanceCenter/Tools/bin/../../EM/SQL/upgrade/21.2.11.0/_upgrade.21.2.11.0.xml java.sql.SQLException: Error executing command: CALL em.rotate_event_partitions() on line 65 in script /opt/CA/PerformanceCenter/Tools/bin/../../EM/SQL/upgrade/21.2.11.0/merge_old_event_partitions.sql Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb3_tolower_ci,IMPLICIT) for operation '='

The em DB is not updated with new release details (still in 3.7.8.0) while the netqosportal DB is (22.2.6.0).

mysql> select * from netqosportal.revision_info;
+---------------+-------------+---------------------+-----------------+------------------------------+-------------+-------------+----+
| NetOPsVersion | Version     | InstallDate         | DbSchemaVersion | BuildDate                    | BuildNumber | Description | ID |
+---------------+-------------+---------------------+-----------------+------------------------------+-------------+-------------+----+
|               | 2.8.0.171   | 2016-07-20 18:29:26 | 2.8.0.0         | Wed Jun 01 00:59:46 EDT 2016 |         171 | CAPC        |  1 |
|               | 3.1.0.257   | 2017-06-20 15:00:18 | 3.1.0.0         | Tue Mar 21 23:02:50 EDT 2017 |         257 | CAPC        |  2 |
|               | 3.5.0.212   | 2018-07-12 09:58:21 | 3.5.0.0         | Wed Dec 13 13:53:05 EST 2017 |         212 | CAPC        |  3 |
| 19.2          | 3.7.3.665   | 2019-08-29 15:43:55 | 3.7.3.0         | 13                           |         665 | CAPC        |  4 |
| 19.2          | 3.7.8.796   | 2020-01-29 19:19:24 | 3.7.8.0         | 176                          |         796 | CAPC        |  5 |
| 20.2.7        | 20.2.7.540  | 2021-05-15 16:15:51 | 20.2.7.0        | 420                          |         540 | CAPC        |  6 |
| 22.2.6        | 22.2.6.1114 | 2023-03-24 12:55:36 | 22.2.6.0        | 1607                         |        1114 | CAPC        |  7 |
+---------------+-------------+---------------------+-----------------+------------------------------+-------------+-------------+----+
7 rows in set (0.00 sec)
mysql>  select * from em.revision_info;
+---------+---------------------+-----------------+
| Version | InstallDate         | DbSchemaVersion |
+---------+---------------------+-----------------+
| 2.0.0.2 | 2016-07-20 18:30:46 | 2.5.0.0         |
| 2.0.0.2 | 2017-06-20 15:04:06 | 3.1.0.0         |
| 2.0.0.2 | 2018-07-12 10:03:06 | 3.5.0.0         |
| 2.0.0.2 | 2019-08-29 15:49:29 | 3.7.3.0         |
| 2.0.0.2 | 2020-01-29 19:23:18 | 3.7.8.0         |
+---------+---------------------+-----------------+
5 rows in set (0.01 sec)

Environment

All supported DX NetOps Performance Management releases between 21.2.11 (when the merge_old_partitions process at issue is introduced) and 23.3.9 when the issue is expected to be resolved (ETA Subject to change).

Cause

The EM MySql DB was not successfully upgraded

Resolution

  • To resolve this complete the following steps.

       The steps will bring the DB up the the correct level progressively.

    The following npcshell.sh commands require special steps.

    • All environments and systems with MySql and Portal services on the same host:
      • Update the DB_PASSWORD with your MySql DB password.
    • If MySql runs on it's own host you will also need to:
      • Run the npcshell commands on the Portal host.
      • Edit the --dbhost value replacing localhost with the IP or name of the MySql host.
    1. Stop the four Portal services (caperfcenter_console, caperfcenter_devicemanager, caperfcenter_eventmanager and caperfcenter_sso). Leave MySql running.  E.G.  systemctl stop caperfcenter_*
    2. Run the following command.
      • /opt/CA/PerformanceCenter/Tools/bin/npcshell.sh upgradeem  --production --dbhost localhost --dbport 3306 --dbuser 'netqos' --dbpass 'DB_PASSWORD' --log /opt/CA/PerformanceCenter/InstallLogs/emmigrate.log.`date +%F_%H-%M`
        • Note the single quotes around the date portion.
      • It will return errors. That is expected.
      • The errors will be from the run of a sql script named merge_old_event_partitions.sql.
    3. Run the following command, from the /opt/CA/MySql/bin folder: 
      • ./mysql -uroot -p em < /opt/CA/PerformanceCenter/EM/SQL/event_partitions.sql
    4. Open a MySql CLI connection and run the following insert command. Replace <DATE> with todays date.
      • insert into em.revision_info(Version, InstallDate, DbSchemaVersion) values ('2.0.0.2', '<DATE> 00:00:00', '21.2.11.0');
      • Example for a run on May 11th, 2023:
        • insert into em.revision_info(Version, InstallDate, DbSchemaVersion) values ('2.0.0.2', '2023-05-11 00:00:00', '21.2.11.0');
    5. Run the npcshell upgradeem command again.
      • /opt/CA/PerformanceCenter/Tools/bin/npcshell.sh upgradeem  --production --dbhost localhost --dbport 3306 --dbuser 'netqos' --dbpass 'DB_PASSWORD' --log /opt/CA/PerformanceCenter/InstallLogs/emmigrate.log.`date +%F_%H-%M`
      • It will return errors. This is expected.
      • The errors will be from the run of a sql script named merge_old_event_partitions.sql.
      • Depending on DB and table sizes, the add_pks_to_em_tables.sql command issued may take 10-15+ minutes to run.
    6. Check em.revision_info once again.  If the listed revision is 23.3.x+, check the latest emmigrate.log for any additional errors.  If the revision is 23.3.x+ and there are no further errors in the emmigrate.log, you are done; proceed to step 9.
      • select * from em.revision_info
    7. Open a MySql CLI connection and run the following insert command. Replace <DATE> with todays date. 
      • insert into em.revision_info(Version, InstallDate, DbSchemaVersion) values ('2.0.0.2', '<DATE> 00:00:00', '22.2.2.0');
      • Example for a run on May 11th, 2023:
        • insert into em.revision_info(Version, InstallDate, DbSchemaVersion) values ('2.0.0.2', '2023-05-11 01:00:00', '22.2.2.0');
    8. Run the npcshell upgradeem command again.
      • /opt/CA/PerformanceCenter/Tools/bin/npcshell.sh upgradeem  --production --dbhost localhost --dbport 3306 --dbuser 'netqos' --dbpass 'DB_PASSWORD' --log /opt/CA/PerformanceCenter/InstallLogs/emmigrate.log.`date +%F_%H-%M`
      • It should not return errors on this run. Errors are not expected for this run of the command.
    9. When that completes to validate the solution run the following. There should now be a DescriminatorValues column added to the table.
      • Open a MySql CLI connection and run the following command.
        • desc em.alarms;

    Restart the four PC web server services if the missing column is present. 

         E.G.   systemctl start caperfcenter_sso; systemctl start caperfcenter_devicemanager; systemctl start caperfcenter_eventmanager; sleep 30; systemctl start caperfcenter_console;

    The Alarms Console should now work properly.

Additional Information

This issue will only be seen in systems that are upgraded to 21.2.11 through 23.3The issue first begins with 21.2.11 and newer installations. This is the first release to include the merge_old_partitions MySql script that causes the issue.

Only upgrades to 22.2.6 or newer will see the missing DiscriminatorValues DB value. It was first introduced with the 22.2.6 release.

mysql>  select * from em.revision_info;
+---------+---------------------+-----------------+----+
| Version | InstallDate         | DbSchemaVersion | ID |
+---------+---------------------+-----------------+----+
| 2.0.0.2 | 2016-07-20 18:30:46 | 2.5.0.0         |  1 |
| 2.0.0.2 | 2017-06-20 15:04:06 | 3.1.0.0         |  2 |
| 2.0.0.2 | 2018-07-12 10:03:06 | 3.5.0.0         |  3 |
| 2.0.0.2 | 2019-08-29 15:49:29 | 3.7.3.0         |  4 |
| 2.0.0.2 | 2020-01-29 19:23:18 | 3.7.8.0         |  5 |
| 2.0.0.2 | 2023-05-09 00:00:00 | 21.2.11.0       |  6 |
| 2.0.0.2 | 2023-05-09 00:00:00 | 22.2.2.0        |  7 |
| 2.0.0.2 | 2023-05-09 18:38:39 | 22.2.6.0        |  8 |
+---------+---------------------+-----------------+----+
8 rows in set (0.00 sec)