I get the error: “Could not connect to SQL database. Too many connections”.

Symptoms
Sometimes I get the “Too many connections” error in Plesk CP or when open a site in my browser:

Unable to connect to database: Too many connections

Cause
This error means that the limit of simultaneous MySQL connection to mysql server is reached and new connections to the server cannot be established at this time.

Resolution
There are two ways to solve this issue. The first one is increase the connection limit and the second, find what is the reason of “too many connection” error and try to lower MySQL server usage.

MySQL server state can be checked using ‘mysqladmin’ utility. For example to find out the number of current connections to the server use:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` extended-status | grep Max_used_connections
| Max_used_connections | 11 |

Current connections limit settings can be found with:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow ` variables | grep 'max.*connections'
| max_connections | 100 |
| max_user_connections | 0

In the example above, maximum number of connections to the server (max_connections) is set to 100. And maximum number of connections per user (max_user_connections) to zero, that means unlimited. There are default MySQL values. They can be redefined in /etc/my.cnf, for example:

[mysqld]
set-variable=max_connections=150
set-variable=max_user_connections=20

Restart MySQL after my.cnf is modified.

Note, if you set connections limit to very high value (more than 300) it may affect the server performance. It is better to find out the reason of the high MySQL server usage. You may check what users/requests slow mysql and take all curent connections, for example with the command:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` processlist

Parallels Plesk Panel reports that updates are available however all components are should updated on autoinstaller page

Symptoms
When I log to Parallels Plesk Panel it tells me that I have updates.
But when I check updates on page Home -> Updates -> Parallels Plesk Panel 9.2.x everything looks updated.

What causes the problem?
Cause
This issue is caused by the fact that there are still some components of Parallels Plesk Panel that need to be upgraded. But these components not listed on the Updater page in Parallels Plesk Panel.

Resolution
The problem will be fixed in future updates of Parallels Plesk Panel. As s solution for now it is recommended to upgrade the older component manually.

Run the following command to get list of Plesk components ready for updating:

~# /usr/local/psa/admin/sbin/autoinstaller --select-release-id PLESK_9_2_0 --show-components 2>&1 | grep upgrade
qmail [upgrade] - Qmail mailserver
~#

Put your own release ID instead of PLESK_9_2_0.

Use the following command to install the component:

~# /usr/local/psa/admin/sbin/autoinstaller --select-release-latest --install-component qmail

Message cannot be delivered and error “Unable to stat …executable’ or it is not link: No such file or directory” in maillog

Symptoms
For some account messages cannot be delivered and the following errors are shown in maillog:

/usr/local/psa/var/log/maillog
--->8---
Jun 10 03:53:42 vps310 postfix-local[21983]: Unable to stat entry '/usr/local/psa/handlers/info/10-spam-0gemCa/executable' or it is not link: No such file or directory
---8<---

Utility mchk does not fix the problem.

Cause
The error is caused by the fact that configuration of mail handler 10-spam-0gemCa is broken.
According to configuration in file system mail account mail@domain.name.tld has spamfilter enabled:

~# find /usr/local/psa/handlers/ -name '10-spam-0gemCa'
/usr/local/psa/handlers/before-local/recipient/mail@domain.name.tld/10-spam-0gemCa
~#

During message processing mail service is looking for executable binary, however it is missing:

~# ls -l /usr/local/psa/handlers/info/10-spam-0gemCa/executable
ls: /usr/local/psa/handlers/info/10-spam-3HB5Xe/executable: No such file or directory
~#

Resolution
It is advised to remove all mail handlers and run utility mchk to restore configuration according to Plesk database.
Stop services qmail, postfix, courier-imap and xinetd, backup old handlers and remove them:

~# /etc/init.d/postfix stop
~# /etc/init.d/qmail stop
~# /etc/init.d/courier-imap stop
~# /etc/init.d/xinetd stop

~# mkdir /root/temp
~# cp -a /usr/local/psa/handlers/before-local/recipient /root/temp/
~# cp -a /usr/local/psa/handlers/info /root/temp/
~# rm -rf /usr/local/psa/handlers/before-local/recipient/*
~# rm -rf /usr/local/psa/handlers/info/*

Then run utility mchk to recreate mail handlers. The output may look like the following:

~# /usr/local/psa/admin/sbin/mchk --with-spam
==> Checking for: mail_spam_restore... ok
==> Checking for: mailsrv_conf_init... ok
==> Checking for: mail_mailbox_restore... ok
==> Checking for: mailsrv_entities_dump... ok
==> Checking for: mail_admin_aliases... ok
==> Checking for: mail_auth_dump... ok
==> Checking for: mailman_lists_dump... ok
==> Checking for: mail_responder_restore... ok
==> Checking for: mail_drweb_restore... ok
==> Checking for: mail_kav_restore... not exsists
==> Checking for: mail_spf_restore... ok
==> Checking for: mail_dk_restore... ok
==> Checking for: mail_grey_restore... ok
~#

IMPORTANT: custom mail handlers will be lost after the reconfiguration. They need to be recreated.

Start services qmail, postfix, courier-imap and xinetd after the reconfiguration.
Additional information
The same problem may affect DrWeb Antivirus. You might get the following Antivirus filter report in bounce message:

--- Dr.Web report ---
Dr.Web detailed report:
The filter cannot connect to the DrWEB daemon

--- Dr.Web report ---

This meant that the message could not be delivered because execution of DrWeb mail handler failed.
Additional information
Parallels Plesk Panel 9.x provides ability to configure and put custom mail handlers: PPP 9.2 for Linux/Unix:: Modules API Reference
These handlers do not correspond to records in Plesk database, so mchk does not reconfigure mail handlers automatically.

Currently it is advised to recreate mail handlers according to the instructions above.

Plesk 9.X Upgrades : Table ‘mysql.procs_priv’ doesn’t exist

Plesk Upgrades to Plesk 9.X may result in MySQL errors while adding new Database user under Plesk.

Error under Plesk :
Table ‘mysql.procs_priv’ doesn’t exist

You can also check the same error under command line :

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

This can be fixed using below command. This will try to repair/ recreate the tables having issues.

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

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

Hope this helps 🙂

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

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

What’s new in Plesk 9?

Whats new in Plesk 9.0?

With it’s new multilevel control, Parallels Plesk 9 makes it easy to automate web hosting solutions for small business and resellers. There are five login levels to the control panel each level having its own permissions and features.

Administrator – This user has the highest level of permissions. Can be used to easily and quickly setupsystem services, and manage server users.
Reseller – This user has all the same functionality of the administrator except the ability to manage system services.
Client – Third tier login which has the permissions to create domains.
Domain Owner – Fourth tier login with permissions for single domain administration.
Mail User – Individual mail account users can manage passwords, spam filters and antivirus settings.

Resellers level. The resellers level is a new addition in Plesk 9, giving resellers the ability to manage and create their own clients and domains. Resellers can also distribute other services such as application hosting and databases on a per client basis.

Plesk Billing 6.0. Formerly Modernbill, Plesk 6.0 billing is a basic feature included in the installation with Plesk 9. Fully integrated with smooth nagivation between Plesk and Plesk Billing makes this software extremely efficient and easy to use.

APS Catalog. The new APS Catalog, provides the ability to download packages directly from Parallels website and make them available to your customers. Files are downloaded in APS format and added to the server application vault.Permissions for these applications can be provided to everyone or to select customers according to hosting plans.

Postfix Support. An alternative solution to qmail for unix based Plesk.

New Backup Tool. The new backup solution offers on-the-fly restoration conflicts which offer a variety of ways to resolve conflicts prior to a backup restoration.

Overselling/Overuse Capabilities.With the administrator and reseller users you may oversell your system resources to allow for flexibility and growth.

Plesk API 1.6. The updated API further improves the ability to integrate your software solutions with Plesk 9. Updates to the API include support for all new features included in Plesk 9.

Alternative Webmail. Plesk 9 offersfree Atmail Webmail Light 1.0, as a new webmail client, as well as commercial Atmail 5.5 support.

MSSQL 2008 Support. Parallels 9.0 for Windows offers Microsoft SQL Server 2008 support.

Merak 9.3.2 support. Parallels Plesk 9.0 for Windows offers Merak 9.3.2 Mail Server support.

For a full list of new features please see the following URL:

http://www.parallels.com/r/pdfs/Plesk/parallels_plesk_panel9_whatsnew.pdf

Mailbox unavailable or not local error messages

If you receive this error when adding a domain:

<coder>Unable to send notification: mail() failed: SMTP server response: 550 Requested action not taken: mailbox unavailable or not local

then you need to add a valid mailbox to your Plesk admin setup. To resolve this issue log into Plesk and click on:

Server
Edit (under personal information)
Replace the email address with a valid, working address.

Keep in mind this error shouldn’t prohibit you from creating a site, it is just notifying you that the “site created” email will not be sent.

When I logging into the Plesk CP and creating a user or domain, this error message appears right after creation: “Internal Plesk error occurred: Unable to send notification: mail() failed:”

APPLIES TO:

* Plesk 7.5.4 Reloaded
* Plesk 8.x for Linux/Unix

SYMPTOMS

Additionally the following errors may be shown:

Failed to connect to mailserver

SMTP server response: 550

Empty error message from utility.

CAUSE
This error means that Plesk failed to send notification for some reasons.
RESOLUTION

First of all make sure that Plesk SMTP server functioning properly as described in 1387.

Also, check Plesk Notifications configuration on the Server->Notification page in Plesk CP. Make sure that all mail addresses notification are configured to sent to are valid and there are no empty Email fields with enabled notifications checkbox.

PHP Upgrade issues : Plesk / Redhat 4


PHP Upgrade issues : Plesk / Redhat 4

I was trying to upgrade the PHP version to php5 on a Redhat 4 server with Plesk 8.4 but had many issues, as the redhat mirrors do not have PHP5. PHP5 is available with Redhat 5. I used atomicrocketturtle repository for the installation, here is a guide for the upgrades http://www.atomicorp.com/wiki/index.php/PHP

I then tried the wiki but got errors for up2date

#  up2date php –dry-run
Unresolvable chain of dependencies:
php-domxml-4.3.9-3.22.12 requires php = 4.3.9-3.22.12
php-pear-4.3.9-3.22.12 requires php = 4.3.9-3.22.12
php-sqlite2-1.0.2-200608291859 requires php <= 4.4.0

Later I used yum which too gave me errors for php-pdo and php-xml :

# yum update php
Error: Missing Dependency: php-common = 5.2.5-3.el4.art is needed by package php-pdo

I fixed that error by installing php-pdo

# yum install php-pdo
# yum update php
Error: Missing Dependency: php-common = 5.2.5-3.el4.art is needed by package php-xml
# yum install php-xml

You need to modify the php.ini for the module path, the upgrade will not modify the path to php5

Edit the php.ini to one as below :

; Directory in which the loadable extensions (modules) reside.
;extension_dir = /usr/lib/php4
extension_dir = /usr/lib/php/modules

Now I had previously ioncube installed on the php4 which throwed errors 🙁

# php -v
Failed loading /usr/lib/php4/php_ioncube_loader_lin_4.3.so:
/usr/lib/php4/php_ioncube_loader_lin_4.3.so: undefined symbol: zend_hash_add_or_update

PHP 5.2.6 (cli) (built: May  2 2008 11:18:31)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

I installed ioncube loader for php5 using :

# yum install php-ioncube-loader

Still the error was same, I debugged a  lot and found that there was ioncube_loader config file under php.d

# ls /etc/php.d | grep ioncube
ioncube.ini
ioncube-loader.ini

I removed the file ioncube-loader.ini which was for php4 and fixed the upgrade problems.

#  php -v
PHP 5.2.6 (cli) (built: May  2 2008 11:18:31)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies


Hope this helps anyone in mess 🙂