Maxim Khitrov
2017-Sep-27 12:50 UTC
[Samba] Debugging robocopy error 87 - The parameter is incorrect
Hi, I have Samba 4.6 running on FreeBSD 11.1 with a ZFS file system. Trying to use robocopy to mirror files from Windows 8.1. Most of the files are copied without any issues, but a few fail with the following error in the robocopy log: ERROR 87 (0x00000057) Copying File <path> The parameter is incorrect. Robocopy is executed with the following options: /X /NDL /S /E /DCOPY:DAT /COPY:DAT /TIMFIX /PURGE /MIR /J /NP /IT /XJD /R:0 /W:30 Enabling level 3 logging for Samba, this error seems to correspond with the following messages: [2, class=vfs] vfswrap_fsctl (0x90284): Currently not implemented. [3] smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_INVALID_DEVICE_REQUEST] || at ../source3/smbd/smb2_ioctl.c:309 [2] <user> closed file <path> (numopen=2) NT_STATUS_OK The error appears to be semi-random. If I delete the destination directory and mirror it a second time, it's not always the same files that run into this problem. Furthermore, if I run robocopy a second time without deleting the destination, some (but not all) of the files that failed to copy the first time are copied fine the second. The few that still fail on the second run continue to fail on all subsequent runs. I don't think it has anything to do with permissions, timestamps, or anything else that would cause this error to be deterministic. There is also no obvious pattern in file location or size. Some files are over a gig, others are a few hundred KB in size. Copying to another directory on the source system works fine. My smb.conf is below. I looked at smb2_ioctl.c source, but didn't get much out of that without knowing what the client is trying to do. Does anyone have some suggestions on how to debug this problem? Thanks, Max [global] access based share enum = yes client min protocol = SMB2 host msdfs = no restrict anonymous = 2 server min protocol = SMB2 unix extensions = no workgroup = WORKGROUP # cache and lock directories are tmpfs cache directory = /var/db/samba4/cache lock directory = /var/db/samba4/lock state directory = /var/db/samba4 # max open files defaults to kern.maxfilesperproc, but has a hard-coded limit of # 65536 - FILE_HANDLE_OFFSET(4096) - MAX_OPEN_PIPES(2048). max open files = 59392 # Service defaults csc policy = disable directory name cache size = 0 hide dot files = no strict sync = yes vfs objects = zfsacl # Permissions (map archive = no is needed for inherit permissions) force unknown acl user = yes inherit permissions = yes map archive = no map readonly = no store dos attributes = yes # Logging (0=LOG_ERR, 1=LOG_WARNING, 2=LOG_NOTICE, 3=LOG_INFO, 4+=LOG_DEBUG) debug class = yes debug hires timestamp = no debug pid = no debug prefix timestamp = yes debug uid = no logging = syslog at 0 file log level = 1 # Disable NetBIOS disable netbios = yes smb ports = 445 # Disable printing (keep spoolss enabled to avoid warnings on each connection) load printers = no printcap cache time = 0 printcap name = /dev/null # Disable unnecessary RPC services rpc_server:epmapper = disabled #rpc_server:winreg = disabled #rpc_server:srvsvc = disabled #rpc_server:lsarpc = disabled #rpc_server:samr = disabled rpc_server:netlogon = disabled rpc_server:netdfs = disabled #rpc_server:dssetup = disabled rpc_server:wkssvc = disabled rpc_server:spoolss = disabled rpc_server:svcctl = disabled rpc_server:ntsvcs = disabled rpc_server:eventlog = disabled rpc_server:initshutdown = disabled rpc_server:mdssvc = disabled [tmp] path = /zfs/tmp writeable = yes
Jeremy Allison
2017-Sep-30 00:46 UTC
[Samba] Debugging robocopy error 87 - The parameter is incorrect
On Wed, Sep 27, 2017 at 08:50:59AM -0400, Maxim Khitrov via samba wrote:> Hi, > > I have Samba 4.6 running on FreeBSD 11.1 with a ZFS file system. > Trying to use robocopy to mirror files from Windows 8.1. Most of the > files are copied without any issues, but a few fail with the following > error in the robocopy log: > > ERROR 87 (0x00000057) Copying File <path> > The parameter is incorrect. > > Robocopy is executed with the following options: > > /X /NDL /S /E /DCOPY:DAT /COPY:DAT /TIMFIX /PURGE /MIR /J /NP /IT /XJD > /R:0 /W:30 > > Enabling level 3 logging for Samba, this error seems to correspond > with the following messages: > > [2, class=vfs] vfswrap_fsctl (0x90284): Currently not implemented. > [3] smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] > status[NT_STATUS_INVALID_DEVICE_REQUEST] || at > ../source3/smbd/smb2_ioctl.c:309 > [2] <user> closed file <path> (numopen=2) NT_STATUS_OKAh, that is FSCTL_QUERY_FILE_REGIONS, which we don't implement yet. Until we do, you'll have to experiment with robocopy options until you find the one that triggers this FSCTL call. Jeremy.
Maybe Matching Threads
- Robocopy from Windows to Samba (3.6.3) with backup flag
- Migration of files with Windows ACL's to Samba server
- Samba shows error NT Status: STATUS_OBJECT_NAME_NOT_FOUND when copying 10GB file using robocopy when ecryptfs file system shared using samba
- Robocopy, archive bit and ACLs
- Dreaded ERROR 5 In Robocopy