tracker
tracker copied to clipboard
[Fileserver] Can't connect to shares via iPhone Files app
As reported by @debemdeboas - see original here: https://github.com/turnkeylinux/tracker/issues/1861#issuecomment-1822658157:
My Samba shares (via smb://<address> on the iPhone Files app) don’t connect at all. I’ve tried a plethora of different configurations (e.g. setting vfs fruit aces to no - or something similar, I don’t recall specifics), and none of them work. I’ve noticed two scenarios:
- When connecting with smb://<address>, I encounter a “Socket is not connected” error
- When using smb://<address>/<share path>, I can connect but I can’t access the files. I can only see the root share path, and it’s set as “read only” (it shouldn’t, this share is writeable by other devices)
After what you said about the Web interface, I decided to try and access the files via the WebDAV CGI file manager and, as you’ve already stated, nothing pops up - no files, nothing. Funny thing is I can list the files when using the Webmin interface under Tools -> File manager; however, the Webmin interface doesn’t like being accessed on mobile it seems and the left menu doesn’t “stick”, it appears and disappears, so moving around was a pain.
If you like, I can share my Samba configuration file, and I’m open to helping in any way that I can.
Some background: I used to have a TrueNAS Scale instance but migrated to Proxmox. On TrueNAS, Samba worked as well as it can (not very), so I ruled out any device-specific problems. Sadly, I don’t have access to that Samba configuration file anymore as I’ve wiped those drives.
After what you said about the Web interface, I decided to try and access the files via the WebDAV CGI file manager and, as you’ve already stated, nothing pops up - no files, nothing.
Hmm, that is weird although if you're not accessing it via a Nginx proxy, I don't think that's related to #1861 either...!? I suspect that that may well be another issue altogether... :face_exhaling:
Funny thing is I can list the files when using the Webmin interface under Tools -> File manager; however, the Webmin interface doesn’t like being accessed on mobile it seems and the left menu doesn’t “stick”, it appears and disappears, so moving around was a pain.
Yeah Webmin isn't ideal on small screen devices (although FWIW, it is mostly usable under Android). Assuming that I understand correctly, the fact that you can view and edit files via Webmin's Filemanager is not super surprising to me. Webmin is a completely separate application and runs under it's own minimalist web server (so no Apache, no Samba). And when using the Webmin Filemanager, you're interacting directly with Webmin which is interacting directly with the files on the filesystem (i.e. again no Samba/SMB component).
If you like, I can share my Samba configuration file, and I’m open to helping in any way that I can.
I doubt that it will help tons, please feel free to share your samba config. IIRC there shouldn't be anything secret in it, but please double check and redact anything that might be personal or sensitive (or looks like a randomly generated string). If you do redact, please be sure to only replace the minimal amount of text with something obvious (so I can see what has been redacted at a glance).
Some background: I used to have a TrueNAS Scale instance but migrated to Proxmox. On TrueNAS, Samba worked as well as it can (not very), so I ruled out any device-specific problems. Sadly, I don’t have access to that Samba configuration file anymore as I’ve wiped those drives.
That's potentially useful info.
First, perhaps there is something in their (i.e. TrueNAS) default config that might be working around the issue you're hitting?
Although another factor is likely that they appear to be packaging Samba themselves and it looks like they're using a newer version (v4.18.x) than we are (we just use the version in Debian - which in v18.x is v4.17.x). Also they may be applying custom patches - perhaps to work around issues such as these? I didn't dig in deep enough to see whether that may be the case or not. If we can pin point the exact changes that they make to make it "just work" with Apple stuff, then we may be able to get that into Debian (or if it's just config - apply it ourselves).
To check the former would require checking the TrueNAS config. I don't have time ATM but if you wanted to test that, you could try launching a local test instance of TrueNAS as a VM on Proxmox (I've never tried but AFAIK it should work). Double check that it works as expected and assuming that it does, extract the Samba config. Then apply that config to your TurnKey Fileserver and see if that helps. If not, then it may just be the version, or could be a combo of both (i.e. newer version with specific config) or something else (e.g. a custom patch they're adding to samba source code; or compile time options, etc).
To check the latter will be a fair bit easier as Bookworm backports has Samba v4.18.x. We ship with a preconfigured (but disabled) by default backports source list. So to enable backports on a TurnKey v18.x server and install the newer Samba, try this (as root):
mv /etc/apt/sources.list.d/debian-backports.list.disabled /etc/apt/sources.list.d/debian-backports.list
apt update
apt install -t bookworm-backports samba
Winding back to the default packages is not quite so easy (and technically Debian doesn't support downgrading package versions; but it should work ok). I just tested the below and it currently works, but will likely be fragile and require tweaking (of the specific version) for future readers:
apt install -y --allow-downgrades samba=2:4.17.12+dfsg-0+deb12u1 python3-samba=2:4.17.12+dfsg-0+deb12u1 samba-common=2:4.17.12+dfsg-0+deb12u1 samba-common-bin=2:4.17.12+dfsg-0+deb12u1 samba-libs=2:4.17.12+dfsg-0+deb12u1
As an aside and a hint to future readers; to determine the desired version to downgrade to, check the output of apt policy
. FWIW here's the current output (after I removed samba altogether - I'm just using Core as my test machine) with backports enabled):
# apt policy samba
samba:
Installed: (none)
Candidate: 2:4.17.12+dfsg-0+deb12u1
Version table:
2:4.18.8+dfsg-1~bpo12+1 100
100 http://deb.debian.org/debian bookworm-backports/main amd64 Packages
2:4.17.12+dfsg-0+deb12u1 500
500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages
2:4.17.11+dfsg-0+deb12u1 500
500 http://deb.debian.org/debian bookworm/main amd64 Packages
As you can likely see, the version string I'm using in the above command (2:4.17.12+dfsg-0+deb12u1
) comes from bookworm-security
(which is generally what you want - although double check as after a Debian point release, a newer version might end up in bookworm/main
).
@debemdeboas - just circling back to this.
After re-reading my posts above, it occurs to me that I was somewhat jumping the gun. I missed it at the time of posting, but we haven't released v18.0 Fileserver yet. So my talk about bookworm-backports
won't apply (v17.x = Debian 11/Bullseye, v18.x = 12/Bookworm).
That means that the version of Samba included with v17.x is much older than that. Although IIRC we were already using a backported package to workaround Windows issues/changes. So perhaps just updating to the latest backport might be enough to get you a newer package.
As TurnKey is Debian under the hood, you could just do a "Debian style in place upgrade" to get newer versions?
Regardless, it may still be workable on the current appliance, but as I don't have any apple products, I can't test. I suspect that it's probably worth waiting to see if it "just works" on v18.x. The newer Samba version might just be enough?