[Solved] FreePBX EM Module update to 2.11.0.49 just after updating sysadmin required an "amportal a r" before

Just to report back that on a FreePBX Distro 5.211.65-11 the latest upgrade of FreePBX Endpoint Manager module (Commercial) from 2.11.0.48 to 2.11.0.49 needed to be done manually twice with an “amportal a r” and “amportal chown” in between if sysadmin was immediately manually updated before, this, at least, is what happened in my system…see the “PHP Fatal error” line below:

[[email protected] ~]# /var/lib/asterisk/bin/module_admin showupgrades no repos specified, using: [standard,extended,commercial] from last GUI settings

Upgradable:
endpoint 2.11.0.1.48 -> 2.11.0.1.49
sysadmin 2.11.0.49 -> 2.11.0.50
[[email protected] ~]# /var/lib/asterisk/bin/module_admin upgrade sysadmin
Downloading 0 of 186771 (0%) --2014-04-10 07:41:25-- http://mirror1.freepbx.org/modules/packages/sysadmin/5.3/sysadmin-2.11.0.50.tgz?installid=a31a6c91e87aa98ff5d58d9a603fe0dd
Resolving mirror1.freepbx.org… 162.253.134.144
Connecting to mirror1.freepbx.org|162.253.134.144|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 186771 (182K) [application/octet-stream]
Saving to: “/var/www/html/admin/modules/_cache/sysadmin-2.11.0.50.tgz”

100%[=============================================================================================================================>] 186,771 213K/s in 0.9s

2014-04-10 07:41:26 (213 KB/s) - “/var/www/html/admin/modules/_cache/sysadmin-2.11.0.50.tgz” saved [186771/186771]

Downloading 186771 of 186771 (100%)

Untaring…Done
Module sysadmin successfully downloaded
2.7.0 184_centos6
Successfully copied LoadLicenseIfExists.php.
mv: cannot stat `/var/lib/asterisk/agi-bin/license-*.zl’: No such file or directory
checking for ftp_server field…already exists
checking for tftp_server field…already exists
checking for ups_enabled field…already exists
Checking for abnormalcallvolume…No abnormalcallvolume found…Module sysadmin successfully installed

SETTING FILE PERMISSIONS
chattr: Operation not supported while reading flags on /var/www/html/isymphony
Permissions OK
[[email protected] ~]# /var/lib/asterisk/bin/module_admin upgrade endpoint
Downloading 0 of 1125165 (0%) --2014-04-10 07:41:42-- http://mirror1.freepbx.org/modules/packages/endpoint/5.3/endpoint-2.11.0.1.49.tgz?installid=a31a6c91e87aa98ff5d58d9a603fe0dd
Resolving mirror1.freepbx.org… 162.253.134.144
Connecting to mirror1.freepbx.org|162.253.134.144|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1125165 (1.1M) [application/octet-stream]
Saving to: “/var/www/html/admin/modules/_cache/endpoint-2.11.0.1.49.tgz”

100%[=============================================================================================================================>] 1,125,165 600K/s in 1.8s

2014-04-10 07:41:44 (600 KB/s) - “/var/www/html/admin/modules/_cache/endpoint-2.11.0.1.49.tgz” saved [1125165/1125165]

Downloading 1125165 of 1125165 (100%)

Untaring…Done
Module endpoint successfully downloaded
PHP Fatal error: Cannot redeclare endpoint_systype() (previously declared in /var/www/html/admin/modules/endpoint/functions.inc/functions_license.php:5) in /var/www/html/admin/modules/endpoint/functions.inc/functions_license.php on line 0
[[email protected] ~]# /var/lib/asterisk/bin/module_admin upgrade endpoint
Downloading 0 of 1125165 (0%) --2014-04-10 07:42:53-- http://mirror1.freepbx.org/modules/packages/endpoint/5.3/endpoint-2.11.0.1.49.tgz?installid=a31a6c91e87aa98ff5d58d9a603fe0dd
Resolving mirror1.freepbx.org… 162.253.134.144
Connecting to mirror1.freepbx.org|162.253.134.144|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1125165 (1.1M) [application/octet-stream]
Saving to: “/var/www/html/admin/modules/_cache/endpoint-2.11.0.1.49.tgz”

100%[=============================================================================================================================>] 1,125,165 605K/s in 1.8s

2014-04-10 07:42:55 (605 KB/s) - “/var/www/html/admin/modules/_cache/endpoint-2.11.0.1.49.tgz” saved [1125165/1125165]

Downloading 1125165 of 1125165 (100%)

Untaring…Done
Module endpoint successfully downloaded
PHP Fatal error: Cannot redeclare endpoint_systype() (previously declared in /var/www/html/admin/modules/endpoint/functions.inc/functions_license.php:5) in /var/www/html/admin/modules/endpoint/functions.inc/functions_license.php on line 0
[[email protected] ~]# amportal a r

Fetching FreePBX settings with gen_amp_conf.php…

Successfully reloaded
[[email protected] ~]# amportal chown

Fetching FreePBX settings with gen_amp_conf.php…

SETTING FILE PERMISSIONS
chattr: Operation not supported while reading flags on /var/www/html/isymphony
Permissions OK
[[email protected] ~]# /var/lib/asterisk/bin/module_admin showupgrades
no repos specified, using: [standard,extended,commercial] from last GUI settings

Upgradable:
endpoint 2.11.0.1.48 -> 2.11.0.1.49
[[email protected] ~]# /var/lib/asterisk/bin/module_admin upgrade endpoint
Downloading 0 of 1125165 (0%) --2014-04-10 07:47:27-- http://mirror1.freepbx.org/modules/packages/endpoint/5.3/endpoint-2.11.0.1.49.tgz?installid=a31a6c91e87aa98ff5d58d9a603fe0dd
Resolving mirror1.freepbx.org… 162.253.134.144
Connecting to mirror1.freepbx.org|162.253.134.144|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1125165 (1.1M) [application/octet-stream]
Saving to: “/var/www/html/admin/modules/_cache/endpoint-2.11.0.1.49.tgz”

100%[=============================================================================================================================>] 1,125,165 609K/s in 1.8s

2014-04-10 07:47:29 (609 KB/s) - “/var/www/html/admin/modules/_cache/endpoint-2.11.0.1.49.tgz” saved [1125165/1125165]

Downloading 1125165 of 1125165 (100%)

Untaring…Done
Module endpoint successfully downloaded
/bin/mkdir: cannot create directory /tftpboot/images': File exists /bin/mkdir: cannot create directory/tftpboot/images/originals’: File exists
/bin/mkdir: cannot create directory /tftpboot/images/formatted': File exists /bin/mkdir: cannot create directory/tftpboot/firmwaredownloads’: File exists

Re-Writing Templates

Templates Rebuilt

Module endpoint successfully installed

SETTING FILE PERMISSIONS
chattr: Operation not supported while reading flags on /var/www/html/isymphony
Permissions OK
[[email protected] ~]# amportal a r

Fetching FreePBX settings with gen_amp_conf.php…

Successfully reloaded
[[email protected] ~]# amportal a r

Fetching FreePBX settings with gen_amp_conf.php…

Successfully reloaded