Backing up database failed!


  • Testers

    Server
    • FOG Version: 1.4
    • OS: Ubuntu 16.04
    Client
    • Service Version:
    • OS:
    Description

    Trying to update to latest rev 6069 and server failing on Backing up database
    Storage nodes updated fine.


  • Testers

    ISSUE RESOLVED By following this

    TLDR; Rerun the fog installer if you have lost “Database Connectivity” to your fog server, or run the ALTER USER syntax shown below.

    So Ubuntu 16, among others I suppose, enable a “security updates” to be applied automatically as a “default” to things. Why, well it makes it simpler to ensure your Ubuntu systems are in compliance and patched for any potential exploits. This causes unknown and unexpected issues.

    I figured it’d be a safe thing to express that there could be problems (as many of you have already experienced) that when these updates go up (with or without your knowledge) it can break functionality in unexpected and inopportune ways.

    The quickest fix is to simply rerun the fog installer which should correct the problem.

    As a note, it seems this problem is specific only when the mysql account is the ‘root’ user AND the password is blank.

    The “fix” if you must do it manually is to open a terminal and obtain root:
    Super (Windows Key) + T then sudo -i (in most cases).

    From there, open mysql with mysql -u root

    NOTE: MySQL MUST be run with ROOT.

    Run:

    ALTER USER ‘root’@‘127.0.0.1’ IDENTIFIED WITH mysql_native_password BY ‘’; AND
    ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘’;

    It’s okay if one of them fails. This is going to fix Most people’s issues.

    I would highly recommend removing the unattended-upgrades as many of these “sudden” issues came as a security patch ubuntu pushed out. By default Ubuntu typically set’s this for you as enabled and it can cause havoc on you as you (the admin) may not have “done” anything.

    To prevent this problem from happening in the future you could run:

    apt-get -y remove unattended-upgrades (AS Root again).


  • Testers

    @Tom-Elliott

    /var/www/fog/lib/db/pdodb.class.php on line 443
    [Wed May 17 08:57:07.443665 2017] [php7:error] [pid 5575] [client 10.24.32.13:12086] PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/fog/lib/db/pdodb.class.php:443\nStack trace:\n#0 /var/www/fog/lib/fog/fogcontroller.class.php(527): PDODB->insertId()\n#1 /var/www/fog/lib/fog/hookmanager.class.php(176): FOGController->save()\n#2 /var/www/fog/lib/fog/bootmenu.class.php(1123): HookManager->processEvent('IPXE_EDIT', Array)\n#3 /var/www/fog/lib/fog/bootmenu.class.php(197): BootMenu->_parseMe(Array)\n#4 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#5 {main}\n  thrown in /var/www/fog/lib/db/pdodb.class.php on line 443
    [Wed May 17 08:57:21.302992 2017] [php7:error] [pid 4287] [client 10.24.32.175:65253] PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/fog/lib/db/pdodb.class.php:443\nStack trace:\n#0 /var/www/fog/lib/fog/fogcontroller.class.php(527): PDODB->insertId()\n#1 /var/www/fog/lib/fog/hookmanager.class.php(176): FOGController->save()\n#2 /var/www/fog/lib/fog/bootmenu.class.php(1123): HookManager->processEvent('IPXE_EDIT', Array)\n#3 /var/www/fog/lib/fog/bootmenu.class.php(197): BootMenu->_parseMe(Array)\n#4 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#5 {main}\n  thrown in /var/www/fog/lib/db/pdodb.class.php on line 443
    

  • Testers

    @Tom-Elliott

    /usr/bin/lsb_release
    /bin/systemctl
    /opt/fog/.fogsettings
    Reading package lists...
    Building dependency tree...
    Reading state information...
    software-properties-common is already the newest version (0.96.20.7).
    python-software-properties is already the newest version (0.96.20.7).
    The following packages were automatically installed and are no longer required:
      libonig2 libqdbm14 snap-confine ubuntu-core-launcher
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
    17 May 08:20:29 ntpdate: Starting MySQL Community Server...
    May 17 08:23:30 Fog-Server-15 systemd[1]: Started MySQL Community Server.
    Site 001-fog disabled.
    To activate the new configuration, you need to run:
      systemctl reload apache2
    ERROR 1698 (28000): Access denied for user 'root'@'localhost'
    ERROR 1698 (28000): Access denied for user 'root'@'localhost'
    Archive:  binaries1.4.0.zip
      inflating: packages/kernels/bzImage  
      inflating: packages/kernels/bzImage32  
      inflating: packages/inits/init_32.xz  
      inflating: packages/inits/init.xz  
     extracting: packages/clientfiles/FOGCrypt.zip  
     extracting: packages/clientfiles/FogService.zip  
      inflating: packages/clientfiles/SmartInstaller.exe  
      inflating: packages/clientfiles/FOGService.msi  
      inflating: packages/FOGService.msi  
    '../packages/clientfiles/FOGCrypt.zip' -> '/var/www/fog//client/FOGCrypt.zip'
    '../packages/clientfiles/FOGService.msi' -> '/var/www/fog//client/FOGService.msi'
    '../packages/clientfiles/FogService.zip' -> '/var/www/fog//client/FogService.zip'
    '../packages/clientfiles/SmartInstaller.exe' -> '/var/www/fog//client/SmartInstaller.exe'
    '../packages/kernels/bzImage' -> '/var/www/fog//service/ipxe/bzImage'
    '../packages/kernels/bzImage32' -> '/var/www/fog//service/ipxe/bzImage32'
    '../packages/inits/init_32.xz' -> '/var/www/fog//service/ipxe/init_32.xz'
    '../packages/inits/init.xz' -> '/var/www/fog//service/ipxe/init.xz'
    mysqlnd
    mcrypt
    Synchronizing state of apache2.service with SysV init with /lib/systemd/systemd-sysv-install...
    Executing /lib/systemd/systemd-sysv-install enable apache2
    Synchronizing state of php7.1-fpm.service with SysV init with /lib/systemd/systemd-sysv-install...
    Executing /lib/systemd/systemd-sysv-install enable php7.1-fpm
    Signature ok
    subject=/CN=10.24.28.18
    Getting CA Private Key
    ln: failed to create symbolic link '/var/www/fog/fog': File exists
    ERROR: Module php does not exist!
    Considering dependency proxy for proxy_fcgi:
    Module proxy already enabled
    Module proxy_fcgi already enabled
    Module setenvif already enabled
    ERROR: Module php7.1-fpm does not exist!
    Module rewrite already enabled
    Considering dependency setenvif for ssl:
    Module setenvif already enabled
    Considering dependency mime for ssl:
    Module mime already enabled
    Considering dependency socache_shmcb for ssl:
    Module socache_shmcb already enabled
    Module ssl already enabled
    Enabling site 001-fog.
    To activate the new configuration, you need to run:
      systemctl reload apache2
    ● apache2.service - The Apache HTTP Server
       Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2017-05-17 08:23:44 CDT; 2s ago
      Process: 4214 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
     Main PID: 4221 (apache2)
       CGroup: /system.slice/apache2.service
               ├─4221 /usr/sbin/apache2 -k start
               ├─4225 /usr/sbin/apache2 -k start
               ├─4226 /usr/sbin/apache2 -k start
               ├─4227 /usr/sbin/apache2 -k start
               ├─4228 /usr/sbin/apache2 -k start
               └─4229 /usr/sbin/apache2 -k start
    
    May 17 08:23:44 Fog-Server-15 systemd[1]: Starting The Apache HTTP Server...
    May 17 08:23:44 Fog-Server-15 apachectl[4214]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/001-fog.conf:1
    May 17 08:23:44 Fog-Server-15 apachectl[4214]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
    May 17 08:23:44 Fog-Server-15 systemd[1]: Started The Apache HTTP Server.
    
    ● php7.1-fpm.service - The PHP 7.1 FastCGI Process Manager
       Loaded: loaded (/lib/systemd/system/php7.1-fpm.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2017-05-17 08:23:44 CDT; 2s ago
         Docs: man:php-fpm7.1(8)
     Main PID: 4219 (php-fpm7.1)
       Status: "Ready to handle connections"
       CGroup: /system.slice/php7.1-fpm.service
               ├─4219 php-fpm: master process (/etc/php/7.1/fpm/php-fpm.conf)                      
               ├─4222 php-fpm: pool www                                                            
               └─4223 php-fpm: pool www                                                            
    
    May 17 08:23:44 Fog-Server-15 systemd[1]: Starting The PHP 7.1 FastCGI Process Manager...
    May 17 08:23:44 Fog-Server-15 systemd[1]: Started The PHP 7.1 FastCGI Process Manager.
    --2017-05-17 08:23:46--  http://10.24.28.18//fog//maintenance/backup_db.php
    Connecting to 10.24.28.18:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Could not parse String-Transport-Security header
    Location: ?node=schema [following]
    --2017-05-17 08:23:46--  http://10.24.28.18//fog//maintenance/backup_db.php?node=schema
    Connecting to 10.24.28.18:80... connected.
    HTTP request sent, awaiting response... 500 Internal Server Error
    2017-05-17 08:23:46 ERROR 500: Internal Server Error.
    
    

  • Senior Developer

    @Raymond-Bell Can you provide the installer’s error log? It should contain some more helpful information. Also the apache error logs?


  • Testers

    @Tom-Elliott Yes space is not a issue Tom i checked that


  • Senior Developer

    Can you validate disk space?

    Fog often makes a backup of the GUI folders in /home and also stores a copy of the db backup (which is failing here) in the same location under /home/fogDBbackups. There are cases where it’s just failing but typically I’ve found its due to disk space available.


Log in to reply
 

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.