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

Server crashes when setting innodb_default_encryption_key_id after enabling hashicorp and test_sql_service plugins

    XMLWordPrintable

Details

    • Q1/2026 Server Maintenance

    Description

      --source include/have_innodb.inc
      --source hashicorp_plugin.inc
       
      --exec vault secrets disable flush_test > /dev/null
      --exec vault secrets enable -path /flush_test -version=2 kv > /dev/null
      --exec vault kv put /flush_test/1 data="59af70fb2f9f9e0acbff9af9c81dec91" > /dev/null
       
      --echo # restart the server with encryption
      --let $vault_defaults=--plugin-load-add=hashicorp_key_management --hashicorp-key-management-vault-url=$VAULT_ADDR/v1/flush_test/ --hashicorp-key-management-token=$VAULT_TOKEN
      --let $restart_parameters=$vault_defaults 
      --source include/restart_mysqld.inc
       
      INSTALL PLUGIN test_sql_service SONAME 'test_sql_service';
      SET GLOBAL innodb_default_encryption_key_id=4;
       
      --exec vault secrets disable flush_test > /dev/null
      

      Leads to

      CS 12.3.0 5879c85f505d3a11d4b8f479f2437416d8a1d724 (Optimized, Clang 18.1.3-11) Build 11/12/2025

       

      #0 mysql_audit_general (thd=0x0, event_subtype=1, error_code=<optimized out>, msg=msg@entry=0x7da59a1b2a80 "hashicorp: Key not found (key id: 4)") at /test/12.3_opt/sql/sql_audit.h:211
      #1 0x00005e54d1cf2b22 in my_message_sql (error=0, str=0x7da59a1b2a80 "hashicorp: Key not found (key id: 4)", MyFlags=1152) at /test/12.3_opt/sql/mysqld.cc:3388
      #2 0x00005e54d256d6c8 in my_printf_error (error=1105, format=<optimized out>, MyFlags=1152) at /test/12.3_opt/mysys/my_error.c:153
      #3 0x00007da5bf60b53a in get_data (js=0x7da59a1b2cf8, js_len=0x7da59a1b2d10, key_id=4, key_version=4294967295, response_str=...) at /test/12.3_opt/plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc:641
      #4 HCData::get_latest_version (this=0x7da5bf610420 <data>, key_id=4) at /test/12.3_opt/plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc:768
      #5 0x00005e54d2378bd5 in encryption_key_id_exists (id=4) at /test/12.3_opt/include/mysql/service_encryption.h:98
      #6 innodb_default_encryption_key_id_update (thd=0x7da4c4000c68, var=<optimized out>, var_ptr=0x5e5509e64a7c, save=0x7da59a1b2a80) at /test/12.3_opt/storage/innobase/handler/ha_innodb.cc:635
      #7 0x00005e54d1e146fb in sys_var_pluginvar::global_update (this=<optimized out>, thd=0x5e54d286d140 <null_clex_str>, var=<optimized out>) at /test/12.3_opt/sql/sql_plugin.cc:3704
      #8 0x00005e54d1d346f5 in sys_var::update (this=this@entry=0x5e550a1f5b90, thd=0x7da4c4000c68, var=var@entry=0x7da4c40157c0) at /test/12.3_opt/sql/set_var.cc:211
      #9 0x00005e54d1d35e49 in set_var::update (this=0x7da4c40157c0, thd=<optimized out>) at /test/12.3_opt/sql/set_var.cc:869
      #10 0x00005e54d1d35a89 in sql_set_variables (thd=thd@entry=0x7da4c4000c68, var_list=var_list@entry=0x7da4c40060a8, free=true) at /test/12.3_opt/sql/set_var.cc:750
      #11 0x00005e54d1df6e22 in mysql_execute_command (thd=thd@entry=0x7da4c4000c68, is_called_from_prepared_stmt=false) at /test/12.3_opt/sql/sql_parse.cc:4858
      #12 0x00005e54d1df0a61 in mysql_parse (thd=thd@entry=0x7da4c4000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7da59a1b34e0) at /test/12.3_opt/sql/sql_parse.cc:7895
      #13 0x00005e54d1deef7c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7da4c4000c68, packet=packet@entry=0x7da4c4008a39 "SET GLOBAL innodb_default_encryption_key_id=4", packet_length=packet_length@entry=45, blocking=true) at /test/12.3_opt/sql/sql_parse.cc:1878
      #14 0x00005e54d1df0e71 in do_command (thd=thd@entry=0x7da4c4000c68, blocking=true) at /test/12.3_opt/sql/sql_parse.cc:1417
      #15 0x00005e54d1f1c21d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5e550a7e7c58, put_in_cache=true) at /test/12.3_opt/sql/sql_connect.cc:1503
      #16 0x00005e54d1f1bfdf in handle_one_connection (arg=arg@entry=0x5e550a7e7c58) at /test/12.3_opt/sql/sql_connect.cc:1415
      #17 0x00005e54d22d5179 in pfs_spawn_thread (arg=0x5e550a7875f8) at /test/12.3_opt/storage/perfschema/pfs.cc:2198
      #18 0x00007da5bee9caa4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #19 0x00007da5bef29c6c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

      {format}

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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