Error when installing Commercial Module Endpoint Manager

I am getting the following Error: INSERT INTO endpoint_global (key, values) VALUES (‘legacyXML’, ‘Y’) – SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘legacyXML’ for key ‘key’::

I am trying to install the Endpoint Manager Module and I am unable to

I am running FreePBX 13.0.190.9 with Asterisk 11.7

Here is the rest of the screen dump:

Exception
HELP
INSERT INTO endpoint_global (key, values) VALUES (‘legacyXML’, ‘Y’) – SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘legacyXML’ for key ‘key’::
/var/www/html/admin/libraries/utility.functions.php
if(is_object($extended_text) && method_exists($extended_text,“getMessage”)) {
$e = $extended_text;
$extended_text = htmlentities($e->getMessage());
$code = $e->getCode();
throw new \Exception($text . “::” . $extended_text,$code,$e);
} else {
$extended_text = htmlentities($extended_text);
throw new \Exception($text . “::” . $extended_text);
}
}
Server/Request Data
HTACCESS on
HTTP_HOST 173.247.163.67:8051
HTTP_CONNECTION keep-alive
CONTENT_LENGTH 0
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
HTTP_ORIGIN http://173.247.163.67:8051
HTTP_ACCEPT /
HTTP_DNT 1
HTTP_REFERER http://173.247.163.67:8051/admin/config.php?display=modules
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.8
HTTP_COOKIE lang=en_US; searchHide=1; PHPSESSID=ht82eeeif9un3jto1pdger58n6; _ga=GA1.1.25508012.1492538380
PATH /sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE Apache/2.2.15 (CentOS) Server at 173.247.163.67 Port 8051
SERVER_SOFTWARE Apache/2.2.15 (CentOS)
SERVER_NAME 173.247.163.67
SERVER_ADDR 192.168.0.5
SERVER_PORT 8051
REMOTE_ADDR 208.57.127.226
DOCUMENT_ROOT /var/www/html
SERVER_ADMIN [email protected]
SCRIPT_FILENAME /var/www/html/admin/config.php
REMOTE_PORT 60230
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD POST
QUERY_STRING display=modules&action=process&quietmode=1&online=1&modules%5Bendpoint%5D%5Baction%5D=install&modules%5Bendpoint%5D%5Btrack%5D=stable
REQUEST_URI /admin/config.php?display=modules&action=process&quietmode=1&online=1&modules%5Bendpoint%5D%5Baction%5D=install&modules%5Bendpoint%5D%5Btrack%5D=stable
SCRIPT_NAME /admin/config.php
PHP_SELF /admin/config.php
REQUEST_TIME 1492552388
GET Data
display modules
action process
quietmode 1
online 1
modules Array ( [endpoint] => Array ( [action] => install [track] => stable ) )
POST Data
empty
Files
empty
Cookies
lang en_US
searchHide 1
PHPSESSID ht82eeeif9un3jto1pdger58n6
_ga GA1.1.25508012.1492538380
Session
langdirection ltr
module_name modules
module_page modules
AMP_user ampuser Object ( [username] => admin [id] => [password:ampuser:private] => ec98be66dd4edf698a0cb752da3b1635bb39f7a6 [extension_high:ampuser:private] => [extension_low:ampuser:private] => [sections:ampuser:private] => Array ( [0] => * ) [mode:ampuser:private] => database [opmode:ampuser:private] => [_lastactivity] => 1492552388 )
Environment Variables
empty
Registered Handlers
0. Whoops\Handler\PrettyPageHandler

Hi Roger,
I believe I have had the same issue as yourself, FreePBX 14.0.1.20
During updates the endpoint module never got past the “Checking Settings and Defaults…” line and has now caused the issue where we had to force the module removal but now cant install it again due to sql duplicate entries.
Did you ever get a resolution to this?

More details below,

Upgrading module ‘endpoint’ from 14.0.2.8 to 14.0.2.8
Downloading module 'endpoint’
Processing endpoint
Verifying local module download…Verified
Extracting…Done
Download completed in 2 seconds
Checking database tables…Done
Migrating tables as required…Done
Checking Settings and Defaults…

I have found another post that talks about deleting the key via sql commands but sql is something i am learning. Here are some commands I have used, hopefully someone can help.

mysql asterisk -e “DELETE FROM endpoint_global WHERE key = “legacyXML”;”

this command complains about
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘key = legacyXML’

I have tried
mysql asterisk -e “DELETE FROM endpoint_global WHERE ‘key = legacyXML’;”

which gives no error but I unfortunately I am still trying to learn sql a bit more.

Next steps - I have found a command to drop the whole endpoint_global table. might be a bit extreme but gets away from the previous error.
mysql asterisk
SHOW TABLES;
drop table if exists endpoint_global;
SHOW TABLES;
you will see the table has gone.
Now we can try installing endpoint again, however it just sits on the “Checking Settings and Defaults” line, so back to square one.

Try this:
cd /var/www/html/admin/modules/
rm -rf endpoint
fwconsole ma uninstall restart
mysqlcheck --repair --all-databases
fwconsole ma downloadinstall endpoint
fwconsole r

Hi Demani, thanks for the command, I left my system sitting on the “Checking Settings and Defaults” overnight and it has completed ok this morning :slight_smile:

I will keep a record of your commands if I ever have this issue again,
Regards
Dave

Hello Roger,

I had the same problem with FreePBX 14 and Asterisk 14 and End Point Manager 14.0.2.8.
While trying installing the module via fwconsole I got this error:

[Exception]
INSERT INTO endpoint_global (key, values) VALUES (‘legacyXML’, ‘Y’) – SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘legacyXML’ for key ‘key’::

For now I solved the problem as follows:

connect asterisk db via commandline: # mysql asterisk
SELECT * FROM endpoint_global
| key | values |
| legacyXML | Y |
1 row in set (0.00 sec)
This was the only entry in that table.
So I delete this entry with “DELETE FROM endpoint_global;”
After that I did “fwconsole ma downloadinstall endpoint”
After a while the End Point Manager was installed successfully.
Downloading module 'endpoint’
Processing endpoint
Verifying local module download…Verified
Extracting…Done
Download completed in 5 seconds
Checking database tables…Done
Migrating tables as required…Done
Checking Settings and Defaults…Done
Generating Configs…Done
Downloading Firmware…Done (Background)
Generating CSS…Done
Module endpoint successfully installed
Updating Hooks…Done
Enjoy

RudiS

After removing the OSS endpoint manager I was unable to install the commercial endpoint manager.

Thankfully google found this thread. My Fix was a combination of a few from above.

Order as follows:

cd /var/www/html/admin/modules/
rm -rf endpoint

mysql asterisk
drop table if exists endpoint_global;
drop table if exists endpoint_timezones;
drop table if exists endpoint_models;

mysqlcheck --repair --all-databases
fwconsole ma downloadinstall endpoint
fwconsole r

Now it is installed with no errors.

Thanks for your help everyone.

Jerome

1 Like

This advice has just fixed a similar issue for me on 13, thanks Jerome!

1 Like