Bug 11347 - macos finder error 36 when copy folder to samba 4.2.2
Summary: macos finder error 36 when copy folder to samba 4.2.2
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.2.2
Hardware: x64 Linux
: P5 critical (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-19 08:26 UTC by sascha
Modified: 2016-10-26 08:17 UTC (History)
3 users (show)

See Also:


Attachments
smb.log, smb.conf and a tcpdump on port 445 (243.18 KB, application/gzip)
2015-06-19 08:26 UTC, sascha
no flags Details
Minimal pcap of a reproducer (76.37 KB, application/vnd.tcpdump.pcap)
2015-12-10 14:56 UTC, Ralph Böhme
no flags Details
WIP Patch for master (107.84 KB, patch)
2015-12-21 06:40 UTC, Ralph Böhme
no flags Details
Patch for 4.3 cherry-picked from master (110.72 KB, patch)
2015-12-22 22:32 UTC, Ralph Böhme
jra: review+
Details
Patch for 4.2 cherry-picked from master (110.68 KB, patch)
2015-12-28 10:21 UTC, Ralph Böhme
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sascha 2015-06-19 08:26:18 UTC
Created attachment 11175 [details]
smb.log, smb.conf and a tcpdump on port 445

target server is 4.2.2 with catia fruit and streams_xattr enabled.

source is macos 10.9.5 connected to server with smb2

filecopy is fine

to copy a single folder or folder with subfolder/data throws error -36.
when copy a folder with subfolders and data, everything gets effectively copied but the finder throws this error on 
last write i assume.

but when i copy the subfolders with data (so not the root folder containing these subfolders and data), the finder
throws this error on the first folder copied to the server and stops there.

copied from client to server, or from server to same server via finder.
terminal copy is ok (did not use cp -X)

macos log says:
16.06.15 17:19:54,000 kernel[0]: smb_ntstatus_error_to_errno: Couldn't map ntstatus (0xc0000225) to errno returning EIO
16.06.15 17:19:54,000 kernel[0]: smb2fs_smb_cmpd_set_info: Second close failed 9
16.06.15 17:19:54,000 kernel[0]: smb_ntstatus_error_to_errno: Couldn't map ntstatus (0xc0000225) to errno returning EIO

server config is attached with testparm -v
server debug log level 10 and packet capture with 'tcpdump -s 0 -w mycapture.pcap port 445' is also attached
all three files as tar.gz

the pcap and log were created on capturing the copy event of a single folder called "DESKTOPFOLDER" from the
macos desktop to the server "SERVERFOLDER".

to avoid some save errors within adobe illustrator the macos client has enabled the follwing option in /etc/nsmb.conf:
[global]
file_ids_off=yes

the finder error -36 also occurs without this option set on the client.

the error stops as soon as streams_xattr are not set any longer.

with macos 10.10 yosemite the finder does not generate this error.

kind regards,
sascha
Comment 1 news 2015-11-05 12:10:21 UTC
we have the same problem here with samba 4.2.5 (sernet packages on debian jessie): 

copying folders using mac client (10.9, 10.10, 10.11) gives error -36. Afterwards the folder exists in the file system including the files, but the user rights of the folder are wrong. If the do "chmod u+x foldername" all works again.

disabling streams_xattr is no option as we use mac office 2011, too and files cannot be stored. 

We can provide further details if needed.
Comment 2 Ralph Böhme 2015-12-10 14:56:21 UTC
Created attachment 11704 [details]
Minimal pcap of a reproducer
Comment 3 Ralph Böhme 2015-12-21 06:40:36 UTC
Created attachment 11735 [details]
WIP Patch for master
Comment 4 Jeremy Allison 2015-12-21 17:09:18 UTC
Comment on attachment 11735 [details]
WIP Patch for master

Great work Ralph ! This is depressing though, as it now means we have to test for bug compatibility against not only all current versions of Windows, but also all current versions of the Mac OS X server.

Apple really screwed their customers when they created this thing :-(.

Cheers,

Jeremy.
Comment 5 Ralph Böhme 2015-12-22 22:32:45 UTC
Created attachment 11739 [details]
Patch for 4.3 cherry-picked from master

Patch for 4.2 needs some more love, pending.
Comment 6 Jeremy Allison 2015-12-22 23:48:30 UTC
Comment on attachment 11739 [details]
Patch for 4.3 cherry-picked from master

LGTM.
Comment 7 Ralph Böhme 2015-12-28 10:21:37 UTC
Created attachment 11747 [details]
Patch for 4.2 cherry-picked from master
Comment 8 Jeremy Allison 2015-12-28 17:29:06 UTC
Comment on attachment 11747 [details]
Patch for 4.2 cherry-picked from master

LGTM.
Comment 9 Jeremy Allison 2015-12-28 17:29:30 UTC
Re-assigning to Karolin for inclusion in 4.3.next, 4.2.next.
Comment 10 Karolin Seeger 2016-01-05 08:42:47 UTC
Pushed to autobuild-v4-[2|3]-test.
Comment 11 Karolin Seeger 2016-01-07 17:34:26 UTC
(In reply to Karolin Seeger from comment #10)
Pushed to both branches.
Closing out bug report.

Thanks!