Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > File Transfer

Reply
 
Thread Tools Display Modes
  #1  
Old 03-19-2018, 12:00 PM
npbrewer npbrewer is offline
Registered User
 
Join Date: Mar 2018
Posts: 1
Exclamation vShell sftp backup for cPanel errors

Hi all,

First time poster.

I recently started a position with a new company that is having cPanel backup transport errors to vShell.

Server information:
Windows Server 2008 R2 Standard
vShell Version: 3.8.4 (x64 build 354)

Our internal cPanel Web/DNS server is configured to do backups to this vShell server nightly.

The sftp user authenticates properly and Actual Backups complete fine but cPanel is unable to prune (remove) old backups and is sending transport notifications daily. Obviously this is problematic as it will fill up the data drive.

------------------------------------------------------------

vShell logs are reporting this error (IPs removed):

2018-03-18 02:03:10 VShellSSH2 conn 3373 x.x.x.x 57310 <internal>\ns03backups - - 0 0 0 0 - - "03373: Received request to start subsystem sftp (Built-in Subsystem)"
2018-03-18 02:03:10 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: SFTP subsystem initialized; remote version is 3"
2018-03-18 02:03:10 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: Sending VERSION packet to remote (3)"
2018-03-18 02:03:10 VShellSSH2 auth 3373 - - <internal>\ns03backups - - 0 0 0 0 - - "03373: Using home directory 'E:\ftproot\ns03backups\' for user <internal>\ns03backups"
2018-03-18 02:03:11 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: Failed to open directory '/ns03backups/2018-03-18/system': The system cannot find the path specified."
2018-03-18 02:03:11 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: Failed to stat file: '/ns03backups/2018-03-18/system' as user: ns03backups System Error: The system cannot find the path specified."
2018-03-18 02:03:11 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: Failed to stat file: '/ns03backups/2018-03-18' as user: ns03backups System Error: The system cannot find the file specified."
2018-03-18 02:03:11 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: ns03backups created directory '/ns03backups/2018-03-18'"
2018-03-18 02:03:11 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: ns03backups created directory '/ns03backups/2018-03-18/system'"
2018-03-18 02:03:11 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: ns03backups changed permissions on 'E:\ftproot\ns03backups\2018-03-18\system\system_files.tar' to '600'"
2018-03-18 02:04:12 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - E:\ftproot\ns03backups\2018-03-18\system\system_files.tar 0 601180160 0 601180160 x.x.x.x 22 "03373: <internal>\ns03backups has accessed 'E:\ftproot\ns03backups\2018-03-18\system\system_files.tar': 601180160 bytes uploaded"
2018-03-18 02:04:12 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - E:\ftproot\ns03backups\2018-03-18\system\system_files.tar 0 601180160 0 601180160 x.x.x.x 22 "03373: Trigger executed command: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File E:\ftpscripts\vShellTrigger.ps1 -strbytes 601180160 -strErrorCode 0 -strIPAddress x.x.x.x -strUploadPath E:\ftproot\ns03backups\2018-03-18\system\system_files.tar -strTime 02:04:12 -strUser <internal>\ns03backups"
2018-03-18 02:04:12 VShellSSH2 sftp 3373 x.x.x.x 57310 ns03backups - - 0 0 0 0 x.x.x.x 22 "03373: SFTP subsystem terminated"

--------------------------------------------------------------

Here is the error being reported by the cPanel backup process:

Unable to prune transport “x.x.x.x”
Unable to remove outdated backup: “Cpanel::Transport::Files::_perms_str2oct” was given an invalid permissions string: 0

--------------------------------------------------------------

As you can see it's attempting to locate old backups and then delete them.

The folders and files it's attempting to locate DO exist.

Can anyone help me figure out what's going on here? Please let me know if there is any other info I can provide to help the troubleshooting process.

Thanks in advance for any help!
Reply With Quote
  #2  
Old 03-19-2018, 03:44 PM
berdmann berdmann is online now
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 236
Hi npbrewer,

Quote:
---------------------------------------------------------------------
Unable to prune transport “x.x.x.x”
Unable to remove outdated backup: “Cpanel::Transport::Files::_perms_str2oct” was given an invalid permissions string: 0
---------------------------------------------------------------------
This error is referenced on cPanel's site:

- https://forums.cpanel.net/threads/ca...ackups.390332/

What I can't tell is if this problem has been resolved in a newer version of the cPanel client or not; the data on the posting I've linked to above seems to indicate it's not yet fixed.

Perhaps the job of the _perms_str2oct function is designed to turn a UNIX style permissions field (rwxrwxrwx) into an octal representation (e.g. 777).

If so, it suggests the "Cpanel" sftp client may be trying to parse the sftp "long file listing" format which the SFTP protocol spec says clients should *not* do. Here's a snippet from the SFTP v3 protocol spec:

---------------------------------------------------------------------
The format of the `longname' field is unspecified by this protocol. It MUST be suitable for use in the output of a directory listing command (in fact, the recommended operation for a directory listing command is to simply display this data). However, clients SHOULD NOT attempt to parse the longname field for file attributes; they SHOULD use the attrs field instead.

The recommended format for the longname field is as follows:

-rwxr-xr-x 1 mjos staff 348911 Mar 25 14:29 t-filexfer
---------------------------------------------------------------------

One of the reasons why this longname field SHOULD NOT be parsed by SFTP clients is that the recommended format doesn't account for the fact that an SFTP server might be running on a Windows machine for which the style of permissions present on a Linux machine does not apply (the '-rwxr-xr-x' in the recommended format shown above). VShell on Windows presents things to clients in the way that Windows file listing (MSDOS) would be presented. There is a registry-only configuration setting that one can use to tell VShell to provide a UNIX style listing in order to attempt to achieve compatibility with clients that disregard the protocol specification:

HKLM\Software\VanDyke\VShell\Server\Use UNIX Format For SFTP File Listing (set the value to 1, default is 0)

One possible way cPanel's limited client *might* be able to work with VShell on Windows is if you enable the "Use UNIX Format for SFTP File Listing" option described above.

Even after setting the option to have VShell return UNIX style long file listings so that broken SFTP clients can parse these successfully, it *may* still fail when the cPanel SFTP client gets the long permissions listing in Unix format because there is no accurate translation from NTFS permissions to UNIX style permissions.
__________________
Thanks,
--Brittney

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:18 PM.