Symptoms

Pleskd starts, however UI is not available because not all service controllers were able to start.

Cause

Due to many tasks in Task Manager, it hanged during POA loading.

Jan 21 06:27:44 osscore : INF [1:19470:b5cffb90:21 1:19714:b543eb90 TaskManager]: [txn:28 Tasks::impl::GlobalQueue::load] 1 not finished tasks found, 0 of them considered failed, others(1) are restarted
Jan 21 06:27:44 osscore : DBG [1:19470:b5cffb90:21 1:19714:b543eb90 TaskManager]: [txn:28 Tasks::impl::ROFacade::getQueue] ===> ENTRY
Jan 21 06:27:44 osscore : DBG [1:19470:b5cffb90:21 1:19679:b3621b90 Kernel]: STMT [Con: 19682, 0xb4c04270 txn:28] ' SELECT  task_id, name, description, location, method, run_num, next_start, status, timeout, prio, subscription_id, parent_task_id FROM tm_tasks'
Jan 21 06:27:44 osscore : DBG [1:19470:b5cffb90:21 1:19679:b3621b90 Kernel]: STMT [Con: 19682, 0xb4c04270 txn:28] ' SELECT  task_id, mutex, ignore_failures, retry_num, retry_interval, retried, can_restart FROM tm_usual ORDER BY task_id'

Not all SCs are up:

plesk=> SELECT DISTINCT name FROM service_classes sc JOIN sc_instances si ON (sc.sc_id = si.sc_id) WHERE si.pid > 0;
   name    
-----------
 chief
 pleskd
 Kernel
 UIManager
(4 rows)

Fully started POA has ~50 running SCs.

plesk=> select count(1) from tm_usual where task_id in (select task_id from tm_tasks where status='c');
 count
-------
 6182
(1 row)

plesk=> select count(*) from tm_params where task_id in (select task_id from tm_tasks where status='c');
 count  
--------
750021

plesk=> SELECT count(1) FROM tm_usual ;
 count
-------
45773

Also it was caused by missing tm_usual_fk1 foreign key.

Resolution

Remove the canceled tasks and add the missing key:

plesk=> begin; delete from tm_tasks where status = 'c';
DELETE 6182
plesk=> delete from tm_usual where task_id not in (select task_id from tm_tasks);
DELETE 45757
plesk=> ALTER TABLE tm_usual ADD CONSTRAINT tm_usual_fk1 FOREIGN KEY (task_id) REFERENCES tm_tasks ON DELETE CASCADE;
ALTER TABLE
plesk=> COMMIT;

This behavior was fixed in POA 5.5, in scope of POA-73317, so upgrade is recommended.

Internal content