DB Error: no such field after 2.6 update - HELP!

I am new to using FREEPBX and have just updated to 2.6. Now I cannot get into our admin console and get the error:

FATAL ERROR
DB Error: no such field

Followed some instructions on the NET to fix, but failed to fix the problem. Help Please!

http://www.brownweb.com.au/blog/2010/freepbx-problem-fatal-error-after-upgrade/

mysql> use asterisk

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from ampusers;
±---------±-----------------------------------------±--------------±---------------±---------±---------+
| username | password_sha1 | extension_low | extension_high | deptname | sections |
±---------±-----------------------------------------±--------------±---------------±---------±---------+
| admin | 51a582ca69ff54cb8beaf613d1f059e0ba22e97b | | | | * |
±---------±-----------------------------------------±--------------±---------------±---------±---------+
1 row in set (0.02 sec)

mysql> alter table ampusers change password_sha1 password_sha1 varchar(20);
Query OK, 1 row affected, 1 warning (0.05 sec)
Records: 1 Duplicates: 0 Warnings: 1

mysql> use asterisk
Database changed
mysql>
mysql>
mysql> select * from ampusers;
±---------±---------------------±--------------±---------------±---------±---------+
| username | password_sha1 | extension_low | extension_high | deptname | sections |
±---------±---------------------±--------------±---------------±---------±---------+
| admin | 51a582ca69ff54cb8bea | | | | * |
±---------±---------------------±--------------±---------------±---------±---------+
1 row in set (0.00 sec)

Well, don’t follow instructions without checking if it is correct. You just messed up your database by shortening a field that was correct.

The password_sha1 VARCHAR(40) IS correct, so now you need to revert your changes.

Excuse my ignorance but this is all new to me. How do I revert changes and more importantly how do I get back the admin console to freepbx? I appreciate the help

First, do this in a mysql cli:

alter table ampusers change password_sha1 password_sha1 varchar(40);

Then update the password to the previous:

update ampusers set password_sha1 = '51a582ca69ff54cb8beaf613d1f059e0ba22e97b' where username = 'admin';

Now you are back to where you started breaking things, now can you tell us:
Is this a Distro like AsteriskNOW, PBX in a Flash or some other?
What is the exact error you receive?

Thanks Mikael not a LINUX or SQL person so bare with me. Running a box with Centos and FREEPBX updated from 2.3 to 2.6 and since then I cannot login to the FREEPBX ADMINISTRATION via web applet. I get the main menu when I call up the IP address of our PBX box

Voicemail & Recordings (ARI)
Flash Operator Panel (FOP)
FreePBX Administration

After I select FreePBX Administration, then I get the error:

FATAL ERROR
DB Error: no such field

Now I get this regardless of whether I type in a password or not. Before the 2.6 update I was able to login no problems. I followed the update instructions to the letter. So this is where I searched GOOGLE and got into trouble, although it didn’t seem to affect anything else as I still couldn’t login in and access the admin console. I also get this error (noticed even in 2.3) when I select Flash Operator Panel (FOP):

Couldn’t load variables.txt?aldope=3486

Your help would be appreciated. Thanks Mikael.

You need to look at your apache configuration in the file /etc/httpd/conf/httpd.conf
Look for the line include probably at the end of that file, if there is an include, then look at that file for any lines like these:

<directory /var/www/html/admin>
AllowOverride all
Options Indexes FollowSymLinks
order allow,deny
allow from all
AuthType Basic
AuthGroupFile /dev/null
AuthName PABX-Administration
AuthMySQLEnable                 On
AuthMySQLHost                   localhost
AuthMySQLDB                     asterisk
AuthMySQLUserTable              ampusers
AuthMySQLUser                   user
AuthMySQLPassword               passw0rd
AuthMySQLNameField              username
AuthMySQLPasswordField          password
AuthMySQLAuthoritative          On
AuthMySQLPwEncryption           none
Require valid-user
</directory>

If you have anything like the above, then change two lines so they are looking like this:

AuthMySQLPasswordField          password_sha1
AuthMySQLPwEncryption           sha1

Mikael

I search the Apache Server configuration file (checked both httpd.conf and httpd.conf.original in /etc/httpd/conf/) on our FREEPBX server and could not find the INCLUDE statement you mention. I scrolled all the way to the bottom. Even tried to look for the following statement in the conf file:

directory /var/www/html/admin
AllowOverride all

But nothing listed. The conf file ends in /VirtualHost and that’s it. Next plan of attack?

What is the EXACT error you get?
Look in the /var/log/httpd/error.log for any errors there and paste the last error here.

Trying to access the FREEPBX ADMINISTRATION http://10.8.1.1/admin/config.php and I get the error:

FATAL ERROR
DB Error: no such field

ERROR_LOG shows:

[Tue Jun 22 11:51:13 2010] [error] [client 10.8.1.79] File does not exist: /var/www/html/favicon.ico, referer: http://10.8.1.1/
[Tue Jun 22 11:51:15 2010] [error] [client 10.8.1.79] PHP Notice: Undefined variable: title in /var/www/html/admin/views/freepbx.php on line 46, referer: http://10.8.1.1/
[Tue Jun 22 11:51:15 2010] [error] [client 10.8.1.79] PHP Notice: Undefined variable: amp_conf in /var/www/html/admin/views/freepbx.php on line 168, referer: http://10.8.1.1/
[Tue Jun 22 11:51:15 2010] [error] [client 10.8.1.79] PHP Notice: Undefined variable: title in /var/www/html/admin/views/freepbx.php on line 46, referer: http://10.8.1.1/
[Tue Jun 22 11:51:15 2010] [error] [client 10.8.1.79] PHP Notice: Undefined variable: amp_conf in /var/www/html/admin/views/freepbx.php on line 168, referer: http://10.8.1.1/

Try to run install_amp --force-version=2.3 and see if that fixes it.

We are now unable to call out and the whole office is down. Now instead of being unable to access the Asterisk Administration Web Gui now we have a dead PBX system. I am now urgently trying to get hold of the people who installed it for us. I am not impressed I thought you would know the consequences of running such a command.

That command should not take down your PBX, it should fix your error.

You have provided very little information about your system. Nowhere have you mentioned that it was a production system. I am not impressed by that.
If you have mentioned that it was a production system my suggestion would have been: “Contact FreePBX paid support”.

I am not a magician, nor a fortune teller.
Based on your previous answers that was the proper way to fix your error.

If Asterisk won’t run I suggest that you check the /var/log/asterisk/full for any errors that show why Asterisk won’t run.

I concur, I have ran that command several times with no ill effect. I would surmise there is more wrong then just a DB error.

I have had that same error and the force install had done the job. Sorry to hear your system is down.

I concur, I have ran that command several times with no ill effect. I would surmise there is more wrong then just a DB error.

I have had that same error and the force install had done the job. Sorry to hear your system is down.

Hi Mikael,

after reading this thread, I too have a similiar problem but understand about the paid support existing, so will not blame anyone for any issues with my system!

I have started a new thread as my message is slighly different;
http://www.freepbx.org/forum/freepbx/installation/upgrading-2-7-to-2-8

My message is as follows :

FATAL ERROR
SELECT value FROM admin WHERE variable = 'version’
DB Error: no such table

Asterisk is functioning 100% okay, I can log into the CLI using the terminal and reload etc… with no errors, its just the admin side too freepbx has failed upon using the upgrade.

I just wanted to recap, you suggested using :

install_amp --force-version=2.3

Can I modify this to :

install_amp --force-version=2.7

to reenstate my previous version of freepbx?

Many thanks

Nick