Plesk : Upgrading failed with error while trying to execute SQL query

Symptoms
Upgrade version 8.6 failed. The following error is shown in upgrade log:

/tmp/psa_8.6.0_cos4.build86080722.02_upgrade.090611.00.57.log
—>8—
ERROR while trying to execute SQL query, the query was: DELETE FROM mysql.user WHERE user = ”; FLUSH PRIVILEGES;

Aborting…

STOP psa-8.6.0-cos4.build86080722.02 upgrading AT Thu Jun 11 00:57:52 CDT 2009
—8<---

What does the error mean and how to resolve the problem?

Cause
Execution of query “FLUSH PRIVILEGES” is not possible because table ‘mysql.procs_priv’ is missing in database ‘mysql’.
To verify login to mysql and try the command:

mysql> flush privileges;
ERROR 1146 (42S02): Table ‘mysql.procs_priv’ doesn’t exist

mysql>

Resolution
In MySQL 5.0 you may create the table with the following query:

mysql> CREATE TABLE `procs_priv` (
`Host` char(60) collate utf8_bin NOT NULL default '',
`Db` char(64) collate utf8_bin NOT NULL default '',
`User` char(16) collate utf8_bin NOT NULL default '',
`Routine_name` char(64) collate utf8_bin NOT NULL default '',
`Routine_type` enum('FUNCTION','PROCEDURE') collate utf8_bin NOT NULL,
`Grantor` char(77) collate utf8_bin NOT NULL default '',
`Proc_priv` set('Execute','Alter Routine','Grant') character set utf8 NOT NULL default '',
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'

After the table was created you may continue upgrading.

It is recommended to download Plesk distributive from Parallels website, unpack it and install packages with “rpm -Uvh”.

Note: Before executing this command, make sure that you have taken the full backup of MySQL.

OR

cat /usr/share/mysql/mysql_fix_privilege_tables.sql | mysql --no-defaults --force --user=admin -p --host=localhost --database=mysql

[How to] How to configure containers to not apply Microsoft updates installed on Virtuozzo host.

Symptoms

By default Microsoft updates installed on Virtuozzo host are applied in containers during next containers start.

Resolution

If auto applying Microsoft updates in containers is unnecessary option it is possible to configure containers to not install updates even if its are on Virtuozzo host.

The following example shows how to disable this auto applying option for container 100:

vzcfgt set 100 DisableWindowsUpdates 1

If this option is set to “1” no more windows updates will be applied to the container 100.

But you can still manually install or remove windows updates to this container by using Container Update Manager.

To find Container Update Manager click Start button on the node and go to All Programs, Parallels, Parallels Virtuozzo Containers.

The command below enables auto applying option for container 100:

vzcfgt set 100 DisableWindowsUpdates 0

Also it’s possible to disable auto applying option for all newly created containers on a node:

vzcfgt set 0 DisableWindowsUpdates 1

Note: If it’s necessary to enable the auto installation of windows updates back in containers you should re-configure each container separately.

How to change time zone in Linux !

1. Log in as root, check which timezone your machine is currently using by executing `date`. You’ll see something like “Mon Feb 12 05:09:00 CST 2007″, CST in this case is the current timezone.

2. Change to the directory to /usr/share/zoneinfo, here you will find a list of time zone regions. Choose the most appropriate region. If you live in Canada or the US this directory is the “Americas” directory.

3. If you wish, backup the previous timezone configuration by copying it to a different location. Such as `mv /etc/localtime /etc/localtime-old`.

4. Create a symbolic link from the appropiate timezone to /etc/localtime. Example: `ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime`.

5. If you have the utility rdate, update the current system time by executing `rdate -s time.nist.gov` or `rdate -s rdate.cpanel.net`

6. Synchronize hardware clock with system clock by executing: ` /sbin/hwclock –systohc`

🙂

Plesk 8.x error : Unable to remove hosting: Unable to delete system user: SysUser->systemRemove() failed: usermng failed: Unknown error 0xC00CE558 (COM Error C00CE558) at execute command del” while deleting the domains

I faced a issue while deleted few domains from Plesk 8.6.

Error While deleting a domain from Plesk :

Unable to remove hosting: Unable to delete system user: SysUser->systemRemove() failed: usermng failed: Unknown error 0xC00CE558 (COM Error C00CE558) at execute command del” while deleting the domains

Every domains showed a COM error when tried to delete it. Here is a fix which I found :

Find a file name “DeferredRemovalStorage.xml” under directory %plesk_dir%\etc\ open it in notepad and you will see it empty, add the code as in the file and save :

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no” ?>

<Entries />

 

Now you will be able to delete the domains fine. If it still not work you can try

cd %plesk_bin%
mchk.exe --domain --domain-name=domain.com --fix=all