Can access gui after upgrade to freepbx 2.7

after upgrade I get this error while access freepbx

FATAL ERROR
SELECT username, password_sha1, extension_low, extension_high, deptname, sections FROM ampusers WHERE username = 'asteriskuser’
DB Error: no such field

any suggestions.

Wasn’t broke shouldnt have fixed…lesson learned!!!

http://www.freepbx.org/forum/freepbx/beta-program-issues/warning-fonicaprojects-and-2-6-upgrade-tool-use-with-caution-fix-i

mickecarlsson,

I don’t think that is the issue. IIRC the only issue with Fonica is that they point apache at the old table which of course breaks it since the password field is no longer there in place of password_sha1.

In his case, it appears that the table was never converted so it is still password and not password_sha1.

In order to get the migration code to trigger and fix this, you probably need to “re-upgrade” from the tarball and make sure to put in something like --force-version=2.5.0 to make sure to run through the migration code for that table. (I believe it was after 2.5.0 that changed, if I am mistaken, maybe it needs 2.4.0 there…)

[size=30][color=#FF0000]NOTE!![/color][/size] There was an error in the update statement below. I have corrected the statement to the correct value.

OK, thanks philippe, I did not read the question enough.
tbooth, I think that you can do this:

Step 1
Start a shell and type the following (change passw0rd to whatever your password to mysql is):

mysql -u root -ppassw0rd
use asterisk;
ALTER TABLE ampusers CHANGE COLUMN password password_sha1 varchar(40);
UPDATE ampusers SET password_sha1 = 'd033e22ae348aeb5660fc2140aec35850c4da997' where username='admin';

Now you can login to FreePBX with your username and the password ‘admin’.

I know enough about linux to be dangerous. If someone has time can you explain in detail exactly what I need to do to fix this, I only have access with putty now.

Mikael

I get this error when issue that command.

login as: root
[email protected]’s password:
Last login: Tue Apr 20 15:29:24 2010 from 192.168.1.22

Welcome to Elastix

For access to the Elastix web GUI use this URL
http://192.168.1.150

[root@elastix ~]# mysql -u root -ppassw0rd
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
[root@elastix ~]#

Try eLaStIx.2oo7

Just run the commands that I listed in my last reply and you should be able to login.

SUCCESS! Thank you for your help and PATIENCE

If I’m not mistaken, you can use your database credentials to login, the same ones that are set in amportal.conf.

Alternatively take off database authentication and then modify the user info from the GUI and put it back on.

However, this may be all fine to get your login back but if the migration did not run then what else didn’t run that might be broken?

This is why you are much better off, once you get access now that you have “corrupted” the ampusers table, to do as I mentioned above and run the install_amp installation with the --force-version to force any migrations that did not run for what ever reason.

I’m still a little confused, this is my screen:

[root@elastix ~]# mysql -u root -peLaStIx.2oo7
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 163
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

Let me explain further.
I can log into the elastix gui and all the tabs work with the exception of the PBX tab. I get this error:
FATAL ERROR
SELECT username, password_sha1, extension_low, extension_high, deptname, sections FROM ampusers WHERE username = 'admin’
DB Error: no such field

If I try to bypass elastix and go straight to freebx at 192.168.1.150/admin I get the same error.

Yes, that is why you should do this also:

mysql -u root -peLaStIx.2oo7
use asterisk;
ALTER TABLE ampusers CHANGE COLUMN password password_sha1 varchar(40);
UPDATE ampusers SET password_sha1 = 'd033e22ae348aeb5660fc2140aec35850c4da997' where username='admin';

yes, but is this done at
mysql> ???

OK, that worked but what did I just change the freepbx login to?

I tried admin…admin
and maint…password and neither worked

Thanks for you help.

It should be user admin with password admin.
sha1 for admin is d033e22ae348aeb5660fc2140aec35850c4da997

Could you type this:

mysql -u root -peLaStIx.2oo7
use asterisk;
select username, password_sha1 from ampusers;

Check that there is a long string in the password_sha1 field for all users.

user admin password admin does not work. Here is the screen.
Welcome to Elastix

For access to the Elastix web GUI use this URL
http://192.168.1.150

[root@elastix ~]# mysql -u root -peLaStIx.2oo7
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 181
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

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 username, password_sha1 from ampusers;
±---------±---------------------+
| username | password_sha1 |
±---------±---------------------+
| admin | d033e22ae348aeb5660f |
±---------±---------------------+
1 row in set (0.00 sec)

mysql>

NOTE!. Post edited afterwards to correct typo.

Well, that password is wrong, it is to short.
Do this again:

mysql -u root -peLaStIx.2oo7
use asterisk;
ALTER TABLE ampusers MODIFY password_sha1 varchar(40);
UPDATE ampusers SET password_sha1 = 'd033e22ae348aeb5660fc2140aec35850c4da997' where username='admin';

Then verify that the password is changed by doing:

select username, password_sha1 from ampusers;

The output should be:

+----------+------------------------------------------+
| username | password_sha1                            |
+----------+------------------------------------------+
| admin    | d033e22ae348aeb5660fc2140aec35850c4da997 |
+----------+------------------------------------------+
1 row in set (0.00 sec)

There was an error in my previous post that shortened the password field to 20 character, update it by follow the above.

looks like it still comes up short.

[root@elastix ~]# mysql -u root -peLaStIx.2oo7
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 182
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

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> ALTER TABLE ampusers CHANGE COLUMN password password_sha1 varchar(40);
ERROR 1054 (42S22): Unknown column ‘password’ in 'ampusers’
mysql> UPDATE ampusers SET password_sha1 = ‘d033e22ae348aeb5660fc2140aec35850c4da997’ where username=‘admin’;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 1

mysql> select username, password_sha1 from ampusers;
±---------±---------------------+
| username | password_sha1 |
±---------±---------------------+
| admin | d033e22ae348aeb5660f |
±---------±---------------------+
1 row in set (0.00 sec)

mysql>

OK, looks like I am a little tired, bear with me :slight_smile:

mysql -u root -peLaStIx.2oo7
use asterisk;
ALTER TABLE ampusers MODIFY password_sha1 varchar(40);
UPDATE ampusers SET password_sha1 = 'd033e22ae348aeb5660fc2140aec35850c4da997' where username='admin';

No problem, I appreciate your help. Should I run the command on your last reply or wait to hear from you. I could give you ssh access if needed.