• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

FOG 1.5.7 Update Database Issue

Scheduled Pinned Locked Moved Solved
FOG Problems
6
29
5.6k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    Sebastian Roth Moderator
    last edited by Jul 16, 2019, 8:20 PM

    @chaonatic Well that might have fixed it. But I am still not sure how you got into this situation or if this is something every Ubuntu user will face sooner or later?! As far as I know we have not seen this issue in the forums before.

    So now I’d suggest you run sudo apt-get install mariadb-server-10.1, then change the packages=.... line in /opt/fog/.fogsettings (got the name wrong last time) back to mariadb-client mariadb-server and re-run the FOG installer script.

    Keeping my fingers crossed this is not something we’ll see on every Ubuntu update now. Still can’t really see what’s going on here and why this is happening.

    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

    C 1 Reply Last reply Jul 16, 2019, 8:46 PM Reply Quote 0
    • C
      chaonatic @Sebastian Roth
      last edited by Jul 16, 2019, 8:46 PM

      @Sebastian-Roth Well we’re definitely closer. The installer doesn’t fail when installing the databases but when you get to updating the database I’m still getting the Database connection unavailable error. Is this something to do with the blank vs not blank password (I mean, I’ve not yet set a DB pass)?

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by Jul 16, 2019, 9:39 PM

        @chaonatic Try to manually connect to the DB and see if that works: mysql -u root -p (just hit ENTER when it asks for a password if yours is empty)

        As well you might want to read this one: https://forums.fogproject.org/topic/10006/ubuntu-is-fog-s-enemy

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • N
          notverypunny
          last edited by Jul 22, 2019, 4:25 PM

          My apologies if this ends up as a duplicate post, tried to register and the confirmation email wasn’t getting through the work address… anyways

          I’ve got the same issue: Running 1.5.6, trying to upgrade to 1.5.7 on Ubuntu 18.04.2.

          Just tried manually installing the appropriate mariadb packages ( -common, -client and -server)

          Here’s the problem:
          fog-mysql2mariadb.PNG

          Looks like the script isn’t set up to handle the migration from mysql 5.7 to mariadb given the exception that the package manager throws so it scraps the existing install.

          Not sure what avenue you want to take with the script, but it looks like it’s going to break any existing ubuntu installs that are trying to go from mysql to mariadb.

          Ping me if you need any more info, I’ll post back if if make any headway on my install.

          1 Reply Last reply Reply Quote 0
          • N
            notverypunny
            last edited by Jul 22, 2019, 5:10 PM

            So for anyone else running into this, or if the devs want to make this work in the script, here’s what I had to do to get this upgrade to work:

            • backup fog db
            • perform manual install of mariadb-common, mariadb-server and mariadb-client
            • reboot (services wouldn’t start and play nice, this was the simplest thing, should also be possible without restarting but I didn’t go there)
            • manually create fog db
            • restore fog db from backup
            • git pull and run bin/installfog.sh

            knock wood things are now working as expected and the web interface seems snappier (could just be in my head).

            Cheers

            1 Reply Last reply Reply Quote 0
            • N
              notverypunny
              last edited by Jul 22, 2019, 5:32 PM

              Aaand it looks like the same bug is present when updating storage nodes…

              Similar process as far as a workaround goes, but without the backup and restore of the fog db as it isn’t part of the storage node.

              1 Reply Last reply Reply Quote 0
              • S
                Sebastian Roth Moderator
                last edited by Sebastian Roth Jul 22, 2019, 12:59 PM Jul 22, 2019, 6:50 PM

                @notverypunny Really great you managed to work your way out of this. We had one other user some days ago who ran into the same issue - see here.

                Not sure what avenue you want to take with the script, but it looks like it’s going to break any existing ubuntu installs that are trying to go from mysql to mariadb.

                Not exactly true. Only if you move from a MySQL version 5.7 and earlier up to a newer version - I guess even if you update from MySQL 5.7 to 5.8 you’d run into this on any Ubuntu installation. Can you please let us know which version of Ubuntu you had before going to 18.04.2??

                EDIT: Sorry, I was under the impression that Ubuntu 18.04 did use MySQL later than 5.7 already. I was wrong! Just figured that it was me who caused this in the first place when I added Debian 10 support! https://github.com/FOGProject/fogproject/commit/fddac44877ebabbf6f01d38d39361179bc6ec04d

                Probably the only thing we can do within the installer is check if MySQL 5.7 is installed and tell people to manually follow the steps outlined. I would not fancy doing this in an automated way within the installer scripts.

                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                N 1 Reply Last reply Jul 22, 2019, 7:24 PM Reply Quote 0
                • N
                  notverypunny @Sebastian Roth
                  last edited by Jul 22, 2019, 7:24 PM

                  @Sebastian-Roth

                  With 18.04 being a LTS, I expect that they’ll keep mysql alive and well in their repos, or provide migration / upgrade within the distro’s framework. As such, the project’s (fogproject that is) best track might be to keep existing 18.04 installs on mysql unless there’s a compelling reason to force the migration.

                  I’m lucky that my fog servers aren’t hosting anything else, but migrating databases if someone has other workloads on the same servers might not be a simple task.

                  Cheers

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sebastian Roth Moderator
                    last edited by Jul 22, 2019, 8:12 PM

                    @notverypunny said in FOG 1.5.7 Update Database Issue:

                    With 18.04 being a LTS, I expect that they’ll keep mysql alive and well in their repos, or provide migration / upgrade within the distro’s framework. As such, the project’s (fogproject that is) best track might be to keep existing 18.04 installs on mysql unless there’s a compelling reason to force the migration.

                    You are absolutely right here. I just setup a test environment and confirmed the commit posted below is actually causing the issue. Shouldn’t have done that in the first place. I’d happily revert that change back to what it was. But that would mean that you and some others will be reverted back to MySQL 5.7 on the next FOG release again. Very ugly I suppose. I will try to do some testing on what happens when I do this.

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sebastian Roth Moderator
                      last edited by Jul 22, 2019, 10:22 PM

                      @notverypunny In a test setup I was able to revert back to mysql 5.7 without much trouble. It seems to be able to use the database that mariadb used as well. The only issue I see is that the systemd service files seemed corrupted on my test system:

                      ls -lah /etc/systemd/system/ | grep -e maria -e mysql
                      lrwxrwxrwx  1 root root   35 Jul 22 20:10 mysqld.service -> /lib/systemd/system/mariadb.service
                      lrwxrwxrwx  1 root root   27 Jul 22 21:16 mysql.service -> /lib/systemd/system/mariadb
                      

                      So I am still wondering if it’s a good idea to simply revert the change back to mysql-client mysql-server or if I need to add a check and if someone is on MariaDB already I just leave it alone?!?

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      N 1 Reply Last reply Jul 23, 2019, 11:17 AM Reply Quote 0
                      • N
                        notverypunny @Sebastian Roth
                        last edited by Jul 23, 2019, 11:17 AM

                        @Sebastian-Roth said in FOG 1.5.7 Update Database Issue:

                        @notverypunny In a test setup I was able to revert back to mysql 5.7 without much trouble. It seems to be able to use the database that mariadb used as well. The only issue I see is that the systemd service files seemed corrupted on my test system:

                        ls -lah /etc/systemd/system/ | grep -e maria -e mysql
                        lrwxrwxrwx  1 root root   35 Jul 22 20:10 mysqld.service -> /lib/systemd/system/mariadb.service
                        lrwxrwxrwx  1 root root   27 Jul 22 21:16 mysql.service -> /lib/systemd/system/mariadb
                        

                        So I am still wondering if it’s a good idea to simply revert the change back to mysql-client mysql-server or if I need to add a check and if someone is on MariaDB already I just leave it alone?!?

                        I would add a check, assuming that the logic isn’t too much to code. MariaDB is the better db at this point from what I can see and I should think that most people would prefer it, especially on a new install.

                        1 Reply Last reply Reply Quote 0
                        • F
                          FlangeMonkey
                          last edited by Jul 30, 2019, 6:36 PM

                          Did you guys find a fix for this? I’ve just upgraded from 1.5.6 to 1.5.7 and the MariaDB service won’t start.

                          Thanks,

                          1 Reply Last reply Reply Quote 0
                          • S
                            Sebastian Roth Moderator
                            last edited by Jul 30, 2019, 8:20 PM

                            @FlangeMonkey When releasing 1.5.7 we did not expect this to be an issue but it turned out that moving from MySQL 5.7 to MariaDB is not yet properly supported by Ubuntu. It doesn’t do a merge of the DB over to the new version but simply shuts down the old MySQL DB (usually find that in /var/lib/mysql-5.7/) and creates a fresh empty new one for MariaDB.

                            and the MariaDB service won’t start.

                            While this sounds a bit different I can still imagine this being a similar case. Please run sudo systemstl status mariadb and post output here. As well run ls -al /var/lib | grep mysql and post here.

                            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                            A 1 Reply Last reply Aug 5, 2019, 7:07 AM Reply Quote 0
                            • S
                              Sebastian Roth Moderator
                              last edited by Jul 30, 2019, 9:33 PM

                              For all other users on Ubuntu out there. Please if you intend to update, use the current developer release 1.5.7.2 instead of plain 1.5.7 or wait till the next release is out. I just pushed out a fix that should address this current issue.

                              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                              1 Reply Last reply Reply Quote 0
                              • A
                                Arrowtron @Sebastian Roth
                                last edited by Aug 5, 2019, 7:07 AM

                                @Sebastian-Roth

                                These are my results below:

                                mariadb.service - MariaDB 10.1.40 database server
                                  Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
                                  Active: active (running) since Mon 2019-08-05 16:50:56 AEST; 9min ago
                                    Docs: man:mysqld(8)
                                          https://mariadb.com/kb/en/library/systemd/
                                Main PID: 22323 (mysqld)
                                  Status: "Taking your SQL requests now..."
                                   Tasks: 34 (limit: 4419)
                                  CGroup: /system.slice/mariadb.service
                                          └─22323 /usr/sbin/mysqld
                                
                                drwxr-xr-x  4 mysql     mysql     4096 Aug  5 16:50 mysql
                                drwx------  6 mysql     mysql     4096 Aug  5 15:25 mysql-5.7
                                drwx------  2 mysql     mysql     4096 Oct 28  2018 mysql-files
                                drwx------  2 mysql     mysql     4096 Mar  7  2017 mysql-keyring
                                

                                updated from 1.5.6 to 1.5.7, get the same issue as everyone is describing
                                changed to dev branch 1.5.7.2 re-installed to see if it would fix it. still the same

                                I am able to get into MariaDB with mysql -u root -p

                                Welcome to the MariaDB monitor.  Commands end with ; or \g.
                                Your MariaDB connection id is 28366
                                Server version: 10.1.40-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
                                
                                Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
                                
                                Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
                                
                                MariaDB [(none)]> Ctrl-C -- exit!
                                Aborted
                                

                                I have backup’s here, but not quite sure how to restore them so the installation works

                                /home/fogDBbackups
                                

                                FileZilla.png

                                A 1 Reply Last reply Aug 5, 2019, 7:10 AM Reply Quote 0
                                • A
                                  Arrowtron @Arrowtron
                                  last edited by Aug 5, 2019, 7:10 AM

                                  @Arrowtron

                                  Update, just refreshed the page and loaded into this
                                  d8071618-7950-4bc1-a8d5-de8154350a75-image.png

                                  clicked Install/update now and can now see the dashboard, looks very empty. I will look more into this tomorrow

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    Sebastian Roth Moderator
                                    last edited by Aug 5, 2019, 12:39 PM

                                    @Arrowtron Sorry to hear you have run into this as well. Unfortunately upgrading to 1.5.7.2 doesn’t help when you have gone to 1.5.7 already. We don’t do this as an automatic fix in the scripts as I find it too error prone to do in a scripted kind of way.

                                    You should still have your “old” and valid database in /var/lib/mysql-5.7. Please follow the steps outlined below and I hope you should be right back up again:

                                    sudo -i
                                    mv /var/lib/mysql /var/lib/mysql-mariadb
                                    apt-get remove mariadb-client mariadb-server
                                    cp -a /var/lib/mysql-5.7 /var/lib/mysql
                                    apt-get install mysql-client mysql-server
                                    systemctl start mysql
                                    

                                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                    A 1 Reply Last reply Aug 6, 2019, 1:07 AM Reply Quote 0
                                    • A
                                      Arrowtron @Sebastian Roth
                                      last edited by Arrowtron Aug 5, 2019, 7:41 PM Aug 6, 2019, 1:07 AM

                                      @Sebastian-Roth said in FOG 1.5.7 Update Database Issue:

                                      /var/lib/mysql

                                      Thanks for the reply,

                                      I get this when i run the command
                                      apt-get install mysql-client mysql-server

                                      There is a MySQL server running, but we failed in our attempts to stop it.
                                      Stop it yourself and try again!

                                      Tried a few commands found doing a web search that didn’t help
                                      apt --fix-broken install

                                      Failed to stop mysql.service: Unit mysql.service not loaded.
                                      invoke-rc.d: initscript mysql, action "stop" failed.
                                      invoke-rc.d returned 5
                                      There is a MySQL server running, but we failed in our attempts to stop it.
                                      Stop it yourself and try again!
                                      dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb (--unpack):
                                       new mysql-server-5.7 package pre-installation script subprocess returned error exit status 1
                                      Errors were encountered while processing:
                                       /var/cache/apt/archives/mysql-server-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb
                                      E: Sub-process /usr/bin/dpkg returned an error code (1)
                                      
                                      install mysql-client mysql-server
                                      Reading package lists... Done
                                      Building dependency tree
                                      Reading state information... Done
                                      mysql-client is already the newest version (5.7.27-0ubuntu0.18.04.1).
                                      mysql-server is already the newest version (5.7.27-0ubuntu0.18.04.1).
                                      You might want to run 'apt --fix-broken install' to correct these.
                                      The following packages have unmet dependencies:
                                       mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
                                      E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
                                      

                                      =Update=
                                      accidentally ran command sudo rm -rvf /var/lib
                                      (thought i was typing in a new line, working too quick, was backing up mysql and purging etc) Going to start a fresh i think

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        Sebastian Roth Moderator
                                        last edited by Aug 6, 2019, 6:40 AM

                                        @Arrowtron said in FOG 1.5.7 Update Database Issue:

                                        There is a MySQL server running, but we failed in our attempts to stop it.
                                        Stop it yourself and try again!

                                        Did you run apt-get remove mariadb-client mariadb-server before that? Kind of strange but you might have to kill the old DB process like this killall -9 mysqld…

                                        =Update=
                                        accidentally ran command sudo rm -rvf /var/lib

                                        I am sure you have a backup of that machine! Do you? Just recover that directory from your backup and proceed.

                                        Run apt --fix-broken install as suggested in the output and post what you get from this.

                                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                        A 1 Reply Last reply Aug 8, 2019, 5:31 AM Reply Quote 0
                                        • A
                                          Arrowtron @Sebastian Roth
                                          last edited by Aug 8, 2019, 5:31 AM

                                          @Sebastian-Roth

                                          Yes i ran

                                          apt-get remove mariadb-client mariadb-server
                                          

                                          Didn’t try this command, it might have helped for the unmet dependencies problem

                                          killall -9 mysqld
                                          

                                          Yes i have some SQL backup’s from previous upgrade which I have restored onto a new server (just had to change IP’s etc which is fine)
                                          It’s on a virtual machine where as physical before, snapshots will come in handy for next time!

                                          Yes ran the apt --fix broken install and got the unmet dependencies for mysql errors. Didn’t have the time to keep looking into it

                                          All goods, thanks for your help though!

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post

                                          258

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project