DNS Settings shows error: Syntax error or access violation

Created:

2016-11-16 12:59:13 UTC

Modified:

2017-04-13 09:39:56 UTC

0

Was this article helpful?


Have more questions?

Submit a request

DNS Settings shows error: Syntax error or access violation

Symptoms

When I click on DNS Settings in subscription settings, the following error appears in GUI:

    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1

0: Pdo.php:234
Zend_Db_Statement_Pdo->_execute(array)
1: Statement.php:300
Zend_Db_Statement->execute(array)
2: Abstract.php:479
Zend_Db_Adapter_Abstract->query(object of type Zend_Db_Table_Select, array)
3: Abstract.php:238
Zend_Db_Adapter_Pdo_Abstract->query(object of type Zend_Db_Table_Select, array)
4: Mysql.php:19
Db_Adapter_Pdo_Mysql->query(object of type Zend_Db_Table_Select)
5: Abstract.php:1534
Zend_Db_Table_Abstract->_fetch(object of type Zend_Db_Table_Select)
6: Abstract.php:1349
Zend_Db_Table_Abstract->fetchAll(object of type Zend_Db_Table_Select)
7: ApsResources.php:47
Db_Table_Broker_ApsResources->getLinkedIds(string 'dns-record', array)
8: DNSZoneList.php:104
DNSZoneList->loadRecords(array)
9: DNSZoneList.php:116
DNSZoneList->fetchDNSZoneList()
10: cList.php:85
cList->fetchList()
11: cList.php:104
cList->init()
12: DNSUIPointer.php:68
DNSUIPointer->accessItem(string 'GET', NULL null)
13: UIPointer.php:595
UIPointer->access(string 'GET')
14: plesk.php:45

Cause

Possible reasons are:

  1. Absent NS record for subscription. Even you delete all DNS records of subscription, NS record will not be deleted.

  2. All dns records of subscription are deleted from database manually

Resolution

  1. Login to Plesk database:

    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa
  2. Check dns records of domain:

    mysql> select * from dns_recs where dns_zone_id =(select dns_zone_id from domains where name='domain.com');

    where domain.com is your domain name.

  3. If there are no records from output, insert NS record in database as below:

    mysql> select dns_zone_id from domains where name='domain.com';
    +-------------+
    | dns_zone_id |
    +-------------+
    | 972 |
    +-------------+

    mysql> insert into dns_recs values (LAST_INSERT_ID(),972,'NS','domain.com','domain.com','ns1.domain.com.','ns1.domain.com.','','');
Have more questions? Submit a request
Please sign in to leave a comment.