Problem backing up some accounts via sftp

MoreK

Member
Feb 15, 2016
14
1
53
Helsinki, Finland
cPanel Access Level
Root Administrator
Nightly backups have been working ok, but couple of days ago I started to get error reports. Some (not all) of the backup transports didn't succeed, with the message:
Unable to send “/backup/2016-04-01/accounts/murske.tar.gz” to destination “Hetzner u119436”

I checked all logs in /usr/local/cpanel/logs/cpbackup_transporter, but it didn't give any further information. However, the /usr/local/cpanel/logs/error_log has this information for every failed account:

[2016-03-31 02:02:30 +0300] info [cpbackup_transporter] Instantiating Object
[2016-03-31 02:02:30 +0300] info [cpbackup_transporter] Validating destination path /2016-03-31
[2016-03-31 02:02:30 +0300] info [cpbackup_transporter] Path exists
[2016-03-31 02:02:30 +0300] info [cpbackup_transporter] Uploading /backup/2016-03-31/accounts/murske.tar.gz to /2016-03-31/murske.tar.gz
[2016-03-31 02:02:30 +0300] info [cpbackup_transporter] Attempting to upload /backup/2016-03-31/accounts/murske.tar.gz to /2016-03-31/murske.tar.gz for$
[2016-03-31 02:03:06 +0300] info [cpbackup_transporter] Error encountered
[2016-03-31 02:03:06 +0300] info [cpbackup_transporter] Error is not a reference Connection to remote server stalled
[2016-03-31 02:03:06 +0300] info [cpbackup_transporter] Error encountered
[2016-03-31 02:03:06 +0300] info [cpbackup_transporter] Error is not a reference Connection to remote server stalled
[2016-03-31 02:03:06 +0300] info [cpbackup_transporter] Error encountered
[2016-03-31 02:03:06 +0300] info [cpbackup_transporter] Error is not a reference Connection to remote server stalled

As said, most of the backup transports were ok, only the first five account transports fail.

Anyone, any ideas?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello :)

Do you notice any entries in the /var/log/secure file on the destination server related to the connection failure? Are there any firewall rules on the destination server that could be filtering or blocking certain connection attempts? Note that you may need to enable SFTP logging on the destination server per the instructions at:

Logging sftp commands - Red Hat Customer Portal

Thank you.
 

MoreK

Member
Feb 15, 2016
14
1
53
Helsinki, Finland
cPanel Access Level
Root Administrator
Hello :)

Do you notice any entries in the /var/log/secure file on the destination server related to the connection failure? Are there any firewall rules on the destination server that could be filtering or blocking certain connection attempts?

Thank you.
No log entries in /var/log/secure related to the problem. And no FW rules in destination that may block connection. Note that rest of the backups work ok over the same connection.

I just checked last night logs and everything worked ok! So, this concerned only five accounts last week, in two consecutive nights.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
I just checked last night logs and everything worked ok! So, this concerned only five accounts last week, in two consecutive nights.
I'm happy to see it's now working as expected. You may want to ensure SFTP logging is enabled on the destination server so additional logs are available in the event this happens again.

Thank you.
 

MoreK

Member
Feb 15, 2016
14
1
53
Helsinki, Finland
cPanel Access Level
Root Administrator
Just a short follow-up on this. The problems came back some time ago. I noticed that backups actually were copied to destination, I just received these error messages.

I had updated MySQL to 5.6 earlier. However I didn't update EasyApache & PHP at that time, but left it to version 5.5, based on some information I found from somewhere, can't remember where. Yesterday I was forced to update EasyApache PHP to 5.6, due to some errors with new WordPress version. This morning I took a look at the logs and... no backup errors!

Looks like that MySQL 5.6 + PHP 5.5 combination was somehow related to the errors. If someone gets same issues, it may be worth of checking MySQL and PHP versions.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
It's possible the two issues are unrelated, as FTP is a separate service that does not rely upon Apache/PHP/MySQL. Let us know if you encounter any additional issues.

Thank you.
 

MoreK

Member
Feb 15, 2016
14
1
53
Helsinki, Finland
cPanel Access Level
Root Administrator
A quick follow-up for those who might be struggling with the same issue. The probable reason, after all, seemed to be the Timeout value in SFTP section in backup settings. It defaults to 60 seconds. I doubled it to 120 a week ago and haven't had the problem ever since.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
A quick follow-up for those who might be struggling with the same issue. The probable reason, after all, seemed to be the Timeout value in SFTP section in backup settings. It defaults to 60 seconds. I doubled it to 120 a week ago and haven't had the problem ever since.
I'm happy to see you were able to address the issue after modifying the timeout value. Thank you for updating us with the outcome.