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

mariabackup restore looking for folder that doesn't exist

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.4.22
    • N/A
    • Backup
    • None
    • source Win64 dest RHEL 8

    Description

      Trying to use mariabackup to migrate a database from Windows to Linux:

      On the source server (mariabackup based on MariaDB server 10.4.11-MariaDB Win64 (AMD64))

      mariabackup --backup --target-dir=e:\mbk --user=user --password=thepassword
      mariabackup --prepare --target-dir=e:\mbk

      I copy the backup to the destination system (mariabackup based on MariaDB server 10.4.22-MariaDB Linux (x86_64))

      mariabackup --copy-back --target-dir=/var/lib/mysql

      mariabackup based on MariaDB server 10.4.22-MariaDB Linux (x86_64)
      2021-12-22 11:21:28 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2021-12-22 11:21:28 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
      [01] 2021-12-22 11:21:28 error: cannot open file ibdata1
      [01] 2021-12-22 11:21:28 Error: copy_file() failed.

      If I run mariabackup --copy-back without a target-dir specified it does this which is totally unexpected:

      mariabackup --copy-back
      mariabackup based on MariaDB server 10.4.22-MariaDB Linux (x86_64)
      mariabackup: Can't change dir to '/mbkagain/mbk/xtrabackup_backupfiles/' (errno: 2 "No such file or directory")
      [00] 2021-12-22 11:22:26 Can't my_setwd /mbkagain/mbk/xtrabackup_backupfiles/

      I suspect the reason that it cannot find the files in xtrabackup_backupfiles is because there is no xtrabackup_backupfiles folder created on the source server....(???)

      Does anybody know why the Windows version of mariabackup doesn't create the xtrabackup_backupfiles folder or why the Linux version expects that it will?

      Which one is "incorrect"?

      Attachments

        Activity

          wlad Vladislav Vaintroub added a comment - - edited

          ZCT, the target-dir is the directory where backup is, or where it needs to be created by --backup mode . It is needed by all of mariabackup modes (backup, prepare, copy-back).

          If it is not set, the default value is xtrabackup_backupfiles in current directory.

          I hope this answers your original question. For your followup questions, that do not have anything in common with the original one (except obviously the reporter), it is better to create a new bug.

          wlad Vladislav Vaintroub added a comment - - edited ZCT , the target-dir is the directory where backup is, or where it needs to be created by --backup mode . It is needed by all of mariabackup modes (backup, prepare, copy-back). If it is not set, the default value is xtrabackup_backupfiles in current directory. I hope this answers your original question. For your followup questions, that do not have anything in common with the original one (except obviously the reporter), it is better to create a new bug.
          ZCT Drew W added a comment -

          I am pretty disappointed that it took 7 months to get this looked at and nobody really even bothered to read the bug report. If there is not a bug why are these errors:

          2021-12-22 11:21:28 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
          2021-12-22 11:21:28 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
          [01] 2021-12-22 11:21:28 error: cannot open file ibdata1
          [01] 2021-12-22 11:21:28 Error: copy_file() failed.

          thrown after moving the data to the target host and running this command:

          mariabackup --copy-back --target-dir=/var/lib/mysql

          Did you actually test anything? I spent about three weeks trying to get this to work and it still does not work.

          ZCT Drew W added a comment - I am pretty disappointed that it took 7 months to get this looked at and nobody really even bothered to read the bug report. If there is not a bug why are these errors: 2021-12-22 11:21:28 0 [ERROR] InnoDB: Operating system error number 2 in a file operation. 2021-12-22 11:21:28 0 [ERROR] InnoDB: The error means the system cannot find the path specified. [01] 2021-12-22 11:21:28 error: cannot open file ibdata1 [01] 2021-12-22 11:21:28 Error: copy_file() failed. thrown after moving the data to the target host and running this command: mariabackup --copy-back --target-dir=/var/lib/mysql Did you actually test anything? I spent about three weeks trying to get this to work and it still does not work.
          wlad Vladislav Vaintroub added a comment - - edited

          ZCT, let me clarify something.
          You create a bug report where you complain about "mariabackup restore looking for folder that doesn't exist". I closed it with the explanation that you need to use --target-dir parameter whenever you uzse mariabackup with --backup, --prepare , or --copy-back. And the original synopsis of this report is classified as "Not a bug" therefore. mariabackup needs to look for backup in some folder, and if you do not say in which, it will try its default, and it is not guaranteed to exist.

          The followup questions you asked do not have anything to do with your original question, except obviously, the reporter. We do not use a single bug report as a dialog, to report all of reporters troubles in comments section. Instead, we use one unique problem - one MDEV( bug report) approach. I tried to point this out in the last comment and it seems I did not succeed. It might be disappoiting for you, and we're sorry to hear that, but this approach to bug reporting is ubiquitious, and frankly, I have not seen alternatives yet. So, could you please create a new report (with "how to reproduce") about another problem that you have. Thank you.

          To answer "did you test", yes, there is automated test suite for mariabackup which is done on each push into github. It does cover backup, prepare and copy-back. It does not cover cross-plattform backups.

          wlad Vladislav Vaintroub added a comment - - edited ZCT , let me clarify something. You create a bug report where you complain about "mariabackup restore looking for folder that doesn't exist". I closed it with the explanation that you need to use --target-dir parameter whenever you uzse mariabackup with --backup, --prepare , or --copy-back. And the original synopsis of this report is classified as "Not a bug" therefore. mariabackup needs to look for backup in some folder, and if you do not say in which, it will try its default, and it is not guaranteed to exist. The followup questions you asked do not have anything to do with your original question, except obviously, the reporter. We do not use a single bug report as a dialog, to report all of reporters troubles in comments section. Instead, we use one unique problem - one MDEV( bug report) approach. I tried to point this out in the last comment and it seems I did not succeed. It might be disappoiting for you, and we're sorry to hear that, but this approach to bug reporting is ubiquitious, and frankly, I have not seen alternatives yet. So, could you please create a new report (with "how to reproduce") about another problem that you have. Thank you. To answer "did you test", yes, there is automated test suite for mariabackup which is done on each push into github. It does cover backup, prepare and copy-back. It does not cover cross-plattform backups.
          ZCT Drew W added a comment -

          Okay this bug report was about cross platform backup/restore to prepare for replication. So if you didnt test then I dont know how you came to the conclusion that there was no bug.

          ZCT Drew W added a comment - Okay this bug report was about cross platform backup/restore to prepare for replication. So if you didnt test then I dont know how you came to the conclusion that there was no bug.

          This report was about "mariabackup restore looking for folder that doesn't exist", that is still the name of this bug. Maybe there is some bug somewhere, bug that (Can't my_setwd /mbkagain/mbk/xtrabackup_backupfiles/) is not a bug.

          wlad Vladislav Vaintroub added a comment - This report was about "mariabackup restore looking for folder that doesn't exist", that is still the name of this bug. Maybe there is some bug somewhere, bug that (Can't my_setwd /mbkagain/mbk/xtrabackup_backupfiles/) is not a bug.

          People

            wlad Vladislav Vaintroub
            ZCT Drew W
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.