home-assistant / addons

:heavy_plus_sign: Docker add-ons for Home Assistant
https://home-assistant.io/hassio/
Apache License 2.0
1.51k stars 1.47k forks source link

It 's not visible .keep files #3707

Closed ops244 closed 1 week ago

ops244 commented 1 month ago

Describe the issue you are experiencing

hi, the problem is this: the motion eye add-on creates a file.keep it on the disk, but the samba share add-on does not see it and because of this an error occurs when deleting files via motioneye (1 - screenshot) 2 - screenshot that this file is not visible through samba share 3 the screenshot was taken through the router's explorer, the file is there 2024-07-30_17-32-47


Снимок экрана 2024-07-30 173409


2024-07-30_17-35-01

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Samba share

What is the version of the add-on?

12.3.2

Steps to reproduce the issue

1. 2. 3. ... .

System Health information

.

Anything in the Supervisor logs that might be useful for us?

.

Anything in the add-on logs that might be useful for us?

.

Additional information

No response

as-kholin commented 1 month ago

@ops244 - I am pretty sure this is just a translation issue, as Samba tries to translate Linux file system rules to Windows.

In Linux, any file that begins its name with a period is hidden.

Samba is translating Linux file system into SMB, which Windows can read - but that involves handling how those are different as well.

On my side, if I create a 'dot file' (I used .temp), it immediately disappears, like you describe. But, it is actually there - its just hidden in Linux, so Linux told Windows it was hidden, so Windows followed that direction and hid it from me.

To see it, on the Windows side, you need to tell Windows explorer to show you hidden files. In Windows 11, from the folder, that would be View -> Show -> Hidden Items (other versions of Windows will do it other ways - but all versions have a way to do that).

Once you do that, you will be able to see and manipulate the file (the Icon will show ghosted, but that's just telling you, again, that it is hidden).

Note that this applies across the computer - show hidden will let you see any hidden files, not just this one. If that becomes annoying, you may need to turn off hidden items after.

ops244 commented 1 month ago

Well, yes, that's how you can see him. And then why can't motioneye delete it, writes that there is no access? how can I give this access? (motion eye is connected via samba, screenshot attached) At the same time, motioneye creates it itself, but cannot delete it... 2024-07-31_03-55-19

ops244 commented 1 month ago

at the same time, through the explorer, he allows it to be deleted through confirmation that it is a system one, maybe somehow it can be done so that he does not hide it and does not consider it a system one? (it deletes it through the router's explorer without confirming that it is a system one)

as-kholin commented 1 month ago

The issue is that motioneye is making assumptions on what it sees - it is assuming that creating a dot-file, it will be able to see it. And, it is smart enoght to say 'I cannot delete a file that is not there', while also not doing the extra work to look for a hidden file.

Creating the file, or even writing to it, works fine - so long as you can see it.

Linux assumes that should be hidden. So hides it.

Since the file is there and accessible, this is not the Samba HA Plug-in that is not working as it should. And, while the full Samba install can make this work differently, this is the default config, and is the way it is set today (and I would question if adding a setting to change that would be the best choice).

That said - I'll defer to the maintainers for if a PR for this would be preferred.

ops244 commented 1 month ago

the fact is that this problem is at least 3 years old and it is not only me ... (the fixes described there do not help me, unfortunately) https://github.com/motioneye-project/motioneye/issues/1810

as-kholin commented 1 month ago

Agreed. And that issue is likely the correct place to fix the issue. The various comments on it are not all, or even most, from those using Samba HA Plug-in.

Samba HA plug-in is a minimal overhead presentation of specific shares. But that also means it generally sticks to defaults and does not include all of the flexibility and configurability of a full Samba install.

Motioneye could address this multiple ways in their code (even something as simple as trying to open the file without checking if it's there first). That would also be correct as the issue is not specific to Samba HA Plug-in (but to cases of Samba installs using default settings generally)

github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.