hassio-addons / addon-motioneye

motionEye - Home Assistant Community Add-ons
https://addons.community
MIT License
267 stars 43 forks source link

Memory leak in Addon after HAOS update to 10.0.rc1, 10.0.rc2, 10.0.rc3, 10.0.rc4 or 10.0 "stable" #394

Closed nepozs closed 1 year ago

nepozs commented 1 year ago

Problem/Motivation

Not working edit: Memory leak in addon after system update to HAOS 10.0.rcX

Expected behavior

Working

Actual behavior

Not working properly

Steps to reproduce

Change to beta update channel and update HAOS

Proposed changes

Not known

Additional info

Addon log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: motionEye
 Simple, elegant and feature-rich CCTV/NVR for your cameras
-----------------------------------------------------------
 Add-on version: 0.18.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.0.rc3  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.4.1
 Home Assistant Supervisor: 2023.04.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] motioneye.sh: executing... 
backing up /data/motioneye/motioneye.conf
[cont-init.d] motioneye.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[23:41:05] INFO: Starting motionEye...
    INFO: hello! this is motionEye server 0.42.1
Terminated
[23:42:05] INFO: Starting NGinx...
Terminated
[23:42:06] INFO: Successfully send discovery information to Home Assistant.
2023/04/07 23:42:07 [error] 743#743: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: a0d7b954-motioneye, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:28765/", host: "172.23.23.34:8123", referrer: "http://172.23.23.34:8123/hassio/addon/a0d7b954_motioneye/info"
2023/04/07 23:43:26 [error] 743#743: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: a0d7b954-motioneye, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:28765/", host: "172.23.23.34:8123", referrer: "http://172.23.23.34:8123/hassio/addon/a0d7b954_motioneye/info"

configuration:

action_buttons: []
certfile: fullchain.pem
keyfile: privkey.pem
motion_webcontrol: false
ssl: false

GUI error: 502 Bad Gateway

system info:

System Information

version core-2023.4.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 6.1.22
arch x86_64
timezone Europe/Warsaw
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.31.0 Stage | running Available Repositories | 1261 Downloaded Repositories | 81
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
GIOŚ can_reach_server | ok -- | --
Home Assistant Supervisor host_os | Home Assistant OS 10.0.rc3 -- | -- update_channel | beta supervisor_version | supervisor-2023.04.0 agent_version | 1.5.1 docker_version | 23.0.2 disk_total | 58.0 GB disk_used | 20.2 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | File editor (5.5.0), SSH & Web Terminal (13.1.0), ZeroTier One (0.16.2), Mosquitto broker (6.2.0), Zigbee2MQTT (1.30.3-1), Tasmota Device Manager (2022.6.0), HDD Tools (1.1.0), Z-Wave JS UI (1.10.0), Scrutiny (Full Access) (2ab714f5-ls35-2), ESPHome (2023.3.2), FTP (4.6.3), MQTT Explorer (browser-1.0.1), Glances (0.18.1), motionEye (0.18.0), Samba share (10.0.0), VLC (0.1.3), Tailscale (0.10.1), CUPS Print Server (2.0.2), go2rtc (1.3.1), Matter Server (4.2.0), ESPHome (beta) (2023.3.2), Rsyslog (2022.5.1)
Dashboards dashboards | 2 -- | -- resources | 42 views | 26 mode | storage
NextDNS can_reach_server | ok -- | --
Recorder oldest_recorder_run | March 30, 2023 at 10:29 -- | -- current_recorder_run | April 7, 2023 at 22:12 estimated_db_size | 664.81 MiB database_engine | sqlite database_version | 3.38.5
Sonoff version | 3.5.1 (122751c) -- | -- cloud_online | 0 / 0 local_online | 0 / 0
Żadnego Ale can_reach_server | failed to load: unreachable -- | --

also High CPU usage, or even very high

BAD_motionEye_addon_HAOS_10_0_rc3_2023-04-07_23-49

BAD_motionEye_addon_HAOS_10_0_rc3_very_high_cpu_2023-04-07_23-49

most important screenshot

Memory_leak_motionEye_2023-04-08_23-58

coreGreenberet commented 1 year ago

I can reproduce this. I've upgraded hassos from the latest 9 stable to 10.rc4 and now I can't use this addon anymore

