Create Database fails in Plesk: data trucated for obj_class

When trying to create a new mysql database in Plesk, you may run into the following error:
DB query failed: Data truncated for column ‘obj_class’ at row 1

When viewing the details of the error, your screen may look like this:

---------------------- Debug Info -------------------------------
0: C:\SWSoft\Plesk\admin\plib\common_func.php3:213
db_query(string 'INSERT INTO exp_event (source, event_type, event_time, obj_class, obj_id, host, `user`, flushed) VALUES ('plesk', 'created', NOW(), 'db','xxxx_test2', 'xx.xx.xx.xxx', 'admin', 'false')')
1: C:\SWSoft\Plesk\admin\plib\api-rpc\loger.php:323
Log2Expand->Log2Expand(object of type ActionLog)
2: C:\SWSoft\Plesk\admin\plib\class.ActionLog.php:520
ActionLog->submit()
3: C:\SWSoft\Plesk\admin\plib\DatabaseManager.php:73
DatabaseManager->createDatabase(object of type Database)
4: C:\SWSoft\Plesk\admin\htdocs\domains\databases\db_add.php:104

The issue is that obj_class is an enumerated type in Plesk’s PSA database and a value its trying to insert is not in the list of allowed values. In the query below, the value ‘db’ is trying to stuffed into the obj_class field:

db_query(string 'INSERT INTO exp_event (source, event_type, event_time, obj_class, obj_id, host, `user`, flushed) VALUES ('plesk', 'created', NOW(), 'db','xxxx_test2', 'xx.xx.xx.xxx', 'admin', 'false')')

To fix the problem, go into Plesk, click on Server, Database Server, then Admin
You may be able to directly go to phpmyadmin via the url
https://[yourdomainhere].com:8443/domains/databases/phpMyAdmin/index.php
Go to the psa database, exp_event table, structure, obj_class field and add ‘db’ to the end of the list. You should end up with this:(‘license’, ‘service’, ‘ip_address’, ‘admin_info’, ‘siteapp’, ‘session_preferences’, ‘plesk_component’, ‘client’, ‘client_limits’, ‘client_status’, ‘client_prefs’, ‘client_perms’, ‘client_ip_pool’, ‘client_limit_traffic’, ‘client_limit_size’, ‘domain’, ‘domain_limits’, ‘domain_user’, ‘domain_alias’, ‘domain_status’, ‘phosting’, ‘fhosting’, ‘domain_limit_traffic’, ‘domain_limit_size’, ‘db_server’, ‘subdomain’, ‘mailname’, ‘webuser’, ‘maillist’, ‘dns_zone’, ‘mailname_antivirus’, ‘mailname_spamfilter’, ‘mailname_mailgroup’, ‘mailname_autoresponder’, ‘mailname_attachment’, ‘remote_dns’, ‘dashboard_preset’, ‘dashboard_preset_type’, ‘dashboard_preset_name’, ‘db’)

Here is more info on the issue: http://forum.swsoft.com/pda/index.php/t-50698.html

This entry was posted in Data Geek. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *