Can't update to FreePBX 13 Alpha

Thanks Andrew. One last post. I have restored my system, then re-tried the upgrade using the method mentioned above except changed the

update admin set value = '13.0.0alpha1'

i changed to

13.0.0alpha60 (the most recent version I could find using google)

it seems to have changed to alpha22 in the upgrade (despite my attempt to force download then install).

i had to do an amportal a r then i got:

amportal a r

Please wait...

!!!!amportal is depreciated. Please use fwconsole!!!!
forwarding all commands to 'fwconsole'
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
Whoops\Exception\ErrorException: Missing argument 2 for Backup::__construct(), called in /var/www/html/admin/libraries/BMO/Self_Helper.class.php on line 125 and defined in file /var/www/html/admin/modules/backup/functions.inc/class.backup.php on line 30
Stack trace:
  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/functions.inc/class.backup.php:30
  2. Whoops\Run->handleError() /var/www/html/admin/modules/backup/functions.inc/class.backup.php:30
  3. Backup->__construct() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:125
  4. FreePBX\Self_Helper->autoLoad() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:37
  5. FreePBX\Self_Helper->__get() /var/www/html/admin/libraries/BMO/Hooks.class.php:199
  6. FreePBX\Hooks->preloadBMOModules() /var/www/html/admin/libraries/BMO/Hooks.class.php:38
  7. FreePBX\Hooks->updateBMOHooks() /var/lib/asterisk/bin/retrieve_conf:30

tried a fwconsole ma upgrade backup and:

fwconsole ma upgrade backup
No repos specified, using: [standard] from last GUI settings

Starting backup download..
Processing backup
Verifying local module download...Verified
Extracting...Done
Module backup successfully downloaded


                                                                               
  [Whoops\Exception\ErrorException]                                            
  Missing argument 2 for Backup::__construct(), called in /var/www/html/admin  
  /libraries/BMO/Self_Helper.class.php on line 125 and defined                 

same error i was seeing before. Then:

fwconsole ma upgrade framework
No repos specified, using: [standard] from last GUI settings

Starting framework download..
Processing framework
Verifying local module download...Verified
Extracting...Done
Module framework successfully downloaded
installing files to /var/www/html..done
installing files to /var/lib/asterisk/bin..done
installing files to /var/lib/asterisk/agi-bin..done
Checking for upgrades..
No further upgrades necessary
framework file install done, removing packages from module
file/directory: /var/www/html/admin/modules/framework/amp_conf removed successfully
file/directory: /var/www/html/admin/modules/framework/upgrades removed successfully
file/directory: /var/www/html/admin/modules/framework/start_asterisk removed successfully
file/directory: /var/www/html/admin/modules/framework/install removed successfully
file/directory: /var/www/html/admin/modules/framework/installlib removed successfully
Generating CSS...Done
Module framework successfully installed
Updating Hooks...Done

interesting…no error.

Then I went to the GUI and upgraded backup, and it worked OK!

Using the GUI I then upgraded ALL. everything worked up to the userman update which gave me the same error as I was getting before.

Could it be that I’m not running a distro version? I’m running Asterisk 13 with FreePBX 12.

Going to restore back to FreePBX12 and Asterisk13. Will wait I guess until you figure it out and/or the upgrade is available via GUI.

Thanks, and best regards,

Braden

Woah. No no no. You HAVE to keep it at alpha1! Without it being alpha1 it doesn’t do the proper upgrades. This is how all of our upgrade scripts work. Please stop jumping the gun without understanding the procedures. You effectively made the whole situation much worse.

Backup has to be done individually. Like I said please stay on 12. At least for now.

The distro doesnt matter and is not a requirement in any shape or form. You system is preventing the creation of the userman tables. I dont know why and I can’t replicate the issue. I would have to be on your machine to debug it properly.

The commands are as follows:

/var/lib/asterisk/bin/freepbx_setting MODULEADMIN_SKIP_CACHE 1
amportal a ma upgrade framework
mysqlcheck --auto-repair --check --all-databases
mysql -D asterisk -e "update admin set value = '13.0.0alpha1' where variable = 'version';"
amportal a ma upgrade framework
fwconsole --fix_zend
/var/lib/asterisk/bin/freepbx_setting MODULEADMIN_SKIP_CACHE 0
amportal
fwconsole moduleadmin download backup
fwconsole moduleadmin install backup
fwconsole moduleadmin updateall

