Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My sharing works well under Windows 10 and Android but not under MacOs #294

Closed
sylvek opened this issue Apr 4, 2020 · 17 comments
Closed
Assignees

Comments

@sylvek
Copy link

sylvek commented Apr 4, 2020

Hello,
I'm starting my samba server with this command-line

docker run -d --name samba  --restart always --net=host -v /mnt/disk1/sauvegarde:/sauvegarde dperson/samba -s "sauvegarde;/sauvegarde;yes;no;yes" -n -r -w "debian"

Sadly, it does not work on my 2 Mac computer.
I can read files but can not upload anything (file is created with 0 byte and an alert box is displayed)

Everything goes fine on Windows 10 and Android phone.

docker logs :

[2020/04/04 15:02:41.857523,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
  daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
smbd version 4.11.5 started.
Copyright Andrew Tridgell and the Samba Team 1992-2019
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
[2020/04/04 15:03:04.334270,  0] ../../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server DEBIAN is now a local master browser for workgroup DEBIAN on subnet 172.17.0.1

  *****
[2020/04/04 15:03:04.337036,  0] ../../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server DEBIAN is now a local master browser for workgroup DEBIAN on subnet 192.168.0.4

  *****
fruit_pread_meta_stream: Removing [c78ed17c07e070b33063f3be1babf47c 2.jpeg:AFP_AfpInfo] after short read [0]
fruit_pwrite_meta_stream: On-demand create [c78ed17c07e070b33063f3be1babf47c 2.jpeg:AFP_AfpInfo] in write failed: No such file or directory

Filesystem

sylvek@debian:~$ ls -lrth /mnt/disk1/sauvegarde/
total 128K
drwxrwxrwx  6 sylvek sylvek  32K févr. 20 07:51 photos
drwxrwxrwx 11 sylvek sylvek  32K févr. 21 07:31 Documents
-rwxrwxrwx  1 sylvek sylvek 3,1K mars   4 20:10 c78ed17c07e070b33063f3be1babf47c.jpeg
drwxrwxrwx  4 sylvek sylvek  32K avril  3 19:00 sylvek
-rwxrwxrwx  1 sylvek sylvek    0 avril  4 17:10 c78ed17c07e070b33063f3be1babf47c 2.jpeg

c78ed17c07e070b33063f3be1babf47c 2.jpeg is the file that i try to upload

Capture d’écran 2020-04-04 à 17 10 21

@sylvek
Copy link
Author

sylvek commented Apr 4, 2020

more details :)
my dperson/samba image :
dperson/samba latest 1104709cbefa 10 days ago 48.5MB

MacOs Catalina 10.15.3 (19D76)

i'm searching samba known issues side ...

@sylvek
Copy link
Author

sylvek commented Apr 4, 2020

maybe my trouble more concerns samba interaction with macos => https://www.samba.org/samba/docs/4.10/man-html/vfs_fruit.8.html. I prefer closing this issue.. 👋

@sylvek sylvek closed this as completed Apr 4, 2020
@sylvek
Copy link
Author

sylvek commented Apr 5, 2020

the problem is coming from streams_xattr, without.. everything works fine.

@sylvek
Copy link
Author

sylvek commented Apr 5, 2020

is there a raison to use it?

@sylvek sylvek reopened this Apr 5, 2020
@dperson dperson self-assigned this Apr 11, 2020
@dperson
Copy link
Owner

dperson commented Apr 11, 2020

The samba documentation you referenced says that vfs_fruit should be stacked with vfs_catia and vfs_streams_xattr... so that's why it was enabled.

I think I might have found the issue though, try the latest container.

@sylvek
Copy link
Author

sylvek commented Apr 12, 2020

thks @dperson! i've just tried your last image and it doesn't work :-/

@dperson
Copy link
Owner

dperson commented Apr 12, 2020

Can you try the latest once more, please?

@sylvek
Copy link
Author

sylvek commented Apr 12, 2020

▶ docker pull dperson/samba
Using default tag: latest
latest: Pulling from dperson/samba
aad63a933944: Already exists
7a9a6a25913c: Pull complete
6797d610f4cf: Pull complete
Digest: sha256:1caf4500f58977b4845c13d9603d5863f2fa855281590170e8a1cdd48fd67143
Status: Downloaded newer image for dperson/samba:latest
docker.io/dperson/samba:latest

sorry same issue :-/

@xupefei
Copy link

xupefei commented Apr 13, 2020

I have encountered a similar same issue in macOS 10.15.4: given any file I copied to the SMB share, there are two logs:

fruit_pread_meta_stream: Removing [xxx.bmp:AFP_AfpInfo] after short read [0]
fruit_pread_meta_stream: Removing [xxx.bmp:AFP_AfpInfo] failed

After some research, I found that this issue is due to fruit:metadata = stream. In the source code of Samba, the size of the :AFP_AfpInfo stream is at minimum AFP_INFO_SIZE=0x3c. Then, when a file does not have a :AFP_AfpInfo stream, the read size is 0 and the above error logs are written to the stdout: https://github.com/samba-team/samba/blob/master/source3/modules/vfs_fruit.c#L2086.

Regarding the OP's error:

fruit_pwrite_meta_stream: On-demand create [c78ed17c07e070b33063f3be1babf47c 2.jpeg:AFP_AfpInfo] in write failed: No such file or directory

This issue is also caused by the fruit:metadata = stream, as you can see here: https://github.com/samba-team/samba/blob/master/source3/modules/vfs_fruit.c#L2609

===========

The solution would be falling back to the default solution, fruit:metadata = netatalk, which use xattr DosStream.com.apple.metadata to store such resources that looks like this:

$ attr -l xxx.png
Attribute "DOSATTRIB" has a 32 byte value for xxx.png
Attribute "DosStream.com.apple.metadatakMDItemWhereFroms:$DATA" has a 149 byte value for xxx.png

@sylvek
Copy link
Author

sylvek commented Apr 13, 2020

hi @xupefei !
thank you for your report. I did what you said (replaced stream by netatalk) but, i had an another issue (error code -50).

fruit_pwrite_meta_netatalk: ad_pwrite [c78ed17c07e070b33063f3be1babf47c copie.jpeg:AFP_AfpInfo] failed

@dperson
Copy link
Owner

dperson commented Apr 14, 2020

Thanks @xupefei @sylvek ! I made the recommended change, I hope it helps.

@xupefei
Copy link

xupefei commented Apr 14, 2020

hi @xupefei !

thank you for your report. I did what you said (replaced stream by netatalk) but, i had an another issue (error code -50).


fruit_pwrite_meta_netatalk: ad_pwrite [c78ed17c07e070b33063f3be1babf47c copie.jpeg:AFP_AfpInfo] failed

What format does your storage partition have? Is it exfat or fat32?

@sylvek
Copy link
Author

sylvek commented Apr 14, 2020

fat32 in this case 👍

@sylvek
Copy link
Author

sylvek commented Apr 14, 2020

@dperson i've just tried the last image.. and i had an error, again :(
the only solution that seems working is to remove streams_xattr

@xupefei
Copy link

xupefei commented Apr 14, 2020

fat32 in this case 👍

Fat32 does not support ADS stream which results in error. You might want to use NTFS or ext4 or xfs.

@dperson
Copy link
Owner

dperson commented Apr 14, 2020

@xupefei I'm glad you thought of that, I wasn't thinking of the filesystem, but yes it will have to support extended attributes. I've always used a real Linux one.

@sylvek
Copy link
Author

sylvek commented Apr 14, 2020

You feel luckier than me sadly .. i made the opposite choice - my computer is linked with an usb hdd and i wanted to focus on the readability instead of consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants