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!!!
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.
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.
[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.
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';
[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)
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.
[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
mysql -u root -peLaStIx.2oo7
use asterisk;
ALTER TABLE ampusers MODIFY password_sha1 varchar(40);
UPDATE ampusers SET password_sha1 = 'd033e22ae348aeb5660fc2140aec35850c4da997' where username='admin';