Thanks Andrew. Tried your command list, failed on userman.

I am restoring to previous version. Will await upgrade through GUI.

That won’t be a fix to your issue. Mainly because we can’t replicate it. Are you using a VM?

EDIT: I did an upgrade on both a FreePBX Distro system AND a PBX In a Flash system and I am still unable to replicate said issue.

Hey Andrew - you’re right. So I got the GUI to update OK but a couple modules disabled, pending upgrade of the userman module. Still getting the same error. Did some looking at the tables… somehow when I use “show tables like…” both userman_users and userman_users_settings show up even though I can’t display records with select * … AND I still have freepbx_users and freepbx_users_settings tables with data in them…so somewhere along the line the tables didn’t migrate.

Any recommendations - is there a script I could run to perform this ?

There is no script to run. You need to rename the tables with correct data. I don’t know what you mean by “I cant display records” You need to either show errors or show the output otherwise we are just guess.

mysql>show tables like 'userman_users'
+------------------------------------+
| Tables_in_asterisk (userman_users) |
+------------------------------------+
| userman_users                      |
+------------------------------------+
1 rows in set (0 sec)
mysql>select * from userman_users;
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users' doesn't exist

mysql>show tables like 'userman_users_settings';
+---------------------------------------------+
| Tables_in_asterisk (userman_users_settings) |
+---------------------------------------------+
| userman_users_settings                      |
+---------------------------------------------+
1 rows in set (0 sec)

mysql>select * from userman_users_settings;
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users_settings' doesn't exist

Also I tried:

mysql>RENAME TABLE freepbx_users TO userman_users;
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'userman_users' already exists
mysql>drop table userman_users;
SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'userman_users'
mysql>insert into userman_users select * from freepbx_users;
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users' doesn't exist

EDIT:

OK i have made some progress. For some reason I was getting errors when dropping the ‘fake’ tables, but after fwconsole chown in between it appeared to work. I saw a script on code.freepbx.org after googling “userman_users” and followed the instructions there. seems all the columns were updated, but the info remained in the freepbx_users and freepbx_users_settings tables.

root@braden-Macmini:~# fwconsole chown
Setting Permissions...
 15475/15475 [============================] 100%
Finished setting permissions
Removing dangling symlink /etc/asterisk/cel.conf which points to a file that no longer exists
Removing dangling symlink /etc/asterisk/cel_odbc.conf which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/agent-login.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/agent-logoff.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-matching-entries-continue.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-matching-entries-or-pound.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-please-enter-first-three.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-sorry-no-entries.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-there-are.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-transferring-further-assistance.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/cdir-welcome.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/exited-vm-will-be-transfered.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/featurecode.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/followme.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/incoming-call-1-accept-2-decline.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/incoming-call-no-longer-avail.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/intercom.wav which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/line-busy-transfer-menu.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/please-enter-your-extension-then-press-pound.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/you-will-be-transfered-menu.sln which points to a file that no longer exists
root@braden-Macmini:~# fwconsole m
Connecting to the Database...Connected
mysql>show tables like 'userman_users';
Successfully executed
mysql>RENAME TABLE freepbx_users TO userman_users;
Successfully executed
mysql>RENAME TABLE freepbx_users_settings TO userman_users_settings;
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'userman_users_settings' already exists
mysql>drop table userman_users_settings;
SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'userman_users_settings'
mysql>exit
root@braden-Macmini:~# fwconsole chown
Setting Permissions...
 15455/15455 [============================] 100%
Finished setting permissions
root@braden-Macmini:~# fwconsole m
Connecting to the Database...Connected
mysql>RENAME TABLE freepbx_users_settings TO userman_users_settings;
Successfully executed
mysql>show tables like 'userman_groups";
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 ''userman_groups"' at line 1
mysql>exit
root@braden-Macmini:~# fwconsole chown
Setting Permissions...
 15455/15455 [============================] 100%
Finished setting permissions
root@braden-Macmini:~# fwconsole m
Connecting to the Database...Connected
mysql>show tables like 'userman_groups';
+-------------------------------------+
| Tables_in_asterisk (userman_groups) |
+-------------------------------------+
| userman_groups                      |
+-------------------------------------+
1 rows in set (0 sec)
mysql>select * from userman_groups;
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_groups' doesn't exist
mysql>drop table userman_groups;
SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'userman_groups'
mysql>exit
root@braden-Macmini:~# fwconsole chown
Setting Permissions...
 15455/15455 [============================] 100%
