Update failure - Call to a member function getUserByUsername() on a non-object

[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4408
Server version: 5.1.73 Source distribution

Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

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 userman_directories;
±—±-----------------------±--------±-------±------±--------±-------+
| id | name | driver | active | order | default | locked |
±—±-----------------------±--------±-------±------±--------±-------+
| 1 | PBX Internal Directory | Freepbx | 1 | 5 | 1 | 0 |
±—±-----------------------±--------±-------±------±--------±-------+
1 row in set (0.00 sec)

mysql> select username,auth from userman_users;
±---------±--------+
| username | auth |
±---------±--------+
| 301 | freepbx |
| 302 | freepbx |
| 303 | freepbx |
| 304 | freepbx |
| 305 | freepbx |
| 306 | freepbx |
| 307 | freepbx |
| 308 | freepbx |
| 309 | freepbx |
| 310 | freepbx |
| 311 | freepbx |
| 312 | freepbx |
| 313 | freepbx |
| 314 | freepbx |
| 315 | freepbx |
| 321 | freepbx |
| 327 | freepbx |
| 331 | freepbx |
| 351 | freepbx |
| 355 | freepbx |
| 356 | freepbx |
| 357 | freepbx |
| 360 | freepbx |
| 361 | freepbx |
| 363 | freepbx |
| 365 | freepbx |
| 366 | freepbx |
| 367 | freepbx |
| 369 | freepbx |
| 370 | freepbx |
| 374 | freepbx |
| 376 | freepbx |
| 378 | freepbx |
| 381 | freepbx |
| 386 | freepbx |
| 389 | freepbx |
| 390 | freepbx |
| 399 | freepbx |
±---------±--------+
38 rows in set (0.01 sec)

mysql>

1 Like

fwconsole ma downloadinstall userman

then run the commands for mysql above again and lets see where we stand

1 Like

[root@localhost ~]# fwconsole ma downloadinstall userman
No repos specified, using: [standard,extended,unsupported,commercial] from last GUI settings

Starting userman download…
Processing userman
Verifying local module download…Verified
Extracting…Done
Module userman successfully downloaded
Generating CSS…Done
Module userman successfully installed
Updating Hooks…Done
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4480
Server version: 5.1.73 Source distribution

Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

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 userman_directories;
±—±-----------------------±--------±-------±------±--------±-------+
| id | name | driver | active | order | default | locked |
±—±-----------------------±--------±-------±------±--------±-------+
| 1 | PBX Internal Directory | Freepbx | 1 | 5 | 1 | 0 |
±—±-----------------------±--------±-------±------±--------±-------+
1 row in set (0.00 sec)

mysql> select username,auth from userman_users;
±---------±--------+
| username | auth |
±---------±--------+
| 301 | freepbx |
| 302 | freepbx |
| 303 | freepbx |
| 304 | freepbx |
| 305 | freepbx |
| 306 | freepbx |
| 307 | freepbx |
| 308 | freepbx |
| 309 | freepbx |
| 310 | freepbx |
| 311 | freepbx |
| 312 | freepbx |
| 313 | freepbx |
| 314 | freepbx |
| 315 | freepbx |
| 321 | freepbx |
| 327 | freepbx |
| 331 | freepbx |
| 351 | freepbx |
| 355 | freepbx |
| 356 | freepbx |
| 357 | freepbx |
| 360 | freepbx |
| 361 | freepbx |
| 363 | freepbx |
| 365 | freepbx |
| 366 | freepbx |
| 367 | freepbx |
| 369 | freepbx |
| 370 | freepbx |
| 374 | freepbx |
| 376 | freepbx |
| 378 | freepbx |
| 381 | freepbx |
| 386 | freepbx |
| 389 | freepbx |
| 390 | freepbx |
| 399 | freepbx |
±---------±--------+
38 rows in set (0.00 sec)

mysql>

Ok in mysql can you run

SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP '^[A-Za-z]+$'

Return the result for me

mysql> SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP ‘^[A-Za-z]+$’
->

SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP '^[A-Za-z]+$';

mysql> SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP ‘^[A-Za-z]+$’
-> SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP ‘^[A-Za-z]+$’;
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 ‘SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP ‘^[A-Za-z]+$’’ at line 2
mysql> SELECT DISTINCT auth FROM userman_users WHERE auth REGEXP ‘^[A-Za-z]+$’;
±--------+
| auth |
±--------+
| freepbx |
±--------+
1 row in set (0.02 sec)

mysql>

ok now try

fwconsole ma upgrade userman

Then go back to mysql

mysql
use asterisk;
select username,auth from userman_users;

mysql> exit
Bye
[root@localhost ~]# fwconsole ma upgrade userman
No repos specified, using: [standard,extended,unsupported,commercial] from last GUI settings

Starting userman download…
Processing userman
Downloading…
217594/217594 [============================] 100%
Finished downloading
Extracting…Done
Module userman successfully downloaded
Generating CSS…Done
Module userman successfully installed
Updating Hooks…Done
Updating Hooks…Done
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4802
Server version: 5.1.73 Source distribution

Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

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,auth from userman_users;
±---------±-----+
| username | auth |
±---------±-----+
| 301 | 2 |
| 302 | 2 |
| 303 | 2 |
| 304 | 2 |
| 305 | 2 |
| 306 | 2 |
| 307 | 2 |
| 308 | 2 |
| 309 | 2 |
| 310 | 2 |
| 311 | 2 |
| 312 | 2 |
| 313 | 2 |
| 314 | 2 |
| 315 | 2 |
| 321 | 2 |
| 327 | 2 |
| 331 | 2 |
| 351 | 2 |
| 355 | 2 |
| 356 | 2 |
| 357 | 2 |
| 360 | 2 |
| 361 | 2 |
| 363 | 2 |
| 365 | 2 |
| 366 | 2 |
| 367 | 2 |
| 369 | 2 |
| 370 | 2 |
| 374 | 2 |
| 376 | 2 |
| 378 | 2 |
| 381 | 2 |
| 386 | 2 |
| 389 | 2 |
| 390 | 2 |
| 399 | 2 |
±---------±-----+
38 rows in set (0.00 sec)

mysql>

Now I see the users under userman and also see the imported freepbx directory, I can also go to an extension and see the users details which I could not before.

Yes I applied a fix so you should be good to go

Thank you so much for your help. I truly appreciate it Andrew !!! Dave

I’ve had this issue for a few months now but the system is working fine so I left it alone until I have time to fix it.

When I login to the server I go straight to the:

“Whoops \ Exception \ ErrorException (E_ERROR)
HELP
Call to a member function getUserByUsername() on a non-object”

So I tried to login using PuTTY but it will not recognize my password. So I’m stuck here. Any suggestions?