Jump to content

Recommended Posts

Posted

Hello,

 

Please can someone help me...

 

I'm new to Ubuntu, but have used FOG in my previous job, I'm now trying to set up a new FOG server in my new workplace to make the deployment of images etc a lot quicker...

 

I've installed Ubuntu 16.04 LTS, set an IP Address, downloaded FOG_1.3.4, installed it via terminal.

 

Following a YouTube video online, it says 'is the My SQL password blank [y/n]', i select no, the same as the video, which worked in my previous job...

 

FOG installs, etc, i get the message:

 

'You still need to install/update your database schema.

This can be done by opening a web browser and going to:

 

http://**.**.**.***/fog/management

 

I type in the URL and get an error:

 

The 10.31.97.240 page isn’t working

 

10.31.97.240 is currently unable to handle this request.

HTTP ERROR 500

 

Please help me, I need the server setup as quick as possible.

 

TIA

 

Dan

Posted (edited)

I got this error on a fresh install on Debian over the weekend, the error in /var/log/apache2/error.log said:

PHP Fatal error: Call to a member function errorCode() on null in /var/www/html/fog/lib/db/pdodb.class.php on line 412

I edited the pdodb.class.php like so:

public function sqlerror()    
{
       $msg = '';
       if (self::$_link) {
		if (self::$_queryResult) {			// ***ADDED THIS LINE ***
           if (self::$_queryResult->errorCode()) {
               $errCode = self::$_queryResult->errorCode();
               $errInfo = self::$_queryResult->errorInfo();
               $this->errorCode = $errInfo[1];
           }
           if ($errCode !== '00000') {
               $msg = sprintf(
                   '%s: %s, %s: %s, %s: %s',
                   _('Error Code'),
                   json_encode($errCode),
                   _('Error Message'),
                   json_encode($errInfo),
                   _('Debug'),
                   self::_debugDumpParams()
               );
           }
		} 					// ** ADDED THIS LINE **
       } else { 
          $msg = _('Cannot connect to database'); 
          self::$_link = false; 
      } 
      return $msg; 
  }

...and then refreshed the browser and it carried on, at a guess it was unable to get a database error because the database doesn't exist (even though the page is attempting to create the database).

Edited by Katy
I can't get it to like the newlines in the code block :(
Posted
I'd reinstall FOG and select y at that prompt and put in a password - make a note of it. I remember having to manually add it a php file:

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

 

Hi,

 

Thanks for your message, I've managed to get that bit sorted out now, however I'm now getting an error message about the database/schema. I've checked the config files and the information is identical to the below:

 

