Web lists-archives.com

[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@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

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba