Product:
Search Type:

How to deal with out of sync issues

Article ID: 2247 
Last Review: Mar,19 2008
APPLIES TO:
  • Parallels Automation (PEM)

SYMPTOMS

Some items like webspace, domain, mailbox are not in sync.
 

CAUSE

Most probably, some scheduled activity was not completed successfully. PSA schedules various tasks almost for any operation (like provisioning, changing configuration, updating statistics and so on), if such task fails - related objects can be out of sync.
 

RESOLUTION

Common way to fix such issues is to find a corresponding failed task in the task manager, fix it and re-run. Please see http://kb.swsoft.com/en/2246 for general info about dealing with PSA tasks.


How to find corresponding failed tasks:

for a webspace:
    Webspace is out of sync when some scheduled operations for its domain service are not performed yet, to check if there are any, one may use the following command (should be executed on management node):
psql -Uplesk -h`hostname` -c "SELECT ds_id, name, (ops_sheduled - ops_performed) as operations FROM domain_services WHERE hd_id = 123456"
where 123456 is a webspace id (available in the CCP).

For example:
[root@core root]# psql -Uplesk -h`hostname` -c "SELECT ds_id, name, (ops_sheduled - ops_performed) as operations FROM domain_services WHERE hd_id = 123456"
 ds_id  |           name            | operations
--------+---------------------------+------------
 188791 | www.d1011.pemprovider.com |         10
(1 row)
This output shows that there are 10 pending operations (tasks) for domain service 188791, to find related tasks in PSA one should copy the ds_id and search in background tasks, filtering by queue name domain_service$ds_id (in our example: domain_service188791).

for a DNS domain:
    PSA has only one task for handling DNS updates, it is a periodic task 'Update name servers state' which runs every 10 minutes (by default) and it does not need manual rescheduling. However, it makes sense to check if the task was finished successfully the last time or not. Possible out of sync issues can be caused by three things:
    a) domain has not ready registrar status (article #2255)
    b) some dns records keep failing to propagate to one or all dns servers (article #2256)
    c) domain's webspace is not in sync

for a qmail mailbox:
    QMail related tasks are grouped by qmail hosting id and can be found in background tasks by the following queue name: qmail_hosting_$id. This $id can be retrieved from the following command (execute on management node):
psql -Uplesk -h`hostname` -c "SELECT hosting_id, local_part AS name, operations_count AS operations FROM cqmail_mailnames JOIN cqmail_emails USING(email_id) WHERE mailname_id = 12345"
where 12345 is a mailbox id from the CCP.

For example:
[root@core root]# psql -Uplesk -h`hostname` -c "SELECT hosting_id, local_part AS name, operations_count AS operations FROM cqmail_mailnames JOIN cqmail_emails USING(email_id) WHERE mailname_id = 12345"
 hosting_id | name  | operations
------------+-------+------------
      42213 | sales |          1
(1 row)
In our example there is one operation for hosting_id 42213 pending - use qmail_hosting_42213 as queue name filter in background tasks.

for an Exchange mailbox:
    Usually, it is possible to look-up an Exchange task by a mailbox name (enter *sales* in the name field, where sales is a mailbox name). General way is to select such tasks by a domain service, id can be retrieved from the following command (should be executed on management node):
psql -Uplesk -h`hostname` -c "SELECT ds_id, name, sync_status FROM exch_mailboxes WHERE mailbox_id = 12345"
where 12345 is a mailbox id, available in the CCP.

For example:
[root@core ~]# psql -Uplesk -h`hostname` -c "SELECT ds_id, name, sync_status FROM exch_mailboxes WHERE mailbox_id = 5"
 ds_id | name | sync_status
-------+------+-------------
     4 | test |           1
(1 row)
Sync status is positive, that means the mailbox is out of sync, related tasks can be found using the following filter as queue name: DomainService*4.

for a VPS:
    VPS can stuck in creating/stopping/starting/etc states. To find corresponding task for the VPS, one needs to get VPS host id on the following screen: Top > Service Director > Virtuozzo Manager > VPSs (refer to the ID column). And locate tasks with the queue name vps*$ID, for example vps*123 for a VPS with host id 123.

NOTE: VPS host id is not the same as Virtuozzo VEID, to locate a task VPS host id is needed, but not VEID.
Keywords: tasks, sync, pending

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields