hassio-addons / addon-motioneye

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

/config does not exist or is not writable #14

Closed jjpeet closed 5 years ago

jjpeet commented 5 years ago

Problem/Motivation

All of a sudden I am receiving this error.

[services.d] starting services
[services.d] done.
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/ssl/hass.jjpeet.com.crt.pem"
    INFO: hello! this is motionEye server 0.39.3
CRITICAL: config directory "/config" does not exist or is not writable
    INFO: hello! this is motionEye server 0.39.3

Expected behavior

(What you expected to happen)

Actual behavior

MotionEye isn't running (no web interface is responding)

Steps to reproduce

This error just started happening.

Proposed changes

Can some more doco be provided that explains how I can fix this issue? I'm looking at my Pi's SSD and can't see the folder where the config should be. I do daily backups so could easily restore the plugin, but this doesn't seem to make any difference either. If info could be provided that explains where the config files live on the file system I can then verify that this folder is in fact writable.

addons-assistant[bot] commented 5 years ago

:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

frenck commented 5 years ago

Well, it is correct that the folder isn't writable? Unsure what this causes, I am currently unable to reproduce this issue. Do you have more information for me?

Like complete logs, version information, hardware information, specific settings? Anything that can help me reproduce this issue, would be awesome.

jjpeet commented 5 years ago

Hi Frenk, I ended up uninstalling and reinstalling the plugin to get it going again. If it happens again I’ll try and grab more logs. Thx, JP

jjpeet commented 5 years ago

Hi @frenck it started happening again today. Here is the debug 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... 
-----------------------------------------------------------
 Hass.io Add-on: motionEye v0.2.0
 Simple, elegant and feature-rich CCTV/NVR for your cameras
 From: Community Hass.io Add-ons
 By: Franck Nijhof <frenck@addons.community>
