Archive for the tag 'query failed'

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)

SBDavid

Pgsql query failed

Pgsql query failed

If you are getting the error as follows.

Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for relation cg_ref_codes in /home/user/public_html/xxx.php on line 48
Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in /home/user/public_html/xxxx.php on line 50

Resolution

1. Open the pgsql configuration file.

vi /var/lib/pgsql/data/pg_hba.conf
local all all md5
host all all 127.0.0.1 255.255.255.255 md5

The file need to change as follows
local all all md5
host all all 127.0.0.1 255.255.255.255 password

2. Save the file and restart pgsql.

/etc/init.d/postgresql stop
/etc/init.d/postgresql start