Unable to create backup due to the error: 'Unable to execute SQL: Column 'name' in field list is ambiguous'

Created:

2016-11-16 12:44:56 UTC

Modified:

2017-08-16 16:11:31 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to create backup due to the error: 'Unable to execute SQL: Column 'name' in field list is ambiguous'

Applicable to:

  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Unable to perform a backup due to an error:

Unable to execute SQL: Column 'name' in field list is ambiguous

Cause

One of the tables contains duplicate/ambiguous entry.

In our case it is:

SELECT name, value FROM ServiceNodeEnvironment AS e INNER JOIN ServiceNodes AS n ON e.serviceNodeId = n.id WHERE n.ipAddress = 'local' AND section = 'phphandlers';
ERROR 1052 (23000): Column 'name' in field list is ambiguous

Resolution

    mysql> select * from ServiceNodes;
+----+-------------+-----------+-----------+-----------+------------+-------+------+-----------------+
| id | description | transport | ipAddress | accessKey | externalId | type | name | remoteIpAddress |
+----+-------------+-----------+-----------+-----------+------------+-------+------+-----------------+
| 1 | local | local | local | NULL | | plesk | NULL | NULL |
+----+-------------+-----------+-----------+-----------+------------+-------+------+-----------------+
1 row in set (0.00 sec)

mysql> begin;
mysql> DROP TABLE IF EXISTS `ServiceNodes`;
CREATE TABLE `ServiceNodes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ipAddress` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT 'local',
`externalId` varchar(255) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT '',
`description` varchar(255) NOT NULL DEFAULT '',
`type` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT 'plesk',
`accessKey` text CHARACTER SET ascii COLLATE ascii_bin,
PRIMARY KEY (`id`),
UNIQUE KEY `ipAddress` (`ipAddress`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

LOCK TABLES `ServiceNodes` WRITE;
INSERT INTO `ServiceNodes` VALUES (1,'local','','Local','plesk',NULL);
UNLOCK TABLES;
mysql> commit;
Have more questions? Submit a request
Please sign in to leave a comment.