[SOLVED] File transfer fails: iPhone to Samba on Ubuntu
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to transfer files using the Files app between an iPhone 8 running iOS 16.5.1 and a PC running Xubuntu 22.04. I am posting it here because SMB transfer to a Synology NAS works fine so I don't blame the phone.
An attempt to upload e.g. a file "IMG_8833.JPG" to the PC results in an error message on the phone:
Code:
The operation couldn't be completed. File name too long
I have also seen it, with smaller files, give the same error but put a zero-length file with the correct -full- name into the target directory.
The upload directory is defined thus in /etc/samba/smb.conf (output of testparm):
Code:
[global]
bind interfaces only = Yes
client min protocol = NT1
interfaces = eno1
log file = /var/log/samba/log.%m
logging = file
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
security = USER
server role = standalone server
server string = %h server (Samba, Ubuntu)
unix password sync = Yes
usershare allow guests = Yes
idmap config * : backend = tdb
[Public]
comment = Public directory
create mask = 0775
guest ok = Yes
path = /home/steinbach/Public
read only = No
I have done smbpasswd -a and smbpasswd -e with my login, and I have the firewall open for Samba (ufw status):
Code:
To Action From
-- ------ ----
Samba ALLOW 192.168.1.0/24
The end of /var/log/samba/log.smbd is
Code:
2023/07/12 16:34:30.549598, 0] ../../source3/smbd/server.c:1734(main)
smbd version 4.15.13-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2021
Is this an encoding issue? The word encoding does not appear in smb.conf. The phone shows the contents of the Public directory but it's all grayed out.
Any pointers? Any other information I should post?
Thank you
Another addendum, how do I get to the error message on the iPhone:
I go to Files, hit Select, check one file in Downloads, then hit the folder icon at the bottom, navigate to Shared and the line for the PC (id'ed by its IP address). That displays an icon for the Public directory and at the bottom of the page 1 item, x read-only. That is wrong, the file x is not there anymore, I deleted it yesterday. When I tap on Public it says, correctly, "Folder is empty" and at the top appears copy. Tapping that results in the error message listed above.
Then I ran systemctl restart smbd and tried copying 2 images to the Samba share. Now I get the error: Input/output error.
BTW, before I navigate into the share it still shows the non existing file. I wonder whether that is a clue?
Anyway, thank you for trying to help.
Any other things to try?
Your settings in the {Global] section are unnecessary. Samba will use the settings as they are the defaults.
Some settings in the {Public] section have settings that are different from the defaults.
Specifically:
Code:
readdir_attr:aapl_max_access = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
Perhaps try commenting out all but the 'vfs objects = catia fruit streams_xattr' line.
I did as you suggested, allend, i.e. only the vfs objects line left, and after testparm and systemctl restart smbd the result is still Input/output error.
Any other ideas?
Sorry, no more ideas. I have the same phone and iOS version and have no problems using the Files app to connect to my Linux PC via Samba using the additional configuration I described.
My share definition looks like this:
Code:
[ShareName]
comment = <user>'s stuff
path = /home/<user>/Desktop
valid users = <user>
public = no
writable = yes
printable = no
create mask = 0765
vfs objects = catia fruit streams_xattr
Oh well.......
So I copied your setup exactly, restarted smbd, and it still said "Input/output error when trying to copy files there.
Then it occurred to me to "eject" and and reconnect to the server on the phone, and voila, it works! So I assume the vfs objects line is really all it took, and the phone just doesn't read any new connection parameters from the server unless makes a new connection. Lesson learned.
Thank you very much for your help, allend
Good to hear it helped you, geoffp.
Just today I meant to add one more observation of my own: It is still annoying in that almost every day (but I'm not using it every day) the "input/output error" reappears and I have to "eject" the PC and reconnect. That always works but still, it is not necessary on the NAS. Now I am guessing the difference could be that I suspend the PC overnight so the phone gives up on it but the NAS is always up - any opinions on that?
I can’t say for sure, but I wouldn’t be at all surprised if suspending the PC forces you to re-establish the connection. Samba is a very server-y thing to do, and suspend / resume is not.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.