-----------------------------------------------------------
 armhf / HassOS 1.12 / HA 0.82.1 / SU 141 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to DEBUG
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
DEBUG: Requested API resource: http://hassio/supervisor/ping
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {}}
DEBUG: Requested API resource: http://hassio/addons/self/info
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {"name": "motionEye", "slug": "a0d7b954_motioneye", "description": "Simple, elegant and feature-rich CCTV/NVR for your cameras", "long_description": "# Community Hass.io Add-ons: motionEye\n\n[![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]\n\n[![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum]\n\n[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]\n\n[![Support my work on Patreon][patreon-shield]][patreon]\n\nSimple, elegant and feature-rich CCTV/NVR for your cameras.\n\n## About\n\nmotionEye is a popular frontend to the camera software called motion. This add-on provides both, allowing you to add your camera's to your Hass.io setup.\n\nmotionEye is Open Source CCTV and NVR, that is elegant and really easy to use. It can be used as a Baby Monitor, Construction Site Montage Viewer, Store Camera DVR, Garden Security, and much more.\n\nSome cool features of motionEye:\n\n- Support for a ridiculous amount of cameras, including IP cams.\n- Add multiple cameras by hooking up multiple motionEye instances together.\n  For example, by using MotionEyeOS on a Pi Zero + Pi camera in your network.\n- Supports uploading recording into Google Drive and Dropbox.\n- motion detection, including email notification and scheduling.\n- Can record continuously, motion, or timelapse, with retention settings.\n\n[Click here for the full documentation][docs]\n\n![HADashboard screenshot][screenshot]\n\n[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg\n[buymeacoffee]: https://www.buymeacoffee.com/frenck\n[discord-shield]: https://img.shields.io/discord/478094546522079232.svg\n[discord]: https://discord.me/hassioaddons\n[docs]: https://github.com/hassio-addons/addon-motioneye/blob/v0.2.0/README.md\n[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg\n[forum]: https://community.home-assistant.io/t/community-hass-io-add-on-motioneye/71826?u=frenck\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg\n[patreon-shield]: https://www.frenck.nl/images/patreon.png\n[patreon]: https://www.patreon.com/frenck\n[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg\n[release-shield]: https://img.shields.io/badge/version-v0.2.0-blue.svg\n[release]: https://github.com/hassio-addons/addon-motioneye/tree/v0.2.0\n[screenshot]: https://github.com/hassio-addons/addon-motioneye/raw/master/images/screenshot.png", "version": "0.2.0", "auto_update": false, "repository": "a0d7b954", "last_version": "0.2.0", "state": "started", "protected": true, "rating": 2, "boot": "auto", "options": {"log_level": "debug", "port": 8765, "ssl": true, "certfile": "hass.jjpeet.com.crt.pem", "keyfile": "hass.jjpeet.com.key.pem", "ipv6": false}, "arch": ["aarch64", "amd64", "armhf", "i386"], "machine": ["intel-nuc", "odroid-c2", "odroid-xu", "orangepi-prime", "qemux86", "qemux86-64", "qemuarm", "qemuarm-64", "raspberrypi", "raspberrypi2", "raspberrypi3", "raspberrypi3-64", "tinker"], "url": "https://community.home-assistant.io/t/community-hass-io-add-on-motioneye/71826?u=frenck", "detached": false, "available": true, "build": false, "network": null, "host_network": true, "host_pid": false, "host_ipc": false, "host_dbus": false, "privileged": ["DAC_READ_SEARCH", "SYS_ADMIN"], "full_access": false, "apparmor": "disable", "devices": null, "icon": true, "logo": true, "changelog": true, "webui": "https://[HOST]:8765", "stdin": false, "hassio_api": true, "hassio_role": "default", "auth_api": false, "homeassistant_api": false, "gpio": false, "devicetree": false, "docker_api": false, "audio": false, "audio_input": null, "audio_output": null, "services": [], "discovery": []}}
DEBUG: Filtering response using: .version
DEBUG: Requested API resource: http://hassio/addons/self/info
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {"name": "motionEye", "slug": "a0d7b954_motioneye", "description": "Simple, elegant and feature-rich CCTV/NVR for your cameras", "long_description": "# Community Hass.io Add-ons: motionEye\n\n[![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]\n\n[![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum]\n\n[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]\n\n[![Support my work on Patreon][patreon-shield]][patreon]\n\nSimple, elegant and feature-rich CCTV/NVR for your cameras.\n\n## About\n\nmotionEye is a popular frontend to the camera software called motion. This add-on provides both, allowing you to add your camera's to your Hass.io setup.\n\nmotionEye is Open Source CCTV and NVR, that is elegant and really easy to use. It can be used as a Baby Monitor, Construction Site Montage Viewer, Store Camera DVR, Garden Security, and much more.\n\nSome cool features of motionEye:\n\n- Support for a ridiculous amount of cameras, including IP cams.\n- Add multiple cameras by hooking up multiple motionEye instances together.\n  For example, by using MotionEyeOS on a Pi Zero + Pi camera in your network.\n- Supports uploading recording into Google Drive and Dropbox.\n- motion detection, including email notification and scheduling.\n- Can record continuously, motion, or timelapse, with retention settings.\n\n[Click here for the full documentation][docs]\n\n![HADashboard screenshot][screenshot]\n\n[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg\n[buymeacoffee]: https://www.buymeacoffee.com/frenck\n[discord-shield]: https://img.shields.io/discord/478094546522079232.svg\n[discord]: https://discord.me/hassioaddons\n[docs]: https://github.com/hassio-addons/addon-motioneye/blob/v0.2.0/README.md\n[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg\n[forum]: https://community.home-assistant.io/t/community-hass-io-add-on-motioneye/71826?u=frenck\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg\n[patreon-shield]: https://www.frenck.nl/images/patreon.png\n[patreon]: https://www.patreon.com/frenck\n[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg\n[release-shield]: https://img.shields.io/badge/version-v0.2.0-blue.svg\n[release]: https://github.com/hassio-addons/addon-motioneye/tree/v0.2.0\n[screenshot]: https://github.com/hassio-addons/addon-motioneye/raw/master/images/screenshot.png", "version": "0.2.0", "auto_update": false, "repository": "a0d7b954", "last_version": "0.2.0", "state": "started", "protected": true, "rating": 2, "boot": "auto", "options": {"log_level": "debug", "port": 8765, "ssl": true, "certfile": "hass.jjpeet.com.crt.pem", "keyfile": "hass.jjpeet.com.key.pem", "ipv6": false}, "arch": ["aarch64", "amd64", "armhf", "i386"], "machine": ["intel-nuc", "odroid-c2", "odroid-xu", "orangepi-prime", "qemux86", "qemux86-64", "qemuarm", "qemuarm-64", "raspberrypi", "raspberrypi2", "raspberrypi3", "raspberrypi3-64", "tinker"], "url": "https://community.home-assistant.io/t/community-hass-io-add-on-motioneye/71826?u=frenck", "detached": false, "available": true, "build": false, "network": null, "host_network": true, "host_pid": false, "host_ipc": false, "host_dbus": false, "privileged": ["DAC_READ_SEARCH", "SYS_ADMIN"], "full_access": false, "apparmor": "disable", "devices": null, "icon": true, "logo": true, "changelog": true, "webui": "https://[HOST]:8765", "stdin": false, "hassio_api": true, "hassio_role": "default", "auth_api": false, "homeassistant_api": false, "gpio": false, "devicetree": false, "docker_api": false, "audio": false, "audio_input": null, "audio_output": null, "services": [], "discovery": []}}
DEBUG: Filtering response using: .last_version
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirement.sh: executing... 
[cont-init.d] 10-requirement.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-init-media.sh: executing... 
[cont-init.d] 21-init-media.sh: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
[cont-init.d] 30-nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/ssl/hass.jjpeet.com.crt.pem"
    INFO: hello! this is motionEye server 0.39.3
