Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21331

installation fails in an server with containers

Details

    Description

      The installation script has to realize that in a machine with containers, there are several processes called mysqld, but they don't belong to the central session, are isolated in containers. A workaround is to stop all containers, but in busy server that is not simply possible.

      Preparing to unpack .../0-mariadb-server-10.4_1%3a10.4.11+maria~buster_amd64.deb ...
      Failed to stop mysql.service: Unit mysql.service not loaded.
      'systemctl stop mysql' 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 /tmp/apt-dpkg-install-XZL55Z/0-mariadb-server-10.4_1%3a10.4.11+maria~buster_amd64.deb (--unpack):
      new mariadb-server-10.4 package pre-installation script subprocess returned error exit status 1

      Attachments

        Issue Links

          Activity

            philip_38 Philip orleans created issue -

            serg, what do you think about this one? Maybe just add the error 5 to

                if [ "$errno" != 0 -a "$errno" != 100 ]; then
            

            would it be enough?

            elenst Elena Stepanova added a comment - serg , what do you think about this one? Maybe just add the error 5 to if [ "$errno" != 0 -a "$errno" != 100 ]; then would it be enough?
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Fix Version/s 10.5 [ 23123 ]
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.5.0 [ 23709 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]

            100 looks like an obsolete check, from pre-systemctl days.

            https://freedesktop.org/software/systemd/man/systemd.exec.html#Process%20exit%20codes

            serg Sergei Golubchik added a comment - 100 looks like an obsolete check, from pre-systemctl days. https://freedesktop.org/software/systemd/man/systemd.exec.html#Process%20exit%20codes
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            serg Sergei Golubchik added a comment - - edited

            we cannot just start ignoring 5, it's a valid error, meaning a mysqld process is running and we cannot shut it down.

            philip_38, could you try the following command, whether it works with your containters? Just a plain

            pgrep mysqld
            

            shows all mysqld processes, also in containers.
            But if you run

            pgrep --ns $$ mysqld
            

            this should not show containerized mysqld processes, it should only show the one on the host. At least it does for me and docker containers. Does that work for you too?

            serg Sergei Golubchik added a comment - - edited we cannot just start ignoring 5, it's a valid error, meaning a mysqld process is running and we cannot shut it down. philip_38 , could you try the following command, whether it works with your containters? Just a plain pgrep mysqld shows all mysqld processes, also in containers. But if you run pgrep --ns $$ mysqld this should not show containerized mysqld processes, it should only show the one on the host. At least it does for me and docker containers. Does that work for you too?
            serg Sergei Golubchik made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2.32 [ 24221 ]
            Fix Version/s 10.3.23 [ 24222 ]
            Fix Version/s 10.4.13 [ 24223 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            serg Sergei Golubchik made changes -
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Component/s Packaging [ 10700 ]
            Component/s Platform Debian [ 10136 ]
            Component/s Configuration [ 13904 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 102114 ] MariaDB v4 [ 157108 ]
            faust Faustin Lammler made changes -
            faust Faustin Lammler made changes -

            I tested one more time with faust this bug and I can confirm that the bug occurs for Debian buster, but is not reproducible for Ubuntu bionic and I don't know why otto FYI

            anel Anel Husakovic added a comment - I tested one more time with faust this bug and I can confirm that the bug occurs for Debian buster, but is not reproducible for Ubuntu bionic and I don't know why otto FYI

            This issue status is closed - why are you still investigating it?

            If you were able to reproduce the issue, what are the exact steps? Do you want me to run them and debug what Debian Buster does?

            otto Otto Kekäläinen added a comment - This issue status is closed - why are you still investigating it? If you were able to reproduce the issue, what are the exact steps? Do you want me to run them and debug what Debian Buster does?

            Hi Otto,
            I wanted to learn about pid namespaces and this MDEV was a perfect playground (resulted with PR #2076).
            This MDEV stated that you have a mysqld|mariadbd process from container you should get the error when installing the server:

            # Start container (no mariadb server installed)
            $ docker container run --rm --name mysql-cont -e MYSQL_ROOT_PASSWORD=secret -d mysql
            # Install mariadb
            $ sudo apt install mariadb-server-10.2 # version 10.2.31 (use archive.mariadb.org)
            

            I would like you to run on any version prior the patch fb7c1b9415c9a8 like <=10.2.31, <=10.3.22, <=10.4.12, etc but on Ubuntu bionic (since I noted on this distro).
            What was noted is that
            1. Debian buster raised the error (as in description of current MDEV)
            2. Ubuntu bionic didn't catch the error (host process mysqld is installed over the containerized mysqld).
            And I don't know why.
            Do you want me to create new MDEV for this?
            Thanks

            anel Anel Husakovic added a comment - Hi Otto, I wanted to learn about pid namespaces and this MDEV was a perfect playground (resulted with PR #2076 ). This MDEV stated that you have a mysqld|mariadbd process from container you should get the error when installing the server: # Start container (no mariadb server installed) $ docker container run -- rm --name mysql-cont -e MYSQL_ROOT_PASSWORD=secret -d mysql # Install mariadb $ sudo apt install mariadb-server-10.2 # version 10.2.31 (use archive.mariadb.org) I would like you to run on any version prior the patch fb7c1b9415c9a8 like <=10.2.31, <=10.3.22, <=10.4.12, etc but on Ubuntu bionic (since I noted on this distro). What was noted is that 1. Debian buster raised the error (as in description of current MDEV) 2. Ubuntu bionic didn't catch the error (host process mysqld is installed over the containerized mysqld ). And I don't know why. Do you want me to create new MDEV for this? Thanks
            anel Anel Husakovic made changes -

            People

              serg Sergei Golubchik
              philip_38 Philip orleans
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.