MTry / homebridge-smart-irrigation

Turn any electrical irrigation valve into a smart-valve.. or run your pumps on a smart schedule based on your climate! This homebridge plugin exposes a multi-zone irrigation sprinkler dummy control system to Apple's HomeKit. Although a dummy, it brings smarts of an evapotranspiration based climate and plant adaptive irrigation controller with the use of OpenWeatherMap API. The plugin can optionally email you, and/or send you push notifications through Pushover or Pushcut, with the watering schedule it has calculated, or when a watering run is completed, along with the next 7-day weather forecast. Added option to expose system controls to Homekit allowing a user to enable/disable irrigation, rechecks, push and email notifications from within the Home App. Associated WaterLevel Characteristic shows the % of watering cycle remaining.
MIT License
78 stars 3 forks source link

Docker related - Standing reboot - Fixed v1.7.1 #30

Closed Sergbmw closed 2 years ago

Sergbmw commented 2 years ago

Describe the bug Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge-config-ui-x/homebridge-smart-irrigation'

reboot standing

Platform (please complete the following information): ОС | Ubuntu Bionic Beaver (18.04.6 LTS) raspberrypi v16.14.2 v8.5.5 root /homebridge /homebridge/config.json /homebridge/node_modules docker: Yes

Additional context Add any other context about the problem here.

MTry commented 2 years ago

Hi @Sergbmw - could you clarify that the problem you are facing of continuous reboots? This is looking like some permission issue on your docker installation. Any other plugins you have installed and is the behaviour normal otherwise?

Sergbmw commented 2 years ago

All other plugins work great

MTry commented 2 years ago

TBH I haven't tried an installation of homebridge on docker so not quite sure where this permission denial to 'mkdir' is coming from - any chance you can try on non-docker environment? The way it looks form your error message - am I correct in assuming that you are not able to install the plugin itself? Or is it that the plugin installs and you are able to configure but when you start it keeps rebooting? I am also assuming that since the installation itself is not proceeding there is no point asking if the plugin is on a child bridge!?

MTry commented 2 years ago

@Sergbmw - could you tell me how you are trying to install? Through the UI or install command? Any other feedback on the previous message?

Sergbmw commented 2 years ago

Good afternoon. I installed the plugin and configured it. But after reloading the Homebridge, if the plugin is not started in a separate bridge, the Homebridge itself does not start.

Sergbmw commented 2 years ago

I already completely uninstalled the plugin and reinstalled it, the same problem

MTry commented 2 years ago

So if you start in a child bridge then homebridge starts but the plugin doesn’t? Isn’t it required to first configure and restart to even get the option to make it a child bridge? - so if homebrdige didn’t start after reboot could you share how you forced the plugin to run in child bridge mode?

On 04-Apr-2022, at 13:20, Sergbmw @.***> wrote:

Good afternoon. I installed the plugin and configured it. But after reloading the Homebridge, if the plugin is not started in a separate bridge, the Homebridge itself does not start.

— Reply to this email directly, view it on GitHub https://github.com/MTry/homebridge-smart-irrigation/issues/30#issuecomment-1087227780, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP4KMBKUF7GI4EGQVNHTQDVDKNMJANCNFSM5SED6QWA. You are receiving this because you were assigned.

Sergbmw commented 2 years ago

Tried it in different ways, same result.

MTry commented 2 years ago

How did you make the plugin run in child bridge?

On 04-Apr-2022, at 13:30, Sergbmw @.***> wrote:

Tried it in different ways, same result.

— Reply to this email directly, view it on GitHub https://github.com/MTry/homebridge-smart-irrigation/issues/30#issuecomment-1087235957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP4KMADLEID5W2KNBH543LVDKOTDANCNFSM5SED6QWA. You are receiving this because you were assigned.

Sergbmw commented 2 years ago

Снимок экрана 2022-04-04 в 11 40 44

MTry commented 2 years ago

Thanks - do you do this from this screen right after installation just after configuring or do you try to restart the home bridge after the plugin installation and return to this screen to make it a child bridge...

On 04-Apr-2022, at 14:11, Sergbmw @.***> wrote:

https://user-images.githubusercontent.com/54317682/161506971-3d836394-b549-46e4-9cb6-f5c954e1ee05.png — Reply to this email directly, view it on GitHub https://github.com/MTry/homebridge-smart-irrigation/issues/30#issuecomment-1087278029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP4KMC7IT66YZJFJZSVK5LVDKTLBANCNFSM5SED6QWA. You are receiving this because you were assigned.

