Handle only CIFS mounts that were added via motionEye #2650

Open
opened 2026-02-28 01:16:44 -05:00 by deekerman · 11 comments
Owner

Originally created by @fdapport on GitHub (Sep 27, 2025).

I have update my home assistant last night to a new version. Unfortunately I have the following errors (see screen shots) . I have try to upload a backup but I cannot solve the issue. The home assistant run on raspberry PI4

Please help me to fix the problem

This is the error that I have in Motion Eye cam configuration

Image

My current software version

Image

My current motion eye version

Image

In the motion eye logs I have this errors

Image

This is the current screen shot of my cams

Image

Those are the currents versions that I have installed last night.

Image

Originally created by @fdapport on GitHub (Sep 27, 2025). I have update my home assistant last night to a new version. Unfortunately I have the following errors (see screen shots) . I have try to upload a backup but I cannot solve the issue. The home assistant run on raspberry PI4 Please help me to fix the problem This is the error that I have in Motion Eye cam configuration ![Image](https://github.com/user-attachments/assets/76ae5c24-814b-49a1-941b-16b1bc1b05f2) My current software version ![Image](https://github.com/user-attachments/assets/bfd25e39-ca4b-471a-baa9-a61f404a105d) My current motion eye version ![Image](https://github.com/user-attachments/assets/0aef7e16-e176-45e7-a041-543d186f004b) In the motion eye logs I have this errors ![Image](https://github.com/user-attachments/assets/c0087aa6-6d28-4443-acd6-f879c410c296) This is the current screen shot of my cams ![Image](https://github.com/user-attachments/assets/56629fc8-b2ca-469c-bc52-dfd2d56756e6) Those are the currents versions that I have installed last night. ![Image](https://github.com/user-attachments/assets/efd3e3d4-6eb8-4045-ac43-dfc62f6e90a1)
Author
Owner

@MichaIng commented on GitHub (Sep 28, 2025):

It fails to mount the CIFS share. Can you mount that one from console? Maybe that server is down. Though not sure why this affects the camera streams.

@MichaIng commented on GitHub (Sep 28, 2025): It fails to mount the CIFS share. Can you mount that one from console? Maybe that server is down. Though not sure why this affects the camera streams.
Author
Owner

@fdapport commented on GitHub (Sep 28, 2025):

I made another test this morning. I have create a new SD card from 16.2 HAOS image and then I have uploaded the backup of 2 days ago before any update. Same result. I thinks the issue is related with the upgrade of the HASO from 15.2 to 16.2. Anybody knows how I can create a fresh installation HAOS 15.2 on rpi4? thenks for the help

@fdapport commented on GitHub (Sep 28, 2025): I made another test this morning. I have create a new SD card from 16.2 HAOS image and then I have uploaded the backup of 2 days ago before any update. Same result. I thinks the issue is related with the upgrade of the HASO from 15.2 to 16.2. Anybody knows how I can create a fresh installation HAOS 15.2 on rpi4? thenks for the help
Author
Owner

@fdapport commented on GitHub (Sep 28, 2025):

after many test I have found that the motion eye works fine UNTIL I have the follow error message:

Image

After that motion eye stopped and not any aditional file is recorded from the cams

@fdapport commented on GitHub (Sep 28, 2025): after many test I have found that the motion eye works fine UNTIL I have the follow error message: ![Image](https://github.com/user-attachments/assets/113141d7-0aa5-4dea-b4fa-974e94f40979) After that motion eye stopped and not any aditional file is recorded from the cams
Author
Owner

@MichaIng commented on GitHub (Sep 29, 2025):

So this is the HA motionEye addon, right?

Now it fails to unmount the CIFS shares. Are those shares online? I need to look into the code, especially why failing mounts crash motionEye on such a level.

Might be related to HAOS Samba client as well. If you csn get console access, check via dmesg for kernel errors and checl whether you can mount those shares from there.

I guess things will work again once you removef the mounts from motionEye UI, but of course not a great solution if you need them.

@MichaIng commented on GitHub (Sep 29, 2025): So this is the HA motionEye addon, right? Now it fails to unmount the CIFS shares. Are those shares online? I need to look into the code, especially why failing mounts crash motionEye on such a level. Might be related to HAOS Samba client as well. If you csn get console access, check via `dmesg` for kernel errors and checl whether you can mount those shares from there. I guess things will work again once you removef the mounts from motionEye UI, but of course not a great solution if you need them.
Author
Owner

@MichaIng commented on GitHub (Sep 29, 2025):

Okay so the SMB mount/unmount calls are properly error-handled. Why they fails is something to check on OS level, not related to motionEye.

I guess you selected those mounts as target for your recordings, so it makes sense that those fail when the mounts fail.

Since motion handles recordings, snapshots etc, I guess the motion processes themselves fail, which leads to the additionally missing camera previous in motionEye UI.

@MichaIng commented on GitHub (Sep 29, 2025): Okay so the SMB mount/unmount calls are properly error-handled. Why they fails is something to check on OS level, not related to motionEye. I guess you selected those mounts as target for your recordings, so it makes sense that those fail when the mounts fail. Since `motion` handles recordings, snapshots etc, I guess the `motion` processes themselves fail, which leads to the additionally missing camera previous in motionEye UI.
Author
Owner

@fdapport commented on GitHub (Sep 29, 2025):

Thanks for your suggestions, Yes I record the pictures/video on the NAS with motion eye with motion detection feature. Unfortunately I have not enough knowledge to make technical test with your information. It will be nice to have a previous version image for rasb PI4 of HAOS, like 15.x versions. I like to restore a old HA OS version to see if it works. So then we will be able to know where is the issues. Thanks for your help,

@fdapport commented on GitHub (Sep 29, 2025): Thanks for your suggestions, Yes I record the pictures/video on the NAS with motion eye with motion detection feature. Unfortunately I have not enough knowledge to make technical test with your information. It will be nice to have a previous version image for rasb PI4 of HAOS, like 15.x versions. I like to restore a old HA OS version to see if it works. So then we will be able to know where is the issues. Thanks for your help,
Author
Owner

@MichaIng commented on GitHub (Sep 29, 2025):

We do not maintain HAOS or the Home Assistant HA app here. This is only the repository for plain motionEye without HA.

Unfortunately I have not enough knowledge to make technical test with your information.

You had the knowledge to add 3 SMB shares via motionEye, so you should know where these are hosted, be able to check whether they are online, and be able to remove them again via motionEye, isn't it? 🤔

The setting is right there in your first screenshot.

@MichaIng commented on GitHub (Sep 29, 2025): We do not maintain HAOS or the Home Assistant HA app here. This is only the repository for plain motionEye without HA. > Unfortunately I have not enough knowledge to make technical test with your information. You had the knowledge to add 3 SMB shares via motionEye, so you should know where these are hosted, be able to check whether they are online, and be able to remove them again via motionEye, isn't it? 🤔 The setting is right there in your first screenshot.
Author
Owner

@fdapport commented on GitHub (Sep 29, 2025):

I have the knowledge the change the configuration of the storage options in motion eye, as I did.
I do not have more knowledge in the terminal console commands to have the status of the connections, etc

So I made additional test with Motions eye storage options:

First at all I was not able to set the storage in the SD card, see screen shot.
So it was not working as aspect, I was think that the motion eye created a dirs with images, but no images or dirs was found in the SD card.

Image

As well I try "Custom path" option without any success.

Image

I have no idea where the cam images are stored.

As well I have create three network storage links in Home assistant but I have no idea how I can set it in Motion eye. see screen shot

Image

Finally I will try to set a network PC with shared disks to see if the errors comes from my NAS that run in a rasb PI4 with Openmediavault software...

Any additional test suggestions are welcome to understand how I can fix the issues.
Thanks for the help,

@fdapport commented on GitHub (Sep 29, 2025): I have the knowledge the change the configuration of the storage options in motion eye, as I did. I do not have more knowledge in the terminal console commands to have the status of the connections, etc So I made additional test with Motions eye storage options: First at all I was not able to set the storage in the SD card, see screen shot. So it was not working as aspect, I was think that the motion eye created a dirs with images, but no images or dirs was found in the SD card. ![Image](https://github.com/user-attachments/assets/0579a306-da32-4854-b838-5df5e99b0a10) As well I try "Custom path" option without any success. ![Image](https://github.com/user-attachments/assets/b34cff66-6638-4e43-ab4b-24f00b9de134) I have no idea where the cam images are stored. As well I have create three network storage links in Home assistant but I have no idea how I can set it in Motion eye. see screen shot ![Image](https://github.com/user-attachments/assets/7d17bc16-12f0-42b4-b618-04c1b13f5e6e) Finally I will try to set a network PC with shared disks to see if the errors comes from my NAS that run in a rasb PI4 with Openmediavault software... Any additional test suggestions are welcome to understand how I can fix the issues. Thanks for the help,
Author
Owner

@fdapport commented on GitHub (Oct 4, 2025):

Problem fix, I have implemented a FTP server and now it works...

Image

@fdapport commented on GitHub (Oct 4, 2025): Problem fix, I have implemented a FTP server and now it works... ![Image](https://github.com/user-attachments/assets/efe5a68d-196c-4c0c-861f-14691b027319)
Author
Owner

@MichaIng commented on GitHub (Oct 4, 2025):

Great that you were able to fix it.

As well I have create three network storage links in Home assistant but I have no idea how I can set it in Motion eye. see screen shot

Maybe the HA addon somehow internally adds those to motionEye, or the motionEye storage path was pointing into the mount point of (one of those) SMB shares. Though then only a single one should have thrown an error.

One more thing I want to test is whether motionEye tries some conflicting magic when its data dir is pointing to an SMB share mount point that was however not mounted by motionEye. In that case, it should just store its files there without taking care of the mount. But maybe it recognizes that it is a CIFS mount and then automatically tries to mount/unmount it, even that it is not supposed to do that and does not have permissions to do so.

@MichaIng commented on GitHub (Oct 4, 2025): Great that you were able to fix it. > As well I have create three network storage links in Home assistant but I have no idea how I can set it in Motion eye. see screen shot Maybe the HA addon somehow internally adds those to motionEye, or the motionEye storage path was pointing into the mount point of (one of those) SMB shares. Though then only a single one should have thrown an error. One more thing I want to test is whether motionEye tries some conflicting magic when its data dir is pointing to an SMB share mount point that was however not mounted by motionEye. In that case, it should just store its files there without taking care of the mount. But maybe it recognizes that it is a CIFS mount and then automatically tries to mount/unmount it, even that it is not supposed to do that and does not have permissions to do so.
Author
Owner

@MichaIng commented on GitHub (Dec 13, 2025):

Yeah, need testing to be sure, but what I get from the code is that it automatically unmounts all CIFS mounts that were not added via motionEye itself.

The idea surely was to remove those SMB mounts which are not in use by any camera anymore, sadly not considering, that there could be some added outside of motionEye. And there is also an _unmount_all function which unmounts all SMB shares.

Yeah indeed this happens on motionEye start as well as stop: On start it unmounts all CIFS mounts that are not used as camera storage. And on stop it unmounts all CIFS mounts: https://github.com/motioneye-project/motioneye/blob/dev/motioneye/server.py#L416

This needs to be changed so that only those mountpoints are unmounted which are/were used by motionEye, nothing else.

@MichaIng commented on GitHub (Dec 13, 2025): Yeah, need testing to be sure, but what I get from the [code](https://github.com/motioneye-project/motioneye/blob/dev/motioneye/controls/smbctl.py#L131) is that it automatically unmounts all CIFS mounts that were not added via motionEye itself. The idea surely was to remove those SMB mounts which are not in use by any camera anymore, sadly not considering, that there could be some added outside of motionEye. And there is also an `_unmount_all` function which unmounts all SMB shares. Yeah indeed this happens on motionEye start as well as stop: On start it unmounts all CIFS mounts that are not used as camera storage. And on stop it unmounts all CIFS mounts: https://github.com/motioneye-project/motioneye/blob/dev/motioneye/server.py#L416 This needs to be changed so that only those mountpoints are unmounted which are/were used by motionEye, nothing else.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/motioneye#2650
No description provided.