Finished setting permissions
root@braden-Macmini:~# fwconsole m
Connecting to the Database...Connected
mysql>show tables like 'userman_groups';
Successfully executed
mysql>CREATE TABLE IF NOT EXISTS `userman_groups_settings` (`gid` int(11) NOT NULL,`module` char(65) NOT NULL,`key` char(255) NOT NULL,`val` longblob NOT NULL,`type` char(16) DEFAULT NULL,UNIQUE KEY `index4` (`gid`,`module`,`key`),KEY `index2` (`gid`,`key`),KEY `index6` (`module`,`gid`));
Successfully executed
mysql>SHOW COLUMNS FROM `userman_users` WHERE FIELD = "default_extension";
+-------------------+-------------+------+-----+---------+-------+
| Field             | Type        | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| default_extension | varchar(45) | NO   |     | none    |       |
+-------------------+-------------+------+-----+---------+-------+
1 rows in set (0 sec)
mysql>select * from userman_users;
+----+----------+-------------+------------------------------------------+-------------------+---------------+-------+-------+-------------+-------+---------+------------+-------+------+------+------+-----+
| id | username | description | password                                 | default_extension | primary_group | fname | lname | displayname | title | company | department | email | cell | work | home | fax |
+----+----------+-------------+------------------------------------------+-------------------+---------------+-------+-------+-------------+-------+---------+------------+-------+------+------+------+-----+
| 1  | admin    |             | 88c4f149f661d85f2dc1e451967b4fb6d9d39495 | 403               |               |       |       |             |       |         |            |       |      |      |      |     |
+----+----------+-------------+------------------------------------------+-------------------+---------------+-------+-------+-------------+-------+---------+------------+-------+------+------+------+-----+
1 rows in set (0 sec)

Long story short, the update to USERMAN module was now successful and all the modules depending on userman too. will let you know if i experience any issues.

1 Like

Part of your issue is that you were trying to run commands such as:

show tables like 'userman_groups";

Notice the quotes arent matching.

Yeah, thanks. I edited out some of the commands that didn’t work, must have missed that one. anyways got it working.

I have the same issue. After upgrading from FreePBX 12 to 13, everything works beside user management and UCP. The mysql tables userman_users and userman_users_settings exist, but userman_groups and userman_groups_settings havent been created. These groups are a new feature i guess?

root@asterisk:~# fwconsole moduleadmin install userman



  [Exception]
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_groups_settings' doesn't exist::

And i can’t create the table:

root@asterisk:~# mysql -uYYY -pXXX
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 658
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)

mysql> use asterisk;
Database changed

mysql> CREATE TABLE IF NOT EXISTS userman_groups_settings (gid int(11) NOT NULL,module char(65) NOT NULL,key char(255) NOT NULL,val longblob NOT NULL,type char(16) DEFAULT NULL,UNIQUE KEY index4 (gid,module,key),KEY index2 (gid,key),KEY index6 (module,gid));
ERROR 1064 (42000): 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 'char(255) NOT NULL,val longblob NOT NULL,type char(16) DEFAULT NULL,UNIQUE KEY i' at line 1

fwconsole ma install userman

Note you are using an unsupported version of mysql

I’ve run into this before in other systems - they word “key” is a reserved word and should be avoided in database definitions. You can still do it, you just need to ‘escape’ the name to avoid MySQL reacting wrongly to the reserved word.

Since you are trying to create the table by hand, try wrapping the column name in quotes. That should tighten you up.

i fixed it by executing

mysql_upgrade -uUSERNAME -pPASSWORD --force

Somehow the tables had been shown by “show tables” but any other mysql-command couldn’t see them.

isn’t ma just an abbreviation for moduleadmin ? So this is the command which failed for me.

I just followed the instructions on how to Installing FreePBX 13 on Ubuntu Server 14.04.2 LTS and mysql-server 5.5.47 is the default version for Ubuntu 14.04.

Please RUN the command and post the output. Thank you.

I guess it woulndt help. It seemed to be a halfway broken mysql database which got fixed by running mysql_upgrade -uUSERNAME -pPASSWORD --force