YYYY-MM-DDTHH:MM:SS [20240709-122522-23788036] [MainProcess:PID-4270] [FtpStorageIOLib::_process_curl_output:FtpStorageIOLib.py:133] ERROR: sftp cmd failed. RC: 79, Err: curl: (79) Could not open directory for reading: Bad message from SFTP server
vCenter 7.x
As part of the backup process, when the vCenter executes a curl command to list the available backup directory, a successful response is returned if the target directory exists.
In cases where the directory does not exist, the expected behavior is for curl to return error code 78 (remote file not found) or 19 (resolved FTP error).
However, in some environments that utilize a specific variant of an SFTP server, curl returns the error code 79 instead. This deviation from standard behavior appears to be environment-specific.
This issue is resolved in 8.x versions of the vCenter
As a workaround, we can update the logic to treat the return error code (79) as a valid response indicating a non-existent directory. When this error is encountered, the system will proceed to create the directory as expected.
Workaround
We can edit the list of expected responses on the vCenter to add curl(79) to resolve this issue
/usr/lib/applmgmt/backup_restore/py/vmware/appliance/backup_restore/plugins/FtpStorageIOLib.py
cp /usr/lib/applmgmt/backup_restore/py/vmware/appliance/backup_restore/plugins/FtpStorageIOLib.py /usr/lib/applmgmt/backup_restore/py/vmware/appliance/backup_restore/plugins/FtpStorageIOLib.py.orig
/usr/lib/applmgmt/backup_restore/py/vmware/appliance/backup_restore/plugins/FtpStorageIOLib.py
as below:if (cmd_res.returncode in [
CurlEC.DOWNLOAD_FAILED, CurlEC.REMOTE_FILE_NOT_FOUND,
CurlEC.REMOTE_ACCESS_DENIED]):
return False
if (cmd_res.returncode in [
CurlEC.DOWNLOAD_FAILED, CurlEC.REMOTE_FILE_NOT_FOUND,
CurlEC.REMOTE_ACCESS_DENIED, 79]):
return False
3. Retry the backup