UNSOLVED Backing up database... failed!

  • Server
    • FOG Version: 1.4.3
    • OS: Ubuntu 16.04.2 LTS

    I am trying to setup a FOG server in an AWS EC2 instance. I got to the point in the install where it was “ensuring that node username and passwords match”, and it just hung there.

    I then decided to restart the installer, and ever since then I get to “Backing up database” which fails after a long period of time.

    I followed this: https://forums.fogproject.org/topic/10126/ensuring-node-username-and-passwords-match for my initial problem, but that hasn’t helped.

    I have both commented out the two lines referred here: https://forums.fogproject.org/topic/8358/problem-updating-fog-backing-up-database-failed/26 and tried making the snmysqlhost blank, but that has not worked.

    Another forum thread (https://forums.fogproject.org/topic/6097/backing-up-database-failed) said that the “backing up database” issue may be due to the existence of a proxy server. I use an elastic IP on the EC2 instance, which may be a proxy server, but I’m not sure what syntax to use in the configurations mentioned in the thread.

    Other than than FOG works perfectly fine. I successfully imaged a machine at my workplace to a storage node at the work place using tasks issued by the EC2 server. It’s just a matter of getting the database working properly. I was even able to register the host machine via FOG’s Full Host Registration, so it seems as though that part of the database updating is done successfully.

    UPDATE: Ran installer for 1.4.4, still did not work.

    UPDATE: Apache error log appears to throw this error every time I run the installer: http://i.imgur.com/dx2Lanw.png
    I have no idea what the “client” IP in that error is referring to, nor do I recognize the IP address.

    UPDATE: Tried ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘’; but that didn’t work. Replacing ‘localhost’ with ‘’ throws “Operation ALTER USER failed for ‘root’@‘’”

    UPDATE: Configured /etc/wgetrc with:

    https_proxy =
    http_proxy =
    ftp_proxy =
    use_proxy = on
    no_proxy = "localhost"

    Got to point in install where I had to go to FOG_SERVER_IP/fog/management to update database schema. The prompt didn’t show up to update the schema, so I continued with the install. The install finished, however it still fails to update the database during imaging, throwing the error: Error returned: Type: 8, File: /var/www/fog/lib/fog/fogcontroller.class.php, Line: 1046, Message: Undefined offset: 3, Host, Username: fogstorage

  • @natefog There was a recent thread on that topic… Read through this thread: https://forums.fogproject.org/topic/10712/upgrade-to-debian-9

  • @wayne-workman

    Should have known, php7, ugh. I tried earlier following a few forum posts on updating the references to php5 to 7, but they didn’t seem applicable to what I had going on, but apparently not.

    I found another thread where you gave some steps on how to deal with this, so I’m going to try those: https://forums.fogproject.org/topic/7131/fog-on-ubuntu-16-04-php7/26

    [Thu Sep 07 12:14:41.291700 2017] [php7:error] [pid 7562] [client] PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/html/fog/lib/db/pdodb.class.php:443\nStack trace:\n#0 /var/www/html/fog/lib/fog/fogcontroller.class.php(527): PDODB->insertId()\n#1 /var/www/html/fog/lib/fog/hookmanager.class.php(59): FOGController->save()\n#2 /var/www/html/fog/lib/fog/reportmaker.class.php(75): HookManager->processEvent('REPORT_TYPES', Array)\n#3 [internal function]: ReportMaker->__construct()\n#4 /var/www/html/fog/lib/fog/fogbase.class.php(457): ReflectionClass->newInstanceArgs(Array)\n#5 /var/www/html/fog/maintenance/backup_db.php(23): FOGBase::getClass('ReportMaker')\n#6 {main}\n  thrown in /var/www/html/fog/lib/db/pdodb.class.php on line 443

  • @natefog check the apache error log, it’s here: /var/log/apache2/error something.

  • Anyone get this working? I’m having the same issue when trying to upgrade to the latest stable release v1.4.4, although my instance is local (and am using the wiki installation guide).

    I’ve upgraded FOG a few times before with the same method in the past and never had an issue, but now I’m getting the backup database error message (what’s up with the two front slashes?). I tried using the ignore error switch (-X), but when it asks me to go to the website to update the schema and I’m just getting a -500 error.

    A point in any direction would be great as I’ve been playing around with various posts ideas for about an hour and haven’t had any luck. I’m running ubuntu 16.04 lts with php 7.1.

    Backing up database.........................................Failed!
    ##above is last line from install script, below is last part of the error log
    Sep 07 11:06:09 BHAMFOG01 systemd[1]: Started The PHP 7.1 FastCGI Process Manager.
    --2017-09-07 11:06:11--
    Connecting to connected.
    HTTP request sent, awaiting response... 302 Found
    Could not parse String-Transport-Security header
    Location: ?node=schema [following]
    --2017-09-07 11:06:11--
    Connecting to connected.
    HTTP request sent, awaiting response... 500 Internal Server Error
    2017-09-07 11:06:11 ERROR 500: Internal Server Error.

    Thanks for everything so far, I love this project and due to the wiki and forums have been fairly self-sufficient thus far, but this one has me scratching my head.

  • Moderator

    @Benjamin_D said in Backing up database... failed!:

    UPDATE: Configured /etc/wgetrc with:
    https_proxy =
    http_proxy =
    ftp_proxy =

    use_proxy = on
    no_proxy = “localhost”

    You could update your bashrc or what ever the linux profile script is on your OS with

    export http_proxy=http://<proxy_ip>:<proxy_port>
    export https_proxy=http://<proxy_ip>:<proxy_port>
    export ftp_proxy=http://<proxy_ip>:<proxy_port>
    export no_proxy=,<fog_server_ip>

    Log out and back in to have these profile settings stick.

    I also noted in your example you use https for your proxy, is this a requirement of your proxy server. This is not a standard for proxy servers.

  • I would recommend deleting that instance, and starting over. This time, follow an installation guide: https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals

    I would recommend CentOS 7 or Debian 8, but use whatever you want.