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

InnoDB should and can be more specific with errno: 168 "Unknown (generic) error from engine". The output for MyISAM, Aria and RocksDB can also be improved.

Details

    Description

      In some cases (see MDEV-19449 or upstream https://bugs.mysql.com/bug.php?id=86253 for examples) InnoDB returns error 168 to the user with a generic error message that is not useful at all, while in error log it produces way more specific messages pointing out the root cause. Consider this test case from upstream bug mentioned above:

      MariaDB [test]> drop table t1;
      Query OK, 0 rows affected (0.416 sec)
       
      MariaDB [test]> CREATE TABLE t1(c1 INT KEY,old1 DOUBLE,new1 DOUBLE,old2 DOUBLE,new2 DOUBLE);
      Query OK, 0 rows affected (2.031 sec)
       
      MariaDB [test]> RENAME TABLE t1 TO doesnotexist.t1;
      ERROR 1025 (HY000): Error on rename of '.\test\t1' to '.\doesnotexist\t1' (errno: 168 "Unknown (generic) error from engine")
      

      The error says nothing to the user about the reason of the problem. In the error log we see:

      2019-06-24 19:08:58 9 [ERROR] InnoDB: Operating system error number 3 in a file operation.
      2019-06-24 19:08:58 9 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2019-06-24 19:08:58 9 [ERROR] InnoDB: File .\test\t1.ibd: 'rename' returned OS error 203.
      

      that is way more specific. I think that returning a generic "Unknown" error when the reason for the error is well known is wrong.

      Attachments

        Issue Links

          Activity

            Na3omy Neama Ageb added a comment - - edited

            I have the same issue too ... I have MariaDB 10.6
            My customer tries to do some upgrades in his applications ... during this upgrade he is trying to rename some tables or alter some fields in the existing tables, and he got the same error too.
            rename table portal_policy_information to portal_bbc_budget2;
            ERROR 1025 (HY000): Error on rename of './SUITE_OVERHEIDSLOKET_RELEASE/portal_policy_information' to './SUITE_OVERHEIDSLOKET_RELEASE/portal_bbc_budget2' (errno: 168 "Unknown (generic) error from engine")

            ALTER TABLE SUITE_OVERHEIDSLOKET_RELEASE.portal_policy_information MODIFY id INT AUTO_INCREMENT;
            ERROR 1025 (HY000): Error on rename of './SUITE_OVERHEIDSLOKET_RELEASE/portal_policy_information' to './SUITE_OVERHEIDSLOKET_RELEASE/#sql-backup-d1586-2f8c9' (errno: 168 "Unknown (generic) error from engine")

            Na3omy Neama Ageb added a comment - - edited I have the same issue too ... I have MariaDB 10.6 My customer tries to do some upgrades in his applications ... during this upgrade he is trying to rename some tables or alter some fields in the existing tables, and he got the same error too. rename table portal_policy_information to portal_bbc_budget2; ERROR 1025 (HY000): Error on rename of './SUITE_OVERHEIDSLOKET_RELEASE/portal_policy_information' to './SUITE_OVERHEIDSLOKET_RELEASE/portal_bbc_budget2' (errno: 168 "Unknown (generic) error from engine") ALTER TABLE SUITE_OVERHEIDSLOKET_RELEASE.portal_policy_information MODIFY id INT AUTO_INCREMENT; ERROR 1025 (HY000): Error on rename of './SUITE_OVERHEIDSLOKET_RELEASE/portal_policy_information' to './SUITE_OVERHEIDSLOKET_RELEASE/#sql-backup-d1586-2f8c9' (errno: 168 "Unknown (generic) error from engine")

            Na3omy Looks related. You can check the error log for more information.

            Roel Roel Van de Paar added a comment - Na3omy Looks related. You can check the error log for more information.
            Na3omy Neama Ageb added a comment -

            Hello
            it seems this issue exist in MariaDB 10.6.4 but not exist in MariaDB 10.6.7.
            I did a manual installation to 10.6.7 and my issue is fixed.

            Na3omy Neama Ageb added a comment - Hello it seems this issue exist in MariaDB 10.6.4 but not exist in MariaDB 10.6.7. I did a manual installation to 10.6.7 and my issue is fixed.

            I suspect the underlying issue disappeared whereas the original description of this ticket remains as-is. Thank you for the update!

            Roel Roel Van de Paar added a comment - I suspect the underlying issue disappeared whereas the original description of this ticket remains as-is. Thank you for the update!

            A few more examples:

            11.4.0-dbg>CREATE TABLE t (c INT) ENGINE=INNODB PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (4) DATA DIRECTORY = '/foo' ENGINE = INNODB, PARTITION p2 VALUES LESS THAN (8) DATA DIRECTORY = '/bar' ENGINE = INNODB);
            ERROR 1005 (HY000): Can't create table `test`.`t` (errno: 168 "Unknown (generic) error from engine")
            

            Leads to:

            11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug)

            2024-02-16  9:42:09 4 [ERROR] InnoDB: Operating system error number 13 in a file operation.
            2024-02-16  9:42:09 4 [ERROR] InnoDB: The error means mariadbd does not have the access rights to the directory.
            

            And:

            ln -s /dev/shm/var /dev/shm/foo  # Neither should exist before running this command, this creates a broken link from foo -> var
            

            11.4.0-dbg>CREATE TABLE t (c INT) ENGINE=INNODB PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (4) DATA DIRECTORY = '/dev/shm/foo' ENGINE = INNODB, PARTITION p2 VALUES LESS THAN (8) DATA DIRECTORY = '/dev/shm/foo' ENGINE = INNODB); 
            ERROR 1005 (HY000): Can't create table `test`.`t` (errno: 168 "Unknown (generic) error from engine")
            

            Leads to:

            11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug)

            2024-02-16  9:57:12 4 [ERROR] InnoDB: File /dev/shm/foo/test was not found
            

            Roel Roel Van de Paar added a comment - A few more examples: 11.4.0-dbg> CREATE TABLE t (c INT ) ENGINE=INNODB PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (4) DATA DIRECTORY = '/foo' ENGINE = INNODB, PARTITION p2 VALUES LESS THAN (8) DATA DIRECTORY = '/bar' ENGINE = INNODB); ERROR 1005 (HY000): Can't create table `test`.`t` (errno: 168 "Unknown (generic) error from engine" ) Leads to: 11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug) 2024-02-16 9:42:09 4 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2024-02-16 9:42:09 4 [ERROR] InnoDB: The error means mariadbd does not have the access rights to the directory. And: ln -s /dev/shm/var /dev/shm/foo # Neither should exist before running this command, this creates a broken link from foo -> var 11.4.0-dbg> CREATE TABLE t (c INT ) ENGINE=INNODB PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (4) DATA DIRECTORY = '/dev/shm/foo' ENGINE = INNODB, PARTITION p2 VALUES LESS THAN (8) DATA DIRECTORY = '/dev/shm/foo' ENGINE = INNODB); ERROR 1005 (HY000): Can't create table `test`.`t` (errno: 168 "Unknown (generic) error from engine" ) Leads to: 11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug) 2024-02-16 9:57:12 4 [ERROR] InnoDB: File /dev/shm/foo/test was not found

            People

              vlad.lesin Vladislav Lesin
              valerii Valerii Kravchuk
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.