Sergbmw commented 2 years ago

[4/4/2022, 11:48:46 AM] Homebridge v1.4.0 (HAP v0.10.0) (Homebridge 49FD) is running on port 52434. [4/4/2022, 11:48:46 AM] [Irrigation] Exposing controls to Homekit... [4/4/2022, 11:48:46 AM] [Irrigation] Exposed Master Control [4/4/2022, 11:48:46 AM] [Irrigation] Initialized 1 zones DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option. [4/4/2022, 11:48:46 AM] [Irrigation] Check configuration errors. Currently disabled! Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge-config-ui-x/homebridge-smart-irrigation' [4/4/2022, 11:48:46 AM] [Irrigation] Child bridge process ended [4/4/2022, 11:48:46 AM] [Irrigation] Process Ended. Code: 1, Signal: null

Sergbmw commented 2 years ago

[4/4/2022, 11:49:42 AM] [Irrigation] OWM Key cant be blank! Disabling [4/4/2022, 11:49:42 AM] [Irrigation] Exposing controls to Homekit... [4/4/2022, 11:49:42 AM] [Irrigation] Exposed Master Control [4/4/2022, 11:49:42 AM] [Irrigation] Initialized 1 zones [4/4/2022, 11:49:42 AM] [Irrigation] Check configuration errors. Currently disabled! DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option. Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge-config-ui-x/homebridge-smart-irrigation' [4/4/2022, 11:49:42 AM] [Irrigation] Child bridge process ended [4/4/2022, 11:49:42 AM] [Irrigation] Process Ended. Code: 1, Signal: null [4/4/2022, 11:49:49 AM] [Irrigation] Restarting Process... [4/4/2022, 11:49:50 AM] [Irrigation] Launched child bridge with PID 9487 [4/4/2022, 11:49:51 AM] Registering accessory 'homebridge-smart-irrigation.SmartSprinklers' [4/4/2022, 11:49:51 AM] [Irrigation] Loaded homebridge-smart-irrigation v1.6.0 child bridge successfully [4/4/2022, 11:49:51 AM] [Irrigation] OWM Key cant be blank! Disabling [4/4/2022, 11:49:51 AM] [Irrigation] Exposing controls to Homekit... [4/4/2022, 11:49:51 AM] [Irrigation] Exposed Master Control [4/4/2022, 11:49:51 AM] [Irrigation] Initialized 1 zones [4/4/2022, 11:49:51 AM] [Irrigation] Check configuration errors. Currently disabled! DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option. Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge-config-ui-x/homebridge-smart-irrigation' [4/4/2022, 11:49:51 AM] [Irrigation] Child bridge process ended [4/4/2022, 11:49:51 AM] [Irrigation] Process Ended. Code: 1, Signal: null

MTry commented 2 years ago

Thanks for the logs - it is looking like, from the stage at which the error is thrown, that the plugin is unable to get permission for the local subdirectory where it needs to store some temp files for persistence… unfortunately I don’t have a docker environment nor the expertise for the same to guide you here but my suggestion would be to dig in that direction.. you could start by loosening permissions at the plugin’s installation sub-directory and check if it makes a difference.. or even just create a /homebridge-smart-irrigation/storage subdirectory with read/write permissions to check if it helps!

Please do give a feedback that could help others here..

On 04-Apr-2022, at 14:20, Sergbmw @.***> wrote:

[4/4/2022, 11:49:42 AM] [Irrigation] OWM Key cant be blank! Disabling [4/4/2022, 11:49:42 AM] [Irrigation] Exposing controls to Homekit... [4/4/2022, 11:49:42 AM] [Irrigation] Exposed Master Control [4/4/2022, 11:49:42 AM] [Irrigation] Initialized 1 zones [4/4/2022, 11:49:42 AM] [Irrigation] Check configuration errors. Currently disabled! DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option. Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge-config-ui-x/homebridge-smart-irrigation' [4/4/2022, 11:49:42 AM] [Irrigation] Child bridge process ended [4/4/2022, 11:49:42 AM] [Irrigation] Process Ended. Code: 1, Signal: null [4/4/2022, 11:49:49 AM] [Irrigation] Restarting Process... [4/4/2022, 11:49:50 AM] [Irrigation] Launched child bridge with PID 9487 [4/4/2022, 11:49:51 AM] Registering accessory 'homebridge-smart-irrigation.SmartSprinklers' [4/4/2022, 11:49:51 AM] [Irrigation] Loaded homebridge-smart-irrigation v1.6.0 child bridge successfully [4/4/2022, 11:49:51 AM] [Irrigation] OWM Key cant be blank! Disabling [4/4/2022, 11:49:51 AM] [Irrigation] Exposing controls to Homekit... [4/4/2022, 11:49:51 AM] [Irrigation] Exposed Master Control [4/4/2022, 11:49:51 AM] [Irrigation] Initialized 1 zones [4/4/2022, 11:49:51 AM] [Irrigation] Check configuration errors. Currently disabled! DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option. Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge-config-ui-x/homebridge-smart-irrigation' [4/4/2022, 11:49:51 AM] [Irrigation] Child bridge process ended [4/4/2022, 11:49:51 AM] [Irrigation] Process Ended. Code: 1, Signal: null

