Cant access management portal



  • Hey all,
    My FOG has been running great for some time. Recently we had some drama on the network (long story!) which meant we have to just turn off FOG asap, no grace nothing, just end the VM. This had to be done due to domain membership changes.

    I have now started the server again with a disabled virtual network card so that I can go in and adjust the AD domain details. unfortunately even going to 127.0.0.1 it wont load the portal. I just get a blank white screen.

    Any thoughts?
    Thanks



  • @sebastian-roth @Tom-Elliott
    Thank you both so much, through a combination of things I have it working. you guys ROCK!

    Thanks again!


  • Developer

    @CoxM Check the line snmysqlpass=... in .fogsettings. That’s the mysql database password. If it is blank leave it like that and change it back to blank in the config.class.php as well.



  • @sebastian-roth
    Hi,
    Sorry for the lack of useful feedback!
    Here are the shots of both files, its worth noting that originally the mysql password in the class.php file was blank. I have since edited.
    1_1518701676498_fog10.JPG 0_1518701676497_fog9.JPG


  • Developer

    @CoxM The message ... Uncaught Error: Call to a member function lastInsertId() ... in the logs most certainly means that the database connection information set in /var/www/fog/lib/fog/config.class.php is not correct and therefore the PHP web UI cannot connect to the database!

    Did you follow Tom’s suggestions on altering/resetting the database passwords (... mysql_native_password ...) as well as comparing the username/password in the mentioned files? Your answer to that was “No luck”. But what did you do and what happened. We can’t really help if we don’t know what exactly you tried and why it did not work from your point of view.



  • This is my current apache2 log
    0_1518694579851_fog8.JPG



  • @tom-elliott
    Hi,
    Have run df -h and have space on all partitions.

    Getting desperate now, need to image some machine for our new users. Any other ideas? What about exporting the Db and reinstalling?

    Just need to find a way back to a working Fog install with my existing Db.
    Thanks,



  • @tom-elliott said in Cant access management portal:

    /var/www/fog/lib/fog/config.class.php

    Thank you, that was the solution to my problem :)



  • @tom-elliott That did not work for me. I even ran the installer after doing the mysql commands.


  • Senior Developer

    You could aire. Though I’d first see what the problem is. What’s the output of df -h



  • @tom-elliott No luck :-(

    is it going to be easier to backup what I have and reinstall? I even have a working snapshot of the server, if I could ensure it using the newer up to date Db then I could roll back?


  • Senior Developer

    @coxm The /var/www/fog/lib/fog/config.class.php DATABASE_PASSWORD line should look like:

    define('DATABASE_PASSWORD', '<whateveryourfogguipasswordishere>');
    

    You may also need to edit the /opt/fog/.fogsettings line with snmysqlpass='' to:

    snmysqlpass='<whateveryourfogguipasswordishere>'
    

  • Senior Developer

    I’m guessing both of you are running Ubuntu?

    Please run through the commands listed here:
    (changing the password field to whatever your mysql password is if you have one set)

    https://forums.fogproject.org/topic/10006/ubuntu-is-fog-s-enemy

    If you have set a mysql password:
    Change the ALTER statements to: (Changing the password between the quotes to whatever your password is)

    ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'password';
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';


  • I am also having the same issue only this occurred after I pulled from git and installed the current version.

    Last few lines of apace2.error.log

    [Wed Feb 14 08:33:00.550232 2018] [mpm_prefork:notice] [pid 10247] AH00169: caught SIGTERM, shutting down
    [Wed Feb 14 08:36:12.661760 2018] [mpm_prefork:notice] [pid 1502] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
    [Wed Feb 14 08:36:12.678333 2018] [core:notice] [pid 1502] AH00094: Command line: '/usr/sbin/apache2'
    [Wed Feb 14 08:56:08.148967 2018] [php7:error] [pid 1503] [client 10.2.1.104:55546] PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/html/fog/lib/db/pdodb.class.php:447\nStack trace:\n#0 /var/www/html/fog/lib/fog/fogcontroller.class.php(460): PDODB->insertId()\n#1 /var/www/html/fog/lib/fog/hookmanager.class.php(63): FOGController->save()\n#2 /var/www/html/fog/lib/fog/fogpage.class.php(219): HookManager->processEvent('PAGES_WITH_OBJE...', Array)\n#3 /var/www/html/fog/lib/pages/schemaupdaterpage.class.php(39): FOGPage->__construct('')\n#4 /var/www/html/fog/lib/fog/fogpagemanager.class.php(381): SchemaUpdaterPage->__construct()\n#5 [internal function]: FOGPageManager->{closure}('/var/www/html/f...')\n#6 /var/www/html/fog/lib/fog/fogpagemanager.class.php(386): array_map(Object(Closure), Array)\n#7 /var/www/html/fog/lib/fog/fogpagemanager.class.php(79): FOGPageManager->loadPageClasses()\n#8 [internal function]: FOGPageManager->__construct()\n#9 /var/www/html/fog/lib/fog/fogbase.class.php(481): ReflectionClass->newInstanceArgs(Array)\n#10 /var/www/html/fog/management/index.php(2 in /var/www/html/fog/lib/db/pdodb.class.php on line 447, referer: http://10.1.0.54/fog/management/index.php?node=service
    [Wed Feb 14 08:56:48.476628 2018] [php7:error] [pid 1506] [client 10.2.10.151:52335] PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/html/fog/lib/db/pdodb.class.php:447\nStack trace:\n#0 /var/www/html/fog/lib/fog/fogcontroller.class.php(460): PDODB->insertId()\n#1 /var/www/html/fog/lib/fog/hookmanager.class.php(63): FOGController->save()\n#2 /var/www/html/fog/lib/fog/fogpage.class.php(219): HookManager->processEvent('PAGES_WITH_OBJE...', Array)\n#3 /var/www/html/fog/lib/pages/schemaupdaterpage.class.php(39): FOGPage->__construct('')\n#4 /var/www/html/fog/lib/fog/fogpagemanager.class.php(381): SchemaUpdaterPage->__construct()\n#5 [internal function]: FOGPageManager->{closure}('/var/www/html/f...')\n#6 /var/www/html/fog/lib/fog/fogpagemanager.class.php(386): array_map(Object(Closure), Array)\n#7 /var/www/html/fog/lib/fog/fogpagemanager.class.php(79): FOGPageManager->loadPageClasses()\n#8 [internal function]: FOGPageManager->__construct()\n#9 /var/www/html/fog/lib/fog/fogbase.class.php(481): ReflectionClass->newInstanceArgs(Array)\n#10 /var/www/html/fog/management/index.php(2 in /var/www/html/fog/lib/db/pdodb.class.php on line 447
    [Wed Feb 14 09:04:34.614871 2018] [php7:error] [pid 3522] [client 10.2.1.104:55764] PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/html/fog/lib/db/pdodb.class.php:447\nStack trace:\n#0 /var/www/html/fog/lib/fog/fogcontroller.class.php(460): PDODB->insertId()\n#1 /var/www/html/fog/lib/fog/hookmanager.class.php(63): FOGController->save()\n#2 /var/www/html/fog/lib/fog/fogpage.class.php(219): HookManager->processEvent('PAGES_WITH_OBJE...', Array)\n#3 /var/www/html/fog/lib/pages/schemaupdaterpage.class.php(39): FOGPage->__construct('')\n#4 /var/www/html/fog/lib/fog/fogpagemanager.class.php(381): SchemaUpdaterPage->__construct()\n#5 [internal function]: FOGPageManager->{closure}('/var/www/html/f...')\n#6 /var/www/html/fog/lib/fog/fogpagemanager.class.php(386): array_map(Object(Closure), Array)\n#7 /var/www/html/fog/lib/fog/fogpagemanager.class.php(79): FOGPageManager->loadPageClasses()\n#8 [internal function]: FOGPageManager->__construct()\n#9 /var/www/html/fog/lib/fog/fogbase.class.php(481): ReflectionClass->newInstanceArgs(Array)\n#10 /var/www/html/fog/management/index.php(2 in /var/www/html/fog/lib/db/pdodb.class.php on line 447
    

    Ubuntu 16.04 server



  • @sebastian-roth this is what I get, still in the mysql prompt use the fog database and get status
    0_1518622903325_fog7.JPG



  • @sebastian-roth
    This is what happens when using the username “root” and the same password as I would use to log into the fog web ui
    0_1518622322448_fog6.JPG



  • @sebastian-roth Thanks. I did have some issues with username and password matching when configuring a new storage node but it still worked after that.

    I can see in .fogsettings I have the username and password field which appears to be what I use to login to the fog web ui. then there is snmysqluser, snmysqlpass and snmysqlhost. currently thats “root”, blank and “localhost”. Is that correct?

    Any further guidance this would be amazing.

    Thanks,

    Matt


  • Developer

    @CoxM Those all need to match up! .fogsettings is what the installer uses, config.class.php is used by the web UI… (and should be generated by the installer).



  • @sebastian-roth ok cool, that makes sense. Where can I take the correct sql credentials from? .fogsettings?

    Thanks,

    Matt


  • Developer

    @CoxM But from the apache error look it seems like the mysql connection information (username, password) do not match. Check /opt/fog/.fogsettings plus /var/www/fog/lib/fog/config.class.php for mysql connection info. Then try to connect to the database using the command line tool as described in the wiki page to see if the credentials are correct.


 

544
Online

41.9k
Users

12.4k
Topics

116.8k
Posts