Partially completed on DirectAdmin

Web hosting environments are constantly evolving. DirectAdmin stays in-step with today’s most sophisticated solutions.
Post Reply
ArashiInteractive
Posts: 4
Joined: October 28th, 2021, 6:14 am

Partially completed on DirectAdmin

Post by ArashiInteractive »

I've recently installed JetBackup on DirectAdmin. I've setup incremental daily backups; often I'll get a Partially Completed warning with the following error in the logs:

[28/Oct/2021 04:02:49 +0000] [PID 2858890] [ERROR] Failed exporting database data. Database Handler Error: Failed export MySQL database "database_name". Error: mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" when trying to connect

Other apps using the databases (WordPress and others) are all able to connect. How would I resolve this issue?

Thanks in advanced for your time.
JetAppsRichard
Staff Member
Staff Member
Posts: 96
Joined: January 1st, 2021, 12:51 am

Re: Partially completed on DirectAdmin

Post by JetAppsRichard »

Hello,

Thank you for reaching out through our forums. I would like to note that we have received similar reports of this issue before with the current version of JetBackup 5 DirectAdmin and have an open issue #JB5DA-78 to track it. To clarify, JetBackup generates a temporary database_auth_----.cnf file to pass to mysqldump --defaults-file. It appears that because JetBackup does not explicitly define the socket in the mysqldump command itself and uses the --defaults-file flag, mysqldump is using only the options given in the specified file and defaulting to /tmp/mysql.sock even on DA+Ubuntu systems where this is not the correct path. This is obviously not intended behavior, and we will be resolving it in a future version.

With that said, some review of the official MySQL Documentation reveals that mysqldump will read a .mylogin.cnf file even if --defaults-file is specified:
--defaults-file=file_name : Use only the given option file. If the file does not exist or is otherwise inaccessible, an error occurs. If file_name is not an absolute path name, it is interpreted relative to the current directory.
Exception: Even with --defaults-file, client programs read .mylogin.cnf.
(https://dev.mysql.com/doc/refman/5.7/en ... aults-file)

A potential workaround would be to generate the .mylogin.cnf file using the mysql_config_editor configuration utility to specify the socket while logged in as ROOT.

There is information on the mysql_config_editor utility here: https://dev.mysql.com/doc/refman/5.7/en ... ditor.html

Code: Select all

[email protected]:~# mysql_config_editor set --user=da_admin --password --socket=/usr/local/mysql/data/mysql.sock
Enter password:
[email protected]:~# stat /root/.mylogin.cnf
  File: /root/.mylogin.cnf
This will generate an encrypted /root/.mylogin.cnf file, and we found that this would allow JB5 to backup and restore Databases properly on Ubuntu+DirectAdmin servers on our internal test environment.

Unfortunately, there's no way to resolve this from the JetBackup side until a new version is released by our development team. If you'd like, you can try the workaround above and let us know if this resolves the restore issue.

Thank you very much for taking the time to report this issue! If we can further assist in any way, please let us know and be sure to follow our Release Notes and Changelog for updates on when this issue will be resolved.
Best Regards,
Richard, JetApps Team
ArashiInteractive
Posts: 4
Joined: October 28th, 2021, 6:14 am

Re: Partially completed on DirectAdmin

Post by ArashiInteractive »

Hi, thanks for your reply.

Yes, I should have specified that I'm running DA on Ubuntu 20.04. Do you know how I might use this work around for a server running MariaDB instead of MySQL? https://mariadb.com/kb/en/mysql_config_ ... atibility/ suggests there is no equivalent for MariaDB.

Any roadmap, or timeline for when this will be addressed in an official release?
JetAppsRichard
Staff Member
Staff Member
Posts: 96
Joined: January 1st, 2021, 12:51 am

Re: Partially completed on DirectAdmin

Post by JetAppsRichard »

Hello,

Thank you for the update and for claryifing your use case. As you noted, MariaDB does not support the use of `mysql_config_editor` however, you should still be able to manually create this file and fill in the required fields. To do so please create the file .mylogin.cnf at `/root/.mylogin.cnf` and fill out the following fields:

Code: Select all

[client] 
host='<your-db-host>' 
port='<your-db-port>' 
socket='/usr/local/mysql/data/mysql.sock'  
user='root' 
password='<your-db-password>'
After configuring the .cnf manually, JetBackup should be able to use this file as the --defaults-file. Please let us know if the issue persists.
Best Regards,
Richard, JetApps Team
ArashiInteractive
Posts: 4
Joined: October 28th, 2021, 6:14 am

Re: Partially completed on DirectAdmin

Post by ArashiInteractive »

I've manually created the .mylogin.cnf file as per your instructions which is found at /root/.mylogin.cnf Root is the owner of the file, does it require any special permissions?

Running a backup still gives the same error:
[04/Nov/2021 00:04:57 +0000] [PID 96585] JetBackup Version: 5.1.14 Panel Version: DirectAdmin 5.1.14 (STABLE)
[04/Nov/2021 00:05:10 +0000] [PID 96901] - Database "DBNAME"

[04/Nov/2021 00:05:10 +0000] [PID 96901] [ERROR] Failed exporting database data. Database Handler Error: Failed export MySQL database "DBNAME". Error: mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" when trying to connect

I've tested the login/password using mysql command line tool, all seems to work there. Any further thoughts?
JetAppsRichard
Staff Member
Staff Member
Posts: 96
Joined: January 1st, 2021, 12:51 am

Re: Partially completed on DirectAdmin

Post by JetAppsRichard »

Hello,

There are no specific permissions the file must have in order to work. There does seem to be some differences as to how mysqldump reads the .cnf files on MariaDB compared to MySQL. I was able to replicate this issue on a similar environment (Ubuntu + DirectAdmin + MariaDB 10.4) and have opened an internal issue to avoid these problems in future versions (JB5-DA-CASE#78). In the meantime, kindly open a support ticket at [email protected] so our team may further investigate.
Best Regards,
Richard, JetApps Team
ArashiInteractive
Posts: 4
Joined: October 28th, 2021, 6:14 am

Re: Partially completed on DirectAdmin

Post by ArashiInteractive »

Hi,

Thanks for your help thus far. I've sent an email to support to hopefully expedite a solution. I am a little curious as to how the product was released for DirectAdmin without it being able to complete a backup on a supported OS: https://docs.directadmin.com/getting-st ... rview.html
Post Reply