LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2023, 09:50 PM   #1
LinuxOnly
Member
 
Registered: Jan 2004
Distribution: Kubuntu / Xubuntu
Posts: 40

Rep: Reputation: 0
File transfer fails: iPhone to Samba on Ubuntu


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
 
Old 07-13-2023, 12:26 PM   #2
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 783

Rep: Reputation: 250Reputation: 250Reputation: 250
Strange. Maybe play with the encoding or crank the logging up to see if there's more clues.

Code:
[global]
        unix charset = UTF-8
        dos charset = 850

        log level = 3 lanman:4 smb:4 auth:4
 
Old 07-14-2023, 09:28 PM   #3
LinuxOnly
Member
 
Registered: Jan 2004
Distribution: Kubuntu / Xubuntu
Posts: 40

Original Poster
Rep: Reputation: 0
So I set the two charsey parameters and set loglevel=4.
With a different image I now get another error message:
Code:
The operation can't be completed because some data in "IMG_1683.jpeg" can't be read or written. (Error code -36)
But diff of log.smbd before and after this event is empty. Where does the extra logging go?

FWIW, I had also changed the firewall rules to be explicit:
Code:
139,445/tcp                ALLOW       192.168.1.0/24             # Samba tcp
137,138/udp                ALLOW       192.168.1.0/24             # Samba udp
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.

Last edited by LinuxOnly; 07-14-2023 at 10:11 PM.
 
Old 07-16-2023, 08:06 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
In the [homes] section of my smb.conf, I have
Code:
; For iPhone
   vfs objects = catia fruit streams_xattr
Further details here

Last edited by allend; 07-16-2023 at 08:17 PM.
 
Old 07-16-2023, 11:27 PM   #5
LinuxOnly
Member
 
Registered: Jan 2004
Distribution: Kubuntu / Xubuntu
Posts: 40

Original Poster
Rep: Reputation: 0
Thank you but it didn't work for me. After reading the reference you provided I added to the Global section:
Code:
fruit:aapl = yes
fruit:nfs_aces = yes
fruit:model = MacSamba
and in the [Public] share:
Code:
    vfs objects = catia fruit streams_xattr
    fruit:resource = file
    fruit:time machine = no
    fruit:metadata = netatalk
    fruit:locking = none
    fruit:encoding = private
    fruit:veto_appledouble = yes
    fruit:posix_rename = yes
    readdir_attr:aapl_rsize = yes
    readdir_attr:aapl_finder_info = yes
    readdir_attr:aapl_max_access = no
    fruit:wipe_intentionally_left_blank_rfork = yes
    fruit:delete_empty_adfiles = yes
    fruit:zero_file_id = yes
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?
 
Old 07-17-2023, 09:14 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
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.
 
1 members found this post helpful.
Old 07-17-2023, 09:46 AM   #7
LinuxOnly
Member
 
Registered: Jan 2004
Distribution: Kubuntu / Xubuntu
Posts: 40

Original Poster
Rep: Reputation: 0
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?
 
Old 07-17-2023, 10:27 AM   #8
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
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
 
1 members found this post helpful.
Old 07-17-2023, 12:27 PM   #9
LinuxOnly
Member
 
Registered: Jan 2004
Distribution: Kubuntu / Xubuntu
Posts: 40

Original Poster
Rep: Reputation: 0
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

Last edited by LinuxOnly; 07-17-2023 at 12:29 PM.
 
Old 08-11-2023, 12:07 AM   #10
geoffp
LQ Newbie
 
Registered: Aug 2023
Posts: 2

Rep: Reputation: 0
Talking Fruit works!

Adding
Code:
vfs objects = catia fruit streams_xattr
to my smb.conf under the [global] heading seems to have done the trick for me.

Thanks for the fix!
 
Old 08-11-2023, 10:29 AM   #11
LinuxOnly
Member
 
Registered: Jan 2004
Distribution: Kubuntu / Xubuntu
Posts: 40

Original Poster
Rep: Reputation: 0
Addendum

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?
 
Old 08-11-2023, 09:02 PM   #12
geoffp
LQ Newbie
 
Registered: Aug 2023
Posts: 2

Rep: Reputation: 0
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.

Should be easy to test though!
 
Old 04-06-2024, 10:32 AM   #13
Mati
LQ Newbie
 
Registered: Apr 2024
Posts: 1

Rep: Reputation: 0
aye

Quote:
Originally Posted by geoffp View Post
Adding
Code:
vfs objects = catia fruit streams_xattr
to my smb.conf under the [global] heading seems to have done the trick for me.

Thanks for the fix!
For me this also solved the issuse.
 
  


Reply

Tags
iphone, samba, smbd, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tftp transfer fails with "Transfer timed out." exception bupthebroker Linux - Software 4 05-15-2018 02:33 PM
For Sales. Iphone 8gb Nokia n95 8gb Lrg Sidekick 3 Iphone 4g bigbrother1 Linux - Enterprise 2 01-30-2008 12:49 PM
For Sales. Iphone 8gb Nokia n95 8gb Lrg Sidekick 3 Iphone 4g bigbrother1 Linux - Newbie 1 01-28-2008 01:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration