How can I monitor the status of a queue job?
With the right tools and process you can monitor the status of the Job Queue (the search_queue_<GUID> table) on a Spirion Windows Agent.
To monitor the status of the Job Queue (the search_queue_<GUID> table) on a Windows agent, you must connect to the local PostgreSQL instance running on that machine.
1. Connection Requirements
- Tool: Use pgAdmin 4 (typically pre-installed on Spirion agent VMs).
- Host:
localhost - Port: 5433 (Note: This is not the default Postgres port of 5432).
- Maintenance Database:
spirion - Credentials: You must retrieve the temporary Username and Password from the Test Runner portal (under Manage Agents → Get Postgres Creds).
2. Identifying the Correct Table
In pgAdmin, navigate to Databases → spirion → Schemas → public → Tables.
- Look for a table named
search_queue_<GUID>(e.g.,search_queue_3f9b2c1e...). - Warning: Ignore the table named simply
search_queue; that is just a template. The table with the long GUID suffix is the active queue for your current scan. - If you do not see a GUID table: The scan may not have started yet, or it may have already finished and been cleaned up (cleanup usually happens 15 minutes after completion).
3. Checking Queue Health (SQL Queries)
Open the Query Tool in pgAdmin and run the following commands to see the distribution of work:
SELECT status, COUNT(*) AS row_count
FROM public.search_queue_<REPLACE_WITH_YOUR_GUID>
GROUP BY status
ORDER BY status;
How to Interpret the Status Codes:
- 0 (Pending): Work that is discovered but not yet started. If this number is high, the scan is still in progress.
- 1 (Processing): Work currently being searched by a worker.
- 2 (Processed): Work successfully completed. These rows are deleted automatically after 15 minutes.
- 3 (Failed): Transient error. The system will retry these up to 3 times (with a 5-minute wait between attempts).
- 4 (PermFailed): The job failed all retries. These are kept for 4 hours for debugging before being deleted.
4. Troubleshooting common "Stuck" Queues
- Is it moving? Run the count query twice. If the count for
status 1orstatus 2isn't changing, the Search Agent may be hung. - Orphaned Jobs: If an agent crashes, jobs in
status 1should automatically revert tostatus 0within approximately one minute so another worker can pick them up. - Missing Table: If the scan is "Running" in the console but no
search_queue_<GUID>exists, check the agent logs for "Queue creation failed" errors.