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: 97
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

root@host:~# mysql_config_editor set --user=da_admin --password --socket=/usr/local/mysql/data/mysql.sock
Enter password:
root@host:~# 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: 97
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: 97
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
JetappsCris
Staff Member
Staff Member
Posts: 33
Joined: December 1st, 2021, 2:12 am

Re: Partially completed on DirectAdmin

Post by JetappsCris »

Hi ArashiInteractive,

Thank you for reaching out to us.
Our team strives to develop secure, reliable, and cutting-edge backup technology for the web hosting industry and goes through a rigorous development and testing process, which includes an ALPHA release program that gathers alpha testers and early adopters to help collect bugs and feedback while we continue with our development.

This helps us ensure that our releases pass a well-defined set of criteria for a public release and mitigate bugs to the least amount possible while continuing to implement new features. Once we release a public version of JetBackup5, we follow our standard release cycle of EDGE -> BETA -> STABLE, initially with a lengthy timeframe in between each tier while we collect client feedback and gradually increase our pace of up to ~1 month between tiers.

Your feedback and the feedback of others are greatly appreciated as it allows us to continually provide updates that make JetBackup 5 more secure and reliable.

Always feel free to reach out to us to let us know if you run into any other issues or have any questions.
Best Regards,
Cristofer, JetApps Team
Nickske00
Posts: 3
Joined: January 31st, 2022, 10:28 pm

Re: Partially completed on DirectAdmin

Post by Nickske00 »

Also having this issue on Debian 11 with version 5.2.5 (and MariaDB). I have tried creating a .my.cnf for the root and admin user, but none help... Should I switch to edge tier to test 5.2.6? Or is there another thing I can do to make this work.

EDIT: Can confirm version 5.2.6 is working perfectly.
JetappsCris
Staff Member
Staff Member
Posts: 33
Joined: December 1st, 2021, 2:12 am

Re: Partially completed on DirectAdmin

Post by JetappsCris »

Hi Nicksken00,

Thank you for reaching out to us via our forums. Yes, at the moment, this issue was resolved in our 5.2.6 EDGE tier. If you would like to upgrade, please use the following commands:

Code: Select all

jetapps -t jetbackup5-directadmin edge
jetapps -u jetbackup5-directadmin
Then, to stay on STABLE for future updates, you can run this command after the upgrade is complete:

Code: Select all

jetapps -t jetbackup5-directadmin stable
You can view this release in our changelogs: Case JB5-DA #78

And as always, if you have any other questions or issues, please feel free to reach out to us.
Best Regards,
Cristofer, JetApps Team
Post Reply