Postgresql Error on Plesk
When trying to use Postgresql on Plesk Control Panel >> servers >> Database Servers >> Local PostgreSQL, getting the following error while using the postgresql for the first time.
Unable to rewrite /var/lib/pgsql/data/pg_hba.conf
1
Error on query to PostgreSQL
1
Unable to rewrite /var/lib/pgsql/data/pg_hba.conf
1
0: /usr/local/psa/admin/plib/DatabaseManagerPostgreSQL.php:263DatabaseManagerPostgreSQL-
>createLocalAdminLoginImpl(string ‘admin’, string ‘********’, NULL null)1: /usr/local/psa/
admin/plib/DatabaseManager.php:513DatabaseManager->updateLocalAdmin()2:
/usr/local/psa/admin/plib/DatabaseServerManager.php:229DatabaseServerManager->
updateServer(object of type DatabaseServer)3: /usr/local/psa/admin/htdocs/server/db_server_edit.php:52
This means postgresql is not running and when checking the error logs we can see like this:
#tail -f /usr/local/psa/admin/logs/httpsd_error_log
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/tmp/.s.PGSQL.5432″?
sed: can’t read /var/lib/pgsql/data/pg_hba.conf: No such file or directory
#tail -f /var/lib/pgsql/pgstartup.log
postmaster cannot access the server configuration file “/var/lib/pgsql/data/postgresql.conf”:
No such file or directory
Usually this happens when the postgresql database is not properly initialized. For fixing this error, we need to reinitialize the postgrsql database.
# rm -rf /var/lib/pgsql/data
# /etc/rc.d/init.d/postgresql start
Then again go to Plesk Control Panel >> servers >> Database Servers >> Local PostgreSQL and give your
administrator username and password.
DB query failed: Unknown column ’serial’ in ‘field list’
After upgrading plesk from version 8.4 to 8.6, you may encounter the following error while deactivating a domain.
Plesk >> Domains >> domain.com
Error:
DB query failed: Unknown column ’serial’ in ‘field list’
———————- Debug Info ——————————-
0: plib\common_func.php3:243
db_query(string ’select `id`, `name`, `displayName`, `email`, `status`, `type`, `ttl`, `ttl_unit`, `refresh`, `refresh_unit`, `retry`, `retry_unit`, `expire`, `expire_unit`, `minimum`, `minimum_unit`, `serial`, `serial_format` from `dns_zone` where `id`=311′)
1: plib\class.Table.php:189
Table->select()
2: plib\dns\DNSZone.php:49
DNSZone->DNSZone(string ‘311′)
3: plib\common_func.php3:2929
objectMaker(string ‘DNSZone’, string ‘311′)
4: plib\dns\DNSManager.php:34
DNSManager::getDNSZone(string ‘311′)
5: plib\class.Domain.php:787
Domain->getDNSZone()
6: plib\class.Domain.php:244
Domain->turnOff(integer ‘16′, integer ‘0′, boolean false)
7: plib\class.BsDomain.php:417
BsDomain->turnOff()
8: htdocs\domains\dom_ctrl.php3:107
Cause:
Due to the missing entries “serial” and “serial_format” in the table “dns_zone”(under psa database).
Solution:
mysql -u admin -p `cat /etc/psa/.psa.shadow`
(Log in to mysql using Plesk’s stored password)
mysql> use psa
(Select Plesk’s database)
mysql> describe dns_zone;
(Check if there are rows titled serial and serial_format. If not, perform the steps below)
mysql> ALTER TABLE `dns_zone` add `serial` VARCHAR( 12 ) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT ‘0′;
mysql> ALTER TABLE `dns_zone` add `serial_format` ENUM( ‘UNIXTIMESTAMP’, ‘YYYYMMDDNN’ ) NOT NULL DEFAULT ‘UNIXTIMESTAMP’;
(Add the appropriate rows to the dns_zone table.)
describe dns_zone;
Should look something like:
+—————+————————————+——+—–+—————+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+————————————+——+—–+—————+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | | | |
| displayName | varchar(255) | NO | | | |
| status | int(10) unsigned | NO | | 0 | |
| email | varchar(255) | YES | | NULL | |
| type | enum(’slave’,'master’) | NO | | master | |
| ttl | int(10) unsigned | NO | | 86400 | |
| ttl_unit | int(10) unsigned | NO | | 1 | |
| refresh | int(10) unsigned | NO | | 10800 | |
| refresh_unit | int(10) unsigned | NO | | 1 | |
| retry | int(10) unsigned | NO | | 3600 | |
| retry_unit | int(10) unsigned | NO | | 1 | |
| expire | int(10) unsigned | NO | | 604800 | |
| expire_unit | int(10) unsigned | NO | | 1 | |
| minimum | int(10) unsigned | NO | | 10800 | |
| minimum_unit | int(10) unsigned | NO | | 1 | |
| serial | varchar(12) | NO | | 0 | |
| serial_format | enum(’UNIXTIMESTAMP’,'YYYYMMDDNN’) | NO | | UNIXTIMESTAMP | |
+—————+————————————+——+—–+—————+—————-+
18 rows in set (0.00 sec)
Plesk Retrieve keys - open or save ‘key_update.php’
The plesk license key can be retrieved via plesk control panel
Plesk >> Server >> License Management >> Retrieve keys
Sometimes, when you click on “Retrieve keys”, you will get a download prompt to open or save the ‘key_update.php’ file.
1.Check the log file /usr/local/psa/admin/logs/httpsd_error_log
If you get the error “xmlrpc_client.c:675: assertion failed”,
2. Restart Plesk Control Panel to perform correct startup configuration.
# /usr/local/psa/admin/bin/httpsdctl stop
# /usr/local/psa/admin/bin/httpsdctl start
# /etc/init.d/psa stop
# /etc/init.d/psa start
Domain creation error in Plesk
When you create a new domain via the Plesk control Panel, sometimes you may receive the following error.
ERROR:
Failed domain creation: Unable to update domain data: Failed mail post-configuration: Can’t create mail domain servie: mailManager->addDomain() failed: mailmng failed: MEAOPO.PostOffice ———————- Debug Info ——————————- 0: c:\Program Files\SWsoft\Plesk\admin\htdocs\domains\create_domain.php:146
This means that there is some issue with the mail server configuration and that has to be repaired.
Run the following command.
cd %plesk_bin%
mchk.exe –all
After executing the above command, check if you are able to create a new domain. If you receive any error again, then run the following command.
The above command will forcefully reset the domain and server wide configuration settings according to the Plesk Database.
Note that the custom settings will be lost after executing this command.
Accessing web_users
By default in Plesk, we can only access the web users using http://domain.com/~webuser/. Do the following steps to access the web users using the URL http://domain.com/webuser/
1. Add the following entry in the /var/www/vhosts/domain.com/conf/vhost.conf file of the domain:
Alias /webuser /var/www/vhosts/domain.com/web_users/webuser
2. Now reconfigure the domain using websrvmng:
/usr/local/psa/admin/bin/websrvmng –reconfigure-vhost –vhost-name=