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

AUTH_TEST_PLUGIN_SO points to old location, test main.plugin_auth fails with new client plugin path

Details

    Description

      Applying recent MariaDB Connector C changes and applying https://github.com/MariaDB/server/pull/1478 leads to the mtr error:

      main.plugin_auth 'innodb'                w3 [ fail ]
              Test ended at 2020-04-04 16:12:11
       
      CURRENT_TEST: main.plugin_auth
      mysqltest: At line 417: query 'connect cleartext_con,localhost,uplain,cleartext_test' failed: 1045: Plugin mysql_clear_password could not be loaded: /usr/lib/mysql/plugin/mysql_clear_password.so: cannot open shared object file: No such file or directory
      

      This is because the new location for the plugin is usr/lib/*/libmariadb3/plugin/mysql_clear_password.so instead of usr/lib/mysql/plugin/mysql_clear_password.so

      Line 417 in plugin_auth.test looks like this:

      connect(cleartext_con,localhost,uplain,cleartext_test);
      

      In the beginning of the file the plugin is loaded with:

      --source include/have_plugin_auth.inc
      

      The file have_plugin.opt includes:

      --plugin-load-add=$AUTH_TEST_PLUGIN_SO
      

      I can't find where $AUTH_TEST_PLUGIN_SO is set or how to update the path now to the test.

      server$ grep -rF AUTH_TEST_PLUGIN *
      mysql-test/include/have_plugin_auth.opt:--plugin-load-add=$AUTH_TEST_PLUGIN_SO
      mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test:--replace_result $AUTH_TEST_PLUGIN_SO PLUGIN_AUTH
      mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test:eval install plugin test_plugin_server soname '$AUTH_TEST_PLUGIN_SO';
      mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test:--replace_result $AUTH_TEST_PLUGIN_SO PLUGIN_AUTH
      mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test:eval install plugin test_plugin_server soname '$AUTH_TEST_PLUGIN_SO';
      

      Please help how to track down the client library plugin path in mtr and update it to match new location.

      Attachments

        Activity

          Also applies for a couple more tests:

          plugins.multiauth                        w3 [ fail ]
                  Test ended at 2020-04-04 17:29:43
           
          CURRENT_TEST: plugins.multiauth
          mysqltest: At line 75: exec of '/usr/bin/mysqltest --defaults-file=/dev/shm/var/3/my.cnf --silent --tmpdir=/dev/shm/var/tmp/3 --character-sets-dir=/usr/share/mysql/charsets --logdir=/dev/shm/var/3/log --database=test --timer-file=/dev/shm/var/3/log/timer < /dev/shm/var/3/tmp/peercred_test.txt 2>&1 -u mysqltest1 -pgood' failed, error: 256, status: 1, errno: 11
          Output from before failure:
          mysqltest: Could not open connection 'default': 1045 Plugin client_ed25519 could not be loaded: /usr/lib/mysql/plugin/client_ed25519.so: cannot open shared object file: No such file or directory
           
           
           
          The result from queries just before the failure was:
          < snip >
          select user(), current_user(), database();
          user()	current_user()	database()
          USER@localhost	USER@%	test
          # name does not match, password good = ok
          select user(), current_user(), database();
          user()	current_user()	database()
          mysqltest1@localhost	mysqltest1@%	test
          # name does not match, password bad = failure
          mysqltest: Could not open connection 'default': 1698 Access denied for user 'mysqltest1'@'localhost'
          drop user USER, mysqltest1;
          create user USER         identified via unix_socket OR ed25519 as password("GOOD");
          create user mysqltest1 identified via unix_socket OR ed25519 as password("good");
          show create user mysqltest1;
          CREATE USER for mysqltest1@%
          CREATE USER `mysqltest1`@`%` IDENTIFIED VIA unix_socket OR ed25519 USING 'F4aF8bw7130VaRbdLCl4f/P/wkjDmgJXwWvpJ5gmsZc'
          # name match = ok
          select user(), current_user(), database();
          user()	current_user()	database()
          USER@localhost	USER@%	test
          # name does not match, password good = ok
           
          plugins.auth_ed25519                     w4 [ fail ]
                  Test ended at 2020-04-04 17:38:48
           
          CURRENT_TEST: plugins.auth_ed25519
          mysqltest: At line 48: query 'connect con1, localhost, test1, secret' failed: 1045: Plugin client_ed25519 could not be loaded: /usr/lib/mysql/plugin/client_ed25519.so: cannot open shared object file: No such file or directory
           
          The result from queries just before the failure was:
          < snip >
          show grants for test1@localhost;
          Grants for test1@localhost
          GRANT USAGE ON *.* TO `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI'
          select ed25519_password('foo');
          ed25519_password('foo')
          vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI
          set password for test1@localhost = password('bar');
          show create user test1@localhost;
          CREATE USER for test1@localhost
          CREATE USER `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'pfzkeWMzkTefY1oshXS+/kATeN51M+4jxi3/cbyTd10'
          select ed25519_password('bar');
          ed25519_password('bar')
          pfzkeWMzkTefY1oshXS+/kATeN51M+4jxi3/cbyTd10
          set password for test1@localhost = 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
          show create user test1@localhost;
          CREATE USER for test1@localhost
          CREATE USER `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
          connect(localhost,test1,public,test,PORT,SOCKET);
          connect con1, localhost, test1, public;
          ERROR 28000: Plugin client_ed25519 could not be loaded: /usr/lib/mysql/plugin/client_ed25519.so: cannot open shared object file: No such file or directory
          

          mtr itself has option --plugin-dir and a sections that seems to expand it:

            mtr_add_arg($args, "--plugin-dir=%s", $plugindir);
          ...
                  for (<$bindir/storage/*/*.so>,
                       <$bindir/plugin/*/*.so>,
                       <$bindir/plugin/*/auth_pam_tool_dir>,
                       <$bindir/libmariadb/plugins/*/*.so>,
                       <$bindir/libmariadb/*.so>,
                       <$bindir/sql/*.so>)
                  {
          ...
                # hm, what paths work for debs and for rpms ?
                for (<$bindir/lib64/mysql/plugin/*.so>,
                     <$bindir/lib/mysql/plugin/*.so>,
                     <$bindir/lib64/mariadb/plugin/*.so>,
                     <$bindir/lib/mariadb/plugin/*.so>,
                     <$bindir/lib/plugin/*.so>,             # bintar
                     <$bindir/lib/plugin/*.dll>)
                {
                  my $pname=basename($_);
                  set_plugin_var($pname);
                  $plugindir=dirname($_) unless $plugindir;
                }
          

          otto Otto Kekäläinen added a comment - Also applies for a couple more tests: plugins.multiauth w3 [ fail ] Test ended at 2020-04-04 17:29:43   CURRENT_TEST: plugins.multiauth mysqltest: At line 75: exec of '/usr/bin/mysqltest --defaults-file=/dev/shm/var/3/my.cnf --silent --tmpdir=/dev/shm/var/tmp/3 --character-sets-dir=/usr/share/mysql/charsets --logdir=/dev/shm/var/3/log --database=test --timer-file=/dev/shm/var/3/log/timer < /dev/shm/var/3/tmp/peercred_test.txt 2>&1 -u mysqltest1 -pgood' failed, error: 256, status: 1, errno: 11 Output from before failure: mysqltest: Could not open connection 'default': 1045 Plugin client_ed25519 could not be loaded: /usr/lib/mysql/plugin/client_ed25519.so: cannot open shared object file: No such file or directory       The result from queries just before the failure was: < snip > select user(), current_user(), database(); user() current_user() database() USER@localhost USER@% test # name does not match, password good = ok select user(), current_user(), database(); user() current_user() database() mysqltest1@localhost mysqltest1@% test # name does not match, password bad = failure mysqltest: Could not open connection 'default': 1698 Access denied for user 'mysqltest1'@'localhost' drop user USER, mysqltest1; create user USER identified via unix_socket OR ed25519 as password("GOOD"); create user mysqltest1 identified via unix_socket OR ed25519 as password("good"); show create user mysqltest1; CREATE USER for mysqltest1@% CREATE USER `mysqltest1`@`%` IDENTIFIED VIA unix_socket OR ed25519 USING 'F4aF8bw7130VaRbdLCl4f/P/wkjDmgJXwWvpJ5gmsZc' # name match = ok select user(), current_user(), database(); user() current_user() database() USER@localhost USER@% test # name does not match, password good = ok   plugins.auth_ed25519 w4 [ fail ] Test ended at 2020-04-04 17:38:48   CURRENT_TEST: plugins.auth_ed25519 mysqltest: At line 48: query 'connect con1, localhost, test1, secret' failed: 1045: Plugin client_ed25519 could not be loaded: /usr/lib/mysql/plugin/client_ed25519.so: cannot open shared object file: No such file or directory   The result from queries just before the failure was: < snip > show grants for test1@localhost; Grants for test1@localhost GRANT USAGE ON *.* TO `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI' select ed25519_password('foo'); ed25519_password('foo') vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI set password for test1@localhost = password('bar'); show create user test1@localhost; CREATE USER for test1@localhost CREATE USER `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'pfzkeWMzkTefY1oshXS+/kATeN51M+4jxi3/cbyTd10' select ed25519_password('bar'); ed25519_password('bar') pfzkeWMzkTefY1oshXS+/kATeN51M+4jxi3/cbyTd10 set password for test1@localhost = 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'; show create user test1@localhost; CREATE USER for test1@localhost CREATE USER `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY' connect(localhost,test1,public,test,PORT,SOCKET); connect con1, localhost, test1, public; ERROR 28000: Plugin client_ed25519 could not be loaded: /usr/lib/mysql/plugin/client_ed25519.so: cannot open shared object file: No such file or directory mtr itself has option --plugin-dir and a sections that seems to expand it: mtr_add_arg($args, "--plugin-dir=%s", $plugindir); ... for (<$bindir/storage/*/*.so>, <$bindir/plugin/*/*.so>, <$bindir/plugin/*/auth_pam_tool_dir>, <$bindir/libmariadb/plugins/*/*.so>, <$bindir/libmariadb/*.so>, <$bindir/sql/*.so>) { ... # hm, what paths work for debs and for rpms ? for (<$bindir/lib64/mysql/plugin/*.so>, <$bindir/lib/mysql/plugin/*.so>, <$bindir/lib64/mariadb/plugin/*.so>, <$bindir/lib/mariadb/plugin/*.so>, <$bindir/lib/plugin/*.so>, # bintar <$bindir/lib/plugin/*.dll>) { my $pname=basename($_); set_plugin_var($pname); $plugindir=dirname($_) unless $plugindir; }

          I tried to fix this in https://github.com/MariaDB/server/pull/1478/commits/96864b6c1ceffa6270ab85490dd96ab30f0c688e but it did not have an effect mtr still fails with same messages.

          diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
          index 4989e43941ee..1ff20cb1139a 100755
          --- a/mysql-test/mysql-test-run.pl
          +++ b/mysql-test/mysql-test-run.pl
          @@ -2818,6 +2818,7 @@ ()
                   for (<$bindir/storage/*/*.so>,
                        <$bindir/plugin/*/*.so>,
                        <$bindir/plugin/*/auth_pam_tool_dir>,
          +             <$bindir/libmariadb3/plugin/*.so>,
                        <$bindir/libmariadb/plugins/*/*.so>,
                        <$bindir/libmariadb/*.so>,
                        <$bindir/sql/*.so>)
          @@ -2840,6 +2841,7 @@ ()
                 # hm, what paths work for debs and for rpms ?
                 for (<$bindir/lib64/mysql/plugin/*.so>,
                      <$bindir/lib/mysql/plugin/*.so>,
          +           <$bindir/lib/*/libmariadb3/plugin/*.so>,
                      <$bindir/lib64/mariadb/plugin/*.so>,
                      <$bindir/lib/mariadb/plugin/*.so>,
                      <$bindir/lib/plugin/*.so>,             # bintar
          

          Could perhaps elenst help here? Do you know where the path main.plugin_auth uses is defined?

          otto Otto Kekäläinen added a comment - I tried to fix this in https://github.com/MariaDB/server/pull/1478/commits/96864b6c1ceffa6270ab85490dd96ab30f0c688e but it did not have an effect mtr still fails with same messages. diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 4989e43941ee..1ff20cb1139a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2818,6 +2818,7 @@ () for (<$bindir/storage/*/*.so>, <$bindir/plugin/*/*.so>, <$bindir/plugin/*/auth_pam_tool_dir>, + <$bindir/libmariadb3/plugin/*.so>, <$bindir/libmariadb/plugins/*/*.so>, <$bindir/libmariadb/*.so>, <$bindir/sql/*.so>) @@ -2840,6 +2841,7 @@ () # hm, what paths work for debs and for rpms ? for (<$bindir/lib64/mysql/plugin/*.so>, <$bindir/lib/mysql/plugin/*.so>, + <$bindir/lib/*/libmariadb3/plugin/*.so>, <$bindir/lib64/mariadb/plugin/*.so>, <$bindir/lib/mariadb/plugin/*.so>, <$bindir/lib/plugin/*.so>, # bintar Could perhaps elenst help here? Do you know where the path main.plugin_auth uses is defined?

          This happens because include/default_client.cnf template has

          [client]
          plugin-dir=@mysqld.1.plugin-dir
          

          meaning the resulting my.cnf will have plugin-dir in the [client] section set to the plugin-dir from the [mysqld.1] section. And it's because mtr does not know that the client can have a plugin dir different from the server

          serg Sergei Golubchik added a comment - This happens because include/default_client.cnf template has [client] plugin-dir=@mysqld.1.plugin-dir meaning the resulting my.cnf will have plugin-dir in the [client] section set to the plugin-dir from the [mysqld.1] section. And it's because mtr does not know that the client can have a plugin dir different from the server

          This error is visible in context at e.g. http://buildbot.askmonty.org/buildbot/builders/kvm-deb-eoan-amd64/builds/866 and http://buildbot.askmonty.org/buildbot/builders/kvm-deb-buster-amd64/builds/2073

          It does not occur when the mtr is run in source, but apparently only when mariadb-test package and libmariadb3 packages are installed and test runs from installed packages.

          otto Otto Kekäläinen added a comment - This error is visible in context at e.g. http://buildbot.askmonty.org/buildbot/builders/kvm-deb-eoan-amd64/builds/866 and http://buildbot.askmonty.org/buildbot/builders/kvm-deb-buster-amd64/builds/2073 It does not occur when the mtr is run in source, but apparently only when mariadb-test package and libmariadb3 packages are installed and test runs from installed packages.

          Steps to reproduce in Docker:

          # Run Ubuntu Focal container
          docker run -it ubuntu:focal bash
          apt-get update
          apt-get install software-properties-common
          # Install packages from PPA that currently (2020-04-08) has packages built from branch https://github.com/MariaDB/server/pull/1478
          add-apt-repository ppa:mysql-ubuntu/mariadb-10.5
          apt-get update
          apt-get install mariadb-test
          # commands copied from http://buildbot.askmonty.org/buildbot/builders/kvm-deb-bionic-aarch64/builds/3627/steps/mtr/logs/stdio
          cd /usr/share/mysql/mysql-test
          # no --vardir=/dev/shm/var, fails in docker with "no space on disk" as there is no such device prepared
          perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1
          # or just one test
          perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 main.plugin_auth
          

          otto Otto Kekäläinen added a comment - Steps to reproduce in Docker: # Run Ubuntu Focal container docker run -it ubuntu:focal bash apt-get update apt-get install software-properties-common # Install packages from PPA that currently (2020-04-08) has packages built from branch https://github.com/MariaDB/server/pull/1478 add-apt-repository ppa:mysql-ubuntu/mariadb-10.5 apt-get update apt-get install mariadb-test # commands copied from http://buildbot.askmonty.org/buildbot/builders/kvm-deb-bionic-aarch64/builds/3627/steps/mtr/logs/stdio cd /usr/share/mysql/mysql-test # no --vardir=/dev/shm/var, fails in docker with "no space on disk" as there is no such device prepared perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 # or just one test perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 main.plugin_auth
          otto Otto Kekäläinen added a comment - - edited

          Side note: tested rr, but can't get it recording with default settings due to

          root@4c7529dfa256:/usr/share/mysql/mysql-test# rr record -n perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 main.plugin_auth
          [FATAL /build/rr-S0CLEN/rr-5.3.0/src/PerfCounters.cc:317:start_counter() errno: EPERM] Failed to initialize counter
          === Start rr backtrace:
          rr(_ZN2rr13dump_rr_stackEv+0x5a)[0x557e6c93d65a]
          rr(_ZN2rr15notifying_abortEv+0x50)[0x557e6c93d6f0]
          rr(_ZN2rr12FatalOstreamD1Ev+0x54)[0x557e6c865184]
          rr(+0xcd7e0)[0x557e6c87f7e0]
          rr(+0xce7cd)[0x557e6c8807cd]
          rr(_ZN2rr12PerfCounters23default_ticks_semanticsEv+0x20)[0x557e6c881290]
          rr(_ZN2rr7SessionC2Ev+0x13f)[0x557e6c90be5f]
          rr(_ZN2rr13RecordSessionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS6_SaIS6_EESD_RKNS_20DisableCPUIDFeaturesENS0_16SyscallBufferingEiNS_7BindCPUES8_PKNS_9TraceUuidE+0x54)[0x557e6c8918e4]
          rr(_ZN2rr13RecordSession6createERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EESB_RKNS_20DisableCPUIDFeaturesENS0_16SyscallBufferingEhNS_7BindCPUERKS7_PKNS_9TraceUuidE+0x46e)[0x557e6c89211e]
          rr(_ZN2rr13RecordCommand3runERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x700)[0x557e6c8868a0]
          rr(main+0x282)[0x557e6c8088a2]
          /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f6af9d8b0b3]
          rr(_start+0x2e)[0x557e6c8089ee]
          === End rr backtrace
          Aborted (core dumped)
           
          root@4c7529dfa256:/usr/share/mysql/mysql-test# rr record perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 main.plugin_auth
          rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 3.
          Change it to 1, or use 'rr record -n' (slow).
          Consider putting 'kernel.perf_event_paranoid = 1' in /etc/sysctl.conf
          

          otto Otto Kekäläinen added a comment - - edited Side note: tested rr, but can't get it recording with default settings due to root@4c7529dfa256:/usr/share/mysql/mysql-test# rr record -n perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 main.plugin_auth [FATAL /build/rr-S0CLEN/rr-5.3.0/src/PerfCounters.cc:317:start_counter() errno: EPERM] Failed to initialize counter === Start rr backtrace: rr(_ZN2rr13dump_rr_stackEv+0x5a)[0x557e6c93d65a] rr(_ZN2rr15notifying_abortEv+0x50)[0x557e6c93d6f0] rr(_ZN2rr12FatalOstreamD1Ev+0x54)[0x557e6c865184] rr(+0xcd7e0)[0x557e6c87f7e0] rr(+0xce7cd)[0x557e6c8807cd] rr(_ZN2rr12PerfCounters23default_ticks_semanticsEv+0x20)[0x557e6c881290] rr(_ZN2rr7SessionC2Ev+0x13f)[0x557e6c90be5f] rr(_ZN2rr13RecordSessionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS6_SaIS6_EESD_RKNS_20DisableCPUIDFeaturesENS0_16SyscallBufferingEiNS_7BindCPUES8_PKNS_9TraceUuidE+0x54)[0x557e6c8918e4] rr(_ZN2rr13RecordSession6createERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EESB_RKNS_20DisableCPUIDFeaturesENS0_16SyscallBufferingEhNS_7BindCPUERKS7_PKNS_9TraceUuidE+0x46e)[0x557e6c89211e] rr(_ZN2rr13RecordCommand3runERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x700)[0x557e6c8868a0] rr(main+0x282)[0x557e6c8088a2] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f6af9d8b0b3] rr(_start+0x2e)[0x557e6c8089ee] === End rr backtrace Aborted (core dumped)   root@4c7529dfa256:/usr/share/mysql/mysql-test# rr record perl mysql-test-run.pl --verbose-restart --parallel=4 --force --retry=3 --max-save-core=0 --max-save-datadir=1 main.plugin_auth rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 3. Change it to 1, or use 'rr record -n' (slow). Consider putting 'kernel.perf_event_paranoid = 1' in /etc/sysctl.conf
          otto Otto Kekäläinen added a comment - Fixed in https://github.com/MariaDB/server/pull/1478
          otto Otto Kekäläinen added a comment - PR merged, https://github.com/MariaDB/server/commit/87a7968c23d32880920d129c0e3f467495dce10d on 10.5 now.

          People

            cvicentiu Vicențiu Ciorbaru
            otto Otto Kekäläinen
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.