CRITICAL: config directory "/config" does not exist or is not writable
    INFO: hello! this is motionEye server 0.39.3
CRITICAL: config directory "/config" does not exist or is not writable
    INFO: hello! this is motionEye server 0.39.3
CRITICAL: config directory "/config" does not exist or is not writable

Are there any other logs you need?

Thx James

e1miran commented 5 years ago

I have the same issue that has persisted for months, but with a different directory - "/var/lib/motioneye". This only happens on restart of the add-on (like when I restart the host server). Same as @jjpeet, uninstalling and re-installing of the add-on is the only remedy. Then I restore the camera config from a backup.

[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... 

-----------------------------------------------------------
 Hass.io Add-on: motionEye v0.3.0

 Simple, elegant and feature-rich CCTV/NVR for your cameras

 From: Community Hass.io Add-ons
 By: Franck Nijhof <frenck@addons.community>
-----------------------------------------------------------
 amd64 / null / HA 0.86.4 / SU 142 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirement.sh: executing... 
[cont-init.d] 10-requirement.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-init-media.sh: executing... 
[cont-init.d] 21-init-media.sh: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
[cont-init.d] 30-nginx.sh: exited 0.
[cont-init.d] 31-motion.sh: executing... 
[cont-init.d] 31-motion.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
    INFO: hello! this is motionEye server 0.39.3
CRITICAL: media directory "/var/lib/motioneye" does not exist or is not writable
Bodge-IT commented 5 years ago

I have the same issue. Comes from the motioneye.conf config for media_path. I suspect this isn't transferred through to the container. Could it be exposed as a param so pointing to alt storage is possible?

rvsanten commented 5 years ago

I have the same issue when restarting the docker container, does not happen all the time

gleepwurp commented 5 years ago

Hmm, same issue here... If I inspect the motioneye docker container, it does bind the internal /config as "ro" (read-only):

        {
            "Type": "bind",
            "Source": "/usr/share/hassio/homeassistant",
            "Destination": "/config",
            "Mode": "ro",
            "RW": false,
            "Propagation": "rprivate"
        },

Trying to see if changing that might resolve the issue.

Y.

frenck commented 5 years ago

@gleepwurp Are you writing to /config somewhere from your camera configurations?

The add-on itself does not write to /config (did check again and could not find any references). So, it must be induced by something else?

gleepwurp commented 5 years ago

I dunno, I'll have to dig a bit.

Motioneye worked fine until the initial camera configuration inside. Following a reboot, motioneye fails with these "/config does not exist or is not writable" error message constantly.

example: CRITICAL: config directory "/config" does not exist or is not writable INFO: hello! this is motionEye server 0.39.3 CRITICAL: config directory "/config" does not exist or is not writable INFO: hello! this is motionEye server 0.39.3 CRITICAL: config directory "/config" does not exist or is not writable

I'll have more time to dig this weekend. Will report back if I find anything.

Y.

Bodge-IT commented 5 years ago

Hi @frenck is there a common way to override your addons to utilise less ephemeral storage for configs?

frenck commented 5 years ago

It is stored in the add-on data folder, which persists and is the correct location for this type of data. Could you define less ephemeral?

addons-assistant[bot] commented 5 years 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.

Bodge-IT commented 5 years ago

Hi @frenck at the time I was referring to the fact that all the config is wiped out when the addon is uninstalled. I may have missed it but don't remember seeing a warning that all the data would be wiped out on an uninstall too.

frenck commented 5 years ago

This is true for all add-ons and not a limitation of this add-on in particular. If you don't like how that works, I would suggest on opening an issue with Hass.io.

addons-assistant[bot] commented 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.