private static function db_settings() {

define('DATABASE_TYPE','mysql'); // mysql or oracle

define('DATABASE_HOST','');

define('DATABASE_NAME','fog');

define('DATABASE_USERNAME','');

define('DATABASE_PASSWORD',"");

 

 

Mine has the information filled out, including the username and password for the DATABASE.

 

Please help, I don't want to have to re-install FOG again, this will be the third time installing it again.

 

Thanks,

 

Dan

  • 1 month later...
Posted

[Thu Mar 02 19:06:29.801513 2017] [mpm_event:notice] [pid5397:tid 139973505230720] AH00489: Apache/2.4.25 (Ubuntu) configured --resuming normal operations

[Thu Mar 02 19:06:29.801622 2017] [core:notice] [pid5397:tid 139973505230720] AH00094: Command line: '/usr/sbin/apache2'

[Thu Mar 02 19:07:21.464275 2017] [mpm_event:notice] [pid5397:tid 139973505230720] AH00491: caught SIGTERM, shutting down

[Thu Mar 02 19:07:21.548520 2017] [mpm_prefork:notice] [pid14875] AH00163: Apache/2.4.25 (Ubuntu) configured -- resuming normal operations

[Thu Mar 02 19:07:21.548615 2017] [core:notice] [pid 14875]AH00094: Command line: '/usr/sbin/apache2'

[Thu Mar 02 19:07:21.810699 2017] [mpm_prefork:notice] [pid14875] AH00169: caught SIGTERM, shutting down

[Thu Mar 02 19:07:21.950419 2017] [mpm_prefork:notice] [pid14947] AH00163: Apache/2.4.25 (Ubuntu) configured -- resuming normal operations

[Thu Mar 02 19:07:21.950484 2017] [core:notice] [pid 14947]AH00094: Command line: '/usr/sbin/apache2'

[Thu Mar 02 19:14:05.840829 2017] [mpm_prefork:notice] [pid14947] AH00169: caught SIGTERM, shutting down

[Thu Mar 02 19:14:51.536835 2017] [mpm_prefork:notice] [pid4888] AH00163: Apache/2.4.25 (Ubuntu) OpenSSL/1.0.2k configured -- resumingnormal operations

[Thu Mar 02 19:14:51.536900 2017] [core:notice] [pid 4888]AH00094: Command line: '/usr/sbin/apache2'

[Thu Mar 02 19:15:01.472851 2017] [php7:error] [pid 4890][client 192.168.0.13:48100] PHP Fatal error: Uncaught Error: Call to a member function errorCode() on null in/var/www/fog/lib/db/pdodb.class.php:412\nStack trace:\n#0/var/www/fog/lib/db/pdodb.class.php(227): PDODB->sqlerror()\n#1/var/www/fog/lib/db/pdodb.class.php(168): PDODB::currentDb(Object(PDODB))\n#2/var/www/fog/lib/db/pdodb.class.php(177): PDODB->_connect(false)\n#3/var/www/fog/lib/db/pdodb.class.php(100): PDODB->_connect()\n#4/var/www/fog/lib/db/databasemanager.class.php(43): PDODB->__construct()\n#5/var/www/fog/lib/fog/loadglobals.class.php(42): DatabaseManager->establish()\n#6/var/www/fog/lib/fog/loadglobals.class.php(79): LoadGlobals::_init()\n#7/var/www/fog/commons/base.inc.php(49): LoadGlobals->__construct()\n#8/var/www/fog/management/index.php(22): require('/var/www/fog/co...')\n#9{main}\n thrown in /var/www/fog/lib/db/pdodb.class.phpon line 412

[Thu Mar 02 19:20:28.140331 2017] [php7:error] [pid 4892][client 192.168.0.13:48116] PHP Fatal error: Uncaught Error: Call to a member function errorCode() on null in/var/www/fog/lib/db/pdodb.class.php:412\nStack trace:\n#0/var/www/fog/lib/db/pdodb.class.php(227): PDODB->sqlerror()\n#1/var/www/fog/lib/db/pdodb.class.php(168): PDODB::currentDb(Object(PDODB))\n#2/var/www/fog/lib/db/pdodb.class.php(177): PDODB->_connect(false)\n#3/var/www/fog/lib/db/pdodb.class.php(100): PDODB->_connect()\n#4/var/www/fog/lib/db/databasemanager.class.php(43): PDODB->__construct()\n#5/var/www/fog/lib/fog/loadglobals.class.php(42):DatabaseManager->establish()\n#6/var/www/fog/lib/fog/loadglobals.class.php(79): LoadGlobals::_init()\n#7/var/www/fog/commons/base.inc.php(49): LoadGlobals->__construct()\n#8/var/www/fog/management/index.php(22): require('/var/www/fog/co...')\n#9{main}\n thrown in/var/www/fog/lib/db/pdodb.class.php on line 412, referer: http://192.168.0.13/

 

please what needs editing In the code?

 

I can't open the ip/fog/management

 

Posted

As daft as it sounds, try and install version 1.2.0, and then once that works, install 1.3.4 over the top, and it should work.

 

I've sent you a PM back Jamie, I'll have a look tonight and help you get it working.

 

Thanks,

 

Dan

Posted
On Ubuntu 16.04 there are some known issues. I found grabbing the dev branch from git to be the most reliable (and relatively quick) way to build a working version although you may run into issues with the DB credentials (the fix is then to manually set them in the config files).
Posted

It is quite strange . When you get to the next step with the below error what next as it is not allowing me to go forward

 

Database Schema Installer / Updater

Your database connection appears to be invalid. FOG is unable to communicate with the database. There are many reasons why this could be the case. Please check your credentials in /var/www/html/fog/lib/fog/config.class.php. Also confirm that the database is indeed running. If credentials are correct, and if the Database service is running, check to ensure your filesystem has enough space.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...