dicekillsyou161 commented 1 year ago

I have upgraded to the release 10.0 and am also seeing this same behavior and the add on no longer is functional.

docsteel commented 1 year ago

After Update to HASS OS 10.0 The Add On is no longer Working (Error: Bad Gateway)

Log: Logger: motioneye_client.client Source: components/motioneye/init.py:314

Connection failed to motionEye: Cannot connect to host 127.0.0.1:28765 ssl:default [Connect call failed ('127.0.0.1', 28765)]

Jpsy commented 1 year ago

Same here on an RPi4b 8Gb:

About 40 min after upgrade to OS 10.0 the MotionEye CPU usage spikes and the system memory usage goes to 100%. As a result HA stalls. A hard reset repeats the same pattern – ~40 min HA ok, then ME CPU high, sys mem maxed out, and HA dies.

Downgrading to OS 9.5 solves the problem. But the CPU usage pattern does not really return to the old values (see graph).

image

image

System Information

ATTENTION - this is Sys info AFTER DOWNGRADE to 9.5. So most info should be correct but the OS is back down again.

version core-2023.4.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 5.15.84-v8
arch aarch64
timezone Europe/Paris
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4714 Installed Version | 1.32.1 Stage | running Available Repositories | 1268 Downloaded Repositories | 22
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 10. August 2023 um 02:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | false remote_connected | false alexa_enabled | true google_enabled | true remote_server | eu-central-1-2.ui.nabu.casa can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 9.5 -- | -- update_channel | stable supervisor_version | supervisor-2023.04.0 agent_version | 1.4.1 docker_version | 20.10.22 disk_total | 109.3 GB disk_used | 24.7 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Samba share (10.0.0), File editor (5.5.0), Node-RED (14.1.4), SSH & Web Terminal (13.1.0), motionEye (0.18.0), Mosquitto broker (6.2.0), Home Assistant Google Drive Backup (0.110.3), Zigbee2MQTT (1.30.3-1), ESPHome (2023.3.2), Matter Server (0.3.0)
Dashboards dashboards | 4 -- | -- resources | 16 views | 53 mode | storage
Recorder oldest_recorder_run | 7. April 2023 um 04:15 -- | -- current_recorder_run | 19. April 2023 um 03:23 estimated_db_size | 3543.56 MiB database_engine | sqlite database_version | 3.38.5
drunkly commented 1 year ago

image

I have the same issue, it looks like there is an issue with "meyectl" due the cpu usage (motion detection is disabled).

frenck commented 1 year ago

The only solution I see, is upgrading the add-on to run the current development version of motionEye. It is either that, or dropping the add-on. motionEye hasn't had a stable release in years, and there is simply no other upgrade path possible.

So, I'm starting on the progress of upgrading to motionEye dev.

../Frenck

frenck commented 1 year ago

Alright, I've released motionEye v0.19.0

⚠️ BE SURE TO READ THE RELEASE NOTES:

https://github.com/hassio-addons/addon-motioneye/releases/tag/v0.19.0

Please let me know how it goes.

../Frenck

Moehre13 commented 1 year ago

Hey @frenck ! Your Update works fine for me! Thank you very much!

For all who have the same issue. Go to addons, choose "add-on Store" klick the three dots in the upper right corner and choose check for updates, then you can istall Motioneye with the new Version 0.19.

coreGreenberet commented 1 year ago

V19 with OS 10.0 is working fine for me too =)

wklink commented 1 year ago

The update allows motioneye to start, but it's not capturing anything from my USB camera. My rtsp streams are ok, though.

dicekillsyou161 commented 1 year ago

confirm that this resolved my issues and motioneye appears to be functional across my IP cams, thank you!

frenck commented 1 year ago

The update allows motioneye to start, but it's not capturing anything from my USB camera. My rtsp streams are ok, though.

Well it starts :) If you have issue with USB, please create a separate issue for that (as it is not related to this issue directly).

frenck commented 1 year ago

Alright, a couple of confirmations things are rolling again. Going to close this issue at this point for that reason.

Thanks for the reports back! 👍

../Frenck

nepozs commented 1 year ago

Update helps with memory leak, but USB cams don't work…