Smart Groups are no longer compiling on the server

KB 1009: Smart Groups are no longer compiling on the server

Smart Groups are no longer compiling on the server

Summary

For Corporate Software Inspector On-Premises Edition, Smart Groups have stopped compiling

Symptoms

Smart Groups are stuck and not compiling. This may also show as scan results not being returned or scans not completing and can also present as other, random, console issues.

Cause

When the MySQL service (mysqld) is shut down before the Smart Group Daemon service (sgdaemon) is shutdown, currently generating items may be left in the in_progress=1 state.

The in_progress=1 state indicates that an item is currently in generation and should be ignored for further generations.

In the situation that an item has been left abandoned in this state, then usually the sgdaemon will automatically fix the item after 12 hours (controlled by theSMARTGROUP_GENERATION_ABANDON_INTERVAL settings). But if this does not happen, it has to be done manually.



Resolution

Do the following to reset the Smart Group generation manually:
1) Determine if the Smart Group Daemon is current running by executing the following command on the server:
$ service sgdaemon status

If the service is running you will see the output shown below:
secunia-sgdaemon.php (pid #####) is running...
[ OK ]


If the service is not running you will see the output shown below:
secunia-sgdaemon.php is stopped
[FAILED]


2) If the Smart Group Daemon is running then stop the daemon:
$ service sgdaemon stop

3) Ensure the mysqld service is running (step 1.). If it is not running then start it (step 2.):
1. $ service mysqld status
2. $ service mysql start

4) Reset the Smart Group generation to re-queue all items:
· Set the items to in_progress=0 via the mysql console (replace 123456 with the Customer ID):
use ca_123456;
UPDATE csi_smartgroups SET in_progress=0, generate_asap=1 WHERE in_progress=1;

use ca;
UPDATE csi_smartgroup_generation SET in_progress=0, generate_asap=1 WHERE in_progress=1;

· Start the sgdaemon service and allow it time to regenerate all of the Smart Groups (you can view the progress in the Corporate Software Inspector console)
service sgdaemon start

 


Author:  Fawad Laiq