PSL Writer failing with invalid state ID error

book

Article ID: 185471

calendar_today

Updated On:

Products

CA Business Service Insight OBLICORE GUARANTEE

Issue/Introduction

Calculation of metrics is failing with an error of the following form:

There was an error while calculating service level for rule '<rule name>' (ID:<rule ID>) in version number x of the '<contract name>' contract. The error occurred while calculating service level for the '<unit>' time unit which is the tracking period of the rule. The error message is: Rule Agent Error: PslRuleAgent LoadState: Invalid state ID.

Environment

Release : 8.35

Component : CA Business Service Insight

Resolution

This error means that the Rule state ID is outside the valid numbers for the system. This can happen if there are so many items written that it goes outside the range and becomes negative. The following steps will fix it:

1) Stop all "Oblicore *" processes.

2) Run the clear all for contract SQL, so you end up with an empty t_rules_states table. This is documented in Article Id 10171.  

3) Check the t_rule_states table and ensure that you've got nothing with an invalid state_id now. If you do, you've missed some sla_id values.

3) Then, reset the SEQ_RULE_STATE_ID value. That has a min value of 1000, max of 9999999999, increment by 1. Oracle will not let you specify a next_value manually, however in SQL developer you can:

o Change the “increment by” to the following negative number –(current number -1000) and uncache the value (or it will retrieve 5 and go negative).
o Get the next value (it will change the next number to 1000) with the query

select SEQ_RULE_STATE_ID.nextval from DUAL;

o Change again the “increment by” to 1 and turn the cache back to 5. Do not query the details of the sequence again during this, or again it retrieves the next value.

The aim of these steps is to end up with the id back at 1000; if the table is completely cleared then you may also drop the sequence and recreate it. For more detailed instructions on how to reset a sequence with that method please also see Article Id 131467.

4) While the services are stopped, do the same for the message_id in the t_log table:

o truncate the t_log table
o perform the steps from Article Id 131467 for the sequence SEQ_SLA_LOG

5) Once that is completed restart the services and confirm the problem is solved.