bvhme
(Bo)
May 3, 2023, 6:17am
1
I would like to report that whilst using samba connection in some add ons I would keep getting a CIFS error of Stale File Handle in the Transmission add-on.
Turns out the Fritz.Box is not doing file serving properly and can’t be used without tweaking the mount command.
mount, samba, cifs, smb
This was also filling up my drive rapidly with logs that weren’t cleared on reboot and that were quite a treasure hunt to find.
I ended up moving my drive to Home Assistant and using the Samba NAS add-on instead.
(Posting here because I wished somebody had before me)
1 Like
Thank you, this helped me.
There is also:
home-assistant:main
← home-assistant:mounts-noserverino
opened 04:25PM - 21 Jun 23 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
The default for cifs mounts is to use inodes from the server when possible (not always possible, in which case it falls back to generating inodes on the client). This is a problematic default because sometimes it creates issues like https://github.com/home-assistant/operating-system/issues/2585 . The benefit (being able to easily distinguish hardlinks) doesn't seem worth the risk.
Changing to always use client generated inodes as that should fix the stale file handle issue without really any downside to other users.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (which adds functionality to the supervisor)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes https://github.com/home-assistant/operating-system/issues/2585
- This PR is related to issue:
- Link to documentation pull request:
- Link to cli pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [ ] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] The code has been formatted using Black (`black --fast supervisor tests`)
- [ ] Tests have been added to verify that the new code works.
If API endpoints of add-on configuration are added/changed:
- [ ] Documentation added/updated for [developers.home-assistant.io][docs-repository]
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[docs-repository]: https://github.com/home-assistant/developers.home-assistant
opened 09:32PM - 27 Apr 23 UTC
closed 12:02PM - 11 May 23 UTC
stale
Hello,
unfortunately the following test did not work correctly in my case:
h… ttps://github.com/alexbelgium/hassio-addons/blob/584f5b5b15127f03a09ee72c0655a21b609b4e72/.templates/00-smb_mounts.sh#L119
It always validates with freshly created files and the `noserverino` will not be set as a mount option. But when accessing a file which was created from another network device an IOError will be thrown.
Fortunately I could fix it by myself with a small hack: Just add `,noserverino` as a suffix in the smb password field. This solution works, but is not elegant. I would recommend an own mountoption field in the advanced options, because I have no idea how to test reliably for server or client index nodes usage.
I found the solution here:
https://askubuntu.com/questions/1265164/stale-file-handler-when-mounting-cifs-smb-network-drive-from-fritz-router
especially: https://debianforum.de/forum/viewtopic.php?t=176154
which helped with some additional knowledge although I dont see the option in the mount I did with HA, its working from the addons.
//192.168.178.1/fritz.nas on /mnt/data/supervisor/share/TestFritz type cifs (rw,relatime,vers=3.1.1,cache=strict,username=fritz1234,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.171.1,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,rsize=65536,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1)