FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.1k stars 221 forks source link

List Host Route throwing 500 - Missing Function get #493

Closed jetbalsa closed 1 year ago

jetbalsa commented 1 year ago

Using Dev-Master, New Install on Debian 11, PHP 7.4.30

[Tue Sep 20 12:10:22.170649 2022] [proxy_fcgi:error] [pid 59786] [client 10.162.1.45:1891] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to a member function get() on null in /var/www/fog/lib/router/route.class.php:1259
Stack trace:
#0 /var/www/fog/lib/router/route.class.php(488): Route::getter()
#1 /var/www/fog/lib/fog/fogpage.class.php(492): Route::listem()
#2 /var/www/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->index()
#3 /var/www/fog/management/index.php(58): FOGPageManager->render()
#4 {main}\n  thrown in /var/www/fog/lib/router/route.class.php on line 1259', referer: http://10.162.1.201/fog/management/index.php?node=host
Sebastian-Roth commented 1 year ago

@jetbalsa said:

Using Dev-Master, New Install on Debian 11, PHP 7.4.30

I suppose you mean dev-branch. Looking at the code lines posted I can confirm but just wanna make sure.

I have tried to replicate the issue along the stack trace posted but I am not able to. I find this very strange because in line 1259 in route.class.php it tries to access the hosts' "hostscreen" information which is stored in another table in the database. But even if that table is empty or non-existent (dropped mine on a test setup) I never get to the point where it fails exactly the way it does for you ("Call to a member function get() on null ...").

Is this a fresh install or have you been this setup for a while and it started playing up? How many hosts do you have in your list (roughly)?

Do you have screen settings in your database? Best to check using mysql command line - grab DB credentials from /var/www/fog/lib/fog/config.class.php:

shell> mysql -u fogmaster -p
Password:
...
mysql> use fog;
...
mysql> SELECT * FROM hostScreenSettings;
...
mysql> quit
jetbalsa commented 1 year ago

Semi Fresh Install, had about 30 hosts into quickdeployed into the database, all where in one group with one image

I fellback to Stable on Ubuntu 20.04 to get a install going. And yes, it was devbranch

Anything that tried to view the hosts table would just bail, Group hosts lists and Main Host lists would throw 500s

Sebastian-Roth commented 1 year ago

@jetbalsa Did you wipe the server that had that issue or is it still around. I still can't reproduce the issue as described and think it's not a general problem.

Sebastian-Roth commented 1 year ago

@jetbalsa Did you get to look into this again? Should we keep the issue open?

Sebastian-Roth commented 1 year ago

@jetbalsa Will close this issue now as we don't have any further evidence this is a general code issue. Please let us know if you run into this again and we'll investigate further.