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

    Fog server refused connection

    Scheduled Pinned Locked Moved Unsolved FOG Problems
    13 Posts 2 Posters 51 Views
    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.
    • Tom ElliottT
      Tom Elliott @FlareImp
      last edited by

      @FlareImp Thank you, that output changes the picture. MariaDB is not stopping. It has run for 21 hours. It is full: every connection slot is in use, so it refuses new ones (“Too many connections”). FOG then cannot read the schema version, and sends every page to the schema updater. The installer only appears to fix it, because it restarts MariaDB, which drops every connection.

      So the question is now what holds all those connections. The next time the page goes empty, run these on the FOG server before you restart anything, and post the output:

      sudo mysql -e "SHOW VARIABLES LIKE 'max_connections'; SHOW GLOBAL STATUS LIKE 'Max_used_connections';"
      sudo mysql -e "SELECT user, SUBSTRING_INDEX(host, ':', 1) AS from_host, command, COUNT(*) AS conns, MAX(time) AS longest_s FROM information_schema.processlist GROUP BY 1, 2, 3 ORDER BY conns DESC;"
      sudo mysql -e "SELECT id, user, command, time, state, LEFT(info, 150) AS query FROM information_schema.processlist WHERE command <> 'Sleep' ORDER BY time DESC LIMIT 20;"
      ps -eo pid,etimes,args --sort=-etimes | grep -E '[p]hp' | head -40
      

      sudo mysql still gets in when the server is full, because MariaDB keeps one spare slot for root.

      To bring the server back without the installer:

      sudo systemctl restart mariadb
      

      About how many hosts run the FOG agent against this server?

      The fix I mentioned in my first reply is now on dev-branch. With it, the schema page shows the database error, here “Too many connections”, instead of an empty page. The agent log says “cannot reach its database” instead of “schema update”. It reaches stable with the next release.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      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

      F 1 Reply Last reply Reply Quote 0
      • F
        FlareImp @Tom Elliott
        last edited by

        @Tom-Elliott

        Restarting mariadb did not fix the webui issue so I had to rerun the installer.sh again. after going back into the logs, this is what I was seeing if it helps.

        Dec 04 07:45:11 tv-fog-main systemd[1]: mariadb.service: Consumed 21.152s CPU time over 2min 38.196s wall clock time, 227.3M memory peak.
        Dec 04 07:45:11 tv-fog-main systemd[1]: Starting mariadb.service - MariaDB 11.8.6 database server...
        Dec 04 07:45:11 tv-fog-main (mariadbd)[2982]: mariadb.service: Referenced but unset environment variable evaluates to an empty string: MYSQLD_OPTS, _WSREP_NEW_CLUSTER
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] Starting MariaDB 11.8.6-MariaDB-5ubuntu0.1 from Ubuntu source revision 9bfea48ce1214cc4470f6f6f8a4e30352cef84e7 server_uid Flsf7J2EQTs67j8LeqynYbCgQ70= as process 2982
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Compressed tables use zlib 1.3.1
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Number of transaction pools: 1
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Using AVX512 instructions
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Using io_uring
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: innodb_buffer_pool_size_max=128m, innodb_buffer_pool_size=128m
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Initialized memory pressure event listener
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Completed initialization of buffer pool
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: End of log at LSN=22049089801
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Opened 3 undo tablespaces
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: log sequence number 22049089801; transaction id 64164331
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] Plugin 'FEEDBACK' is disabled.
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] Plugin 'wsrep-provider' is disabled.
        Dec 04 07:45:11 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:11 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
        Dec 04 07:45:12 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:12 0 [Note] InnoDB: Buffer pool(s) load completed at 261204  7:45:12
        Dec 04 07:45:12 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:12 0 [Note] Server socket created on IP: '0.0.0.0', port: '3306'.
        Dec 04 07:45:12 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:12 0 [Note] Server socket created on IP: '::', port: '3306'.
        Dec 04 07:45:12 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:12 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
        Dec 04 07:45:12 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:12 0 [Note] /usr/sbin/mariadbd: ready for connections.
        Dec 04 07:45:12 tv-fog-main mariadbd[2982]: Version: '11.8.6-MariaDB-5ubuntu0.1 from Ubuntu'  socket: '/run/mysqld/mysqld.sock'  port: 3306  -- Please help get to 10k stars at https://github.com/MariaDB/Server
        Dec 04 07:45:12 tv-fog-main systemd[1]: Started mariadb.service - MariaDB 11.8.6 database server.
        Dec 04 07:45:12 tv-fog-main /etc/mysql/debian-start[2999]: Upgrading MariaDB tables if necessary.
        Dec 04 07:45:12 tv-fog-main /etc/mysql/debian-start[3014]: Checking for insecure root accounts.
        Dec 04 07:45:12 tv-fog-main /etc/mysql/debian-start[3018]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
        Dec 04 07:45:13 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:13 39 [Warning] IP address '10.221.9.52' could not be resolved: Name or service not known
        Dec 04 07:45:20 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:20 49 [Warning] IP address '10.223.9.50' could not be resolved: Name or service not known
        Dec 04 07:45:22 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:22 50 [Warning] IP address '10.225.9.50' could not be resolved: Name or service not known
        Dec 04 07:45:34 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:34 51 [Warning] IP address '10.228.9.50' could not be resolved: Name or service not known
        Dec 04 07:45:35 tv-fog-main mariadbd[2982]: 2026-12-04  7:45:35 52 [Warning] IP address '10.221.9.50' could not be resolved: Name or service not known
        Dec 04 07:46:47 tv-fog-main mariadbd[2982]: 2026-12-04  7:46:47 1698 [Warning] IP address '10.220.9.50' could not be resolved: Name or service not known
        Dec 04 07:46:48 tv-fog-main mariadbd[2982]: 2026-12-04  7:46:48 1704 [Warning] IP address '10.222.9.50' could not be resolved: Name or service not known
        Dec 04 07:46:49 tv-fog-main mariadbd[2982]: 2026-12-04  7:46:49 1712 [Warning] IP address '10.229.9.50' could not be resolved: Name or service not known
        
        Tom ElliottT 1 Reply Last reply Reply Quote 0
        • F
          FlareImp @Tom Elliott
          last edited by

          @Tom-Elliott I also noticed that when the main fog server is crashing out, all the Fog services on my remote master storage nodes also stop. Not sure if that is relavent.

          Tom ElliottT 1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott @FlareImp
            last edited by

            @FlareImp Thanks, that log helps. It also explains why the restart did not help. Within 90 seconds of the restart, MariaDB had taken about 1,650 new connections (the connection number went from 52 to 1698). So the slots fill again almost at once. Something is still sending a flood of connections, or connections are getting stuck, as soon as MariaDB is back.

            So you do not have to wait for the next failure. Collect the output from my last reply while the page is empty, or within a few minutes after a restart, and post it. The two information_schema.processlist queries are the important ones. They show who holds the connections and which queries are stuck.

            The addresses in that log (10.220.9.50 through 10.229.9.50, and 10.221.9.52) connect straight to MariaDB. Are those your FOG storage nodes? How many storage nodes do you have, and what FOG version are they on?

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            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

            F 1 Reply Last reply Reply Quote 0
            • Tom ElliottT
              Tom Elliott @FlareImp
              last edited by

              @FlareImp Thanks, that log helps. It also explains why restarting MariaDB did not help. Within 90 seconds of the restart, MariaDB had taken about 1,650 new connections (the connection number went from 52 to 1698). So the slots fill again almost at once. Something keeps sending connections, or keeps connections stuck, as soon as MariaDB is back.

              The installer restarts more than MariaDB: it also restarts Apache, PHP-FPM, and the FOG services. One of those is most likely what brings the server back. Next time the page goes empty, please do this instead of the installer:

              1. Run the commands from my last reply first, and post the output. The two information_schema.processlist queries are the important ones. They show who holds the connections and which queries are stuck.
              2. Restart only the FOG services, then wait two minutes and check the web UI:
              sudo systemctl restart 'FOG*.service'
              
              1. If the page is still empty, restart only the web side, then wait two minutes and check again:
              sudo systemctl restart apache2 'php*-fpm.service'
              
              1. Tell us which step brought it back.

              You also said this was working before. Do you know about when it started? Did anything change around then, such as a FOG update, the new FOG agent being rolled out to more machines, or new storage nodes? This shows the dates of package updates on the server:

              grep -E '^Start-Date|^Commandline' /var/log/apt/history.log | tail -n 40
              

              Last, the addresses in your log (10.220.9.50 through 10.229.9.50, and 10.221.9.52) connect straight to MariaDB. Are those your FOG storage nodes? How many storage nodes do you have, and what FOG version are they on?

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              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
              • F
                FlareImp @Tom Elliott
                last edited by

                @Tom-Elliott There are 7 Master Storage Nodes and 2 slave nodes under each master.

                Tom ElliottT 1 Reply Last reply Reply Quote 0
                • Tom ElliottT
                  Tom Elliott @FlareImp
                  last edited by

                  @FlareImp Thank you, that was the missing piece, and it is a FOG bug.

                  Every FOG server runs 11 FOG services, and that includes every storage node. Each service keeps 2 connections to the main server’s database open all the time, even while it sleeps between runs. That is 22 connections per server. With your main server, 7 master storage nodes and their 14 other storage nodes, that is 22 servers, or about 480 connections. MariaDB allows 151 by default. Once it is full, the web UI and the agents cannot connect, and you get the empty schema page. This is also why restarting MariaDB alone did not help: every node reconnects within seconds. It is also why the node services stopped: they could not get a connection either.

                  I am fixing FOG so that a service holds a connection only while it is working. I will post here when the fix is on dev-branch.

                  Until then, raise the limit on the main FOG server. This creates a small config file and restarts MariaDB:

                  printf '[mysqld]\nmax_connections = 600\n' | sudo tee /etc/mysql/mariadb.conf.d/90-fog-connections.cnf
                  sudo systemctl restart mariadb
                  sudo mysql -e "SHOW VARIABLES LIKE 'max_connections'"
                  

                  The last command should show 600. Then, on each storage node where the FOG services stopped, start them again:

                  sudo systemctl restart 'FOG*.service'
                  

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                  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

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    FlareImp @Tom Elliott
                    last edited by FlareImp

                    @Tom-Elliott Awesome work Tom! I have applied your fix. I am not sure when it broke exactly because I have been doing a lot of dev-branch upgrades since we were trying to fix other bugs. I did move my main fog server and all the storage nodes over to fog 1.6.1 a few days ago so everything was matching.

                    Tom ElliottT 1 Reply Last reply Reply Quote 0
                    • Tom ElliottT
                      Tom Elliott @FlareImp
                      last edited by

                      @FlareImp The fix is https://github.com/FOGProject/fogproject/pull/2431. With it, a FOG service holds a database connection only while it is working, and lets it go while it sleeps. On my test server, each service went from 2 connections held all the time to none between runs.

                      It reaches dev-branch when that pull request merges, and stable with the next release. To get it, update the main server and every storage node, because the storage nodes’ services are the ones filling the main server’s database. Keep the max_connections = 600 setting until all of them are updated.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      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

                      F 1 Reply Last reply Reply Quote 0
                      • F
                        FlareImp @Tom Elliott
                        last edited by

                        @Tom-Elliott I have upgraded my Master Fog Server and all my nodes to dev-branch 1.6.1.776. I am defiantly seeing a drop in bandwidth usage. Monday morning will tell.

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

                        38

                        Online

                        12.8k

                        Users

                        17.7k

                        Topics

                        157.6k

                        Posts
                        Copyright © 2012-2026 FOG Project