— Reply to this email directly, view it on GitHub https://github.com/MTry/homebridge-smart-irrigation/issues/30#issuecomment-1087285941, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP4KMGP6SX6D7VAST5PAATVDKUMXANCNFSM5SED6QWA. You are receiving this because you were assigned.

Sergbmw commented 2 years ago

Yes, other plugins have full access, and I run it in a docker Homebridge under the administrator, in theory, I have all access

OzBMP commented 2 years ago

Hi Sergbmw,

Did you have any luck here? I have the exact same issue and also using docker on Synology nas.

seppelicous commented 2 years ago

Also using Docker on Synology with DSM 7.1 and having the same issue! Had to disable the plugin.

seppelicous commented 2 years ago

The root of the issue is, that "'/run/s6/services/*" is not the correct directory for temp files in docker. As there is no individual option for the user to change the folder, it is up to the author to provide the correct setting.

Thank you!

MTry commented 2 years ago

@seppelicous - I'm not an expert when it comes to doing this on the docker but welcome any code updates you think will fix this without breaking non-docker implementation. Happy to incorporate this change but will can't do on my own unfortunately. Requesting expert assistance with this... until then will keep this issue open.

seppelicous commented 2 years ago

@MTry Thank you for the fast reply. I understand your worries. Some plugin authors add and additional option to individualy change the cached directory. Maybe this would be an option here.

MTry commented 2 years ago

Ok.. let me look into this. In the meanwhile if you have a specific suggestion looking at the code please do share as that will make it quicker to implement this..

On 26-Apr-2022, at 14:44, seppelicous @.***> wrote:

@MTry https://github.com/MTry Thank you for the fast reply. I understand your worries. Some plugin authors add and additional option to individualy change the cached directory. Maybe this would be an option here.

— Reply to this email directly, view it on GitHub https://github.com/MTry/homebridge-smart-irrigation/issues/30#issuecomment-1109552489, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP4KMDLUJ6EYBWSSDGYVMLVG6XWPANCNFSM5SED6QWA. You are receiving this because you were mentioned.

MTry commented 2 years ago

@seppelicous - I am using const cacheDirectory = './homebridge-smart-irrigation/storage' as temp storage.. what according to you would be suitable for docker? Would you like to fork and experiment with a different value here? If it works for you I'll make this setting a part of configuration to give the user an option to pick the right one..

MTry commented 2 years ago

Edited the title to better reflect the issue here. Still waiting for some guidance on this from docker experts..

seppelicous commented 2 years ago

Sorry for answering so late!

I checked another discussion with the same issue: https://github.com/benzman81/homebridge-nukiio/issues/27 It seems that the valid cached directory needs to be within "/homebridge". Does your plugin creates a folder while installation?

For a first try it would be fine to an additional setting in the configuration. I will test is immediately

MTry commented 2 years ago

Hello @seppelicous @Sergbmw @OzBMP - big update here. I have adopted the correct generic way to query the permitted cache storage location based on advise from oznu. Hopefully this should fix the problem for any platform including docker - please give it a go and share your feedback!

Sergbmw commented 2 years ago

All Work!

MTry commented 2 years ago

All Work!

Super. Thanks for your super fast feedback!! Will wait a little longer before marking it closed.. perhaps some more user feedback!

MTry commented 2 years ago

Made a minor update.. so users on platforms where it was earlier working without issues, should not have to reset the control states in Home for their preferences...

Hope this is the last change for this issue and it works for you all!

Thank you so much for your patience and for highlighting this issue which was squarely due to my own error of not following a basic guideline - apologies for the same!

seppelicous commented 2 years ago

Works also for me! Thank you very much for this! Great job!

MTry commented 2 years ago

@seppelicous Thanks for your feedback!