-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device permission update broken for some devices #2133
Comments
Thanks for having pulled the 9.0 for the time being while we are going to investigate that issue. I will keep you updated here as soon as I did some investigation myself to try to reproduce this issue. |
@jens-maus unfortunately, I really can't find my only Homeatic device 😢 Is that the device which makes use of the raw UART driver? So maybe a raw UART driver & runc problem? I tried passing regular GPIO UART's (ttyAMA0) to an add-on as well as USB devices like deCONZ, and that seems to work. I am a bit out of idea how I can reproduce it here. I've looked through the source code, and it seems that |
Further investigation actually uncovered that the root problem is this error:
This causes runc to fail, which probably causes rules to not get applied correctly. This is likely caused by parallel calls to OS Agent/ |
great, looking forward to development builds to be able to test this... |
@jens-maus Supervisor dev build |
thx, however, I always tend to forget how to update to these dev builds.. can you please help me out here :) |
Sure :)
This should show latest version is
Will update to that. |
I had the same issue. I Changed to the Dev Channel as described above. Update to 2022.09.dev1501 allown was not sufficient, but with the directly following dev updates it now works again with the following versions: Thanks for the fast solution. |
Hm, Supervisor 2022.09.dev1501 should really be enough, the newer dev versions contain just unrelated dependency updates. Did you restart the add-on after updating the Supervisor? |
@jens-maus have you been able to test with the latest Sueprvisor? |
Sorry, I really don't know. Usually I restart after updating, but I'm new to HA and restarting is really not that automated for me yet :-( |
I tested the supervisor and other things quite a bit. That doesn't solve the issue. That it work for one person would maybe mean there is an timing issue? I guess to understand what the driver make and how they interact with userland could help to understand it better |
Hi, I'm now on
It seems to work now. Addon-Log still show
but RF + HMIP working both atm. The only thing is: My Duty Cycle grows and grows (round about 1 percent / minute). Now at 55 percent. Don't know what's normal with my not very big setup, but can't imagine it would ever be abouve 20 (or 10)... Best regards |
I investigate the issue a bit myself and to me it parly looks like a timing issue and is definitly related to the point that within the addon the two And now, this time it looks like something similar things are happening when the dynamically generated One of the strange things is, that while debugging I can see that sometimes
And when both mmd devices are present they are looking like:
So can this be related to the point that these device nodes "just" differ in the minor number? I don't think so, but who knows.... And perhaps you guys (@pvizeli or @agners) have some idea how I can more deeply analyze this situation within HomeAssistantOS?!?! Because I am partly out of ideas on how to further debug these permission/device access issues... |
provide underlying operating systems a bit more time for settlement and permission setup to the dynamically generated /dev/mmd_* devices. This should help in case of newer HomeAssistantOS 9.0+ environments which seem to require a bit more time before rfd/HMIPServer can successfully access these multimacd devices. This fixes #1942 and refs home-assistant/operating-system#2133
Ok, after further investigation I updated to the latest supervisor dev build (2022.09.dev1703) and noticed that this version seem to have improved my observation that either However, I am still curious why these additional Nevertheless, it would be great if the newer supervisor with the latest integrated fixes is released soon, so that "RaspberryMatic CCU" Add-on users can update accordingly and use newer add-on versions as well (with the sleep) so that they get their HomeMatic setup running again with HAOS 9+ |
FYI: I just downgraded to the latest supervisor 2022.09.1 beta version and this version also seem to be recent enough to get the "RaspberryMatic CCU" add-on going again – however, unfortunately only with the additional |
Yeah, what I said, the error in the log is not the issue that we looking for. I fixed it with the supervisor, but that doesn't solve our issue. Docker now using BPF but also systemd to control the access with docker > 20.10.8 and new distros. I guess these 2 system that needs to know about the device's access take more time to get it in place. Thank you @jens-maus for looking into and finding the issue & fix this. We act on kernel events, I don't think we can speed the device access more as it is now and I'm also not sure if the BPF is the part which is slower or the systemd cgroup implementation. Since cgroup1 is EOF and we already push back it 1y, we have to move forward with cgroup2 and find out how to life with it. |
That is probably the same issue which caused the error
It is very likely that the current dynamic device permission setting implementation is slower. We call runc through OS Agent to make it work with cgroupsv2, in cgroupsv1 this was a simple sysfs write. However, 5s seems like a very long time 😰. Is 5s "the optimized" value, as in, 1s through 4s is not enough? In general, I hope the device cgroups permission update gets accepted into upstream Ideally you should implement some method to check if the device is readable (maybe
From what I understand in pure RaspberryMatic setup there is no container involved, so as soon as the device has been created it will be accessible? In the end, the permission update is (and was) and asynchronous process running in parallel. There is always a potential for a race condition here. A check along with a busy wait is probably the best approach. |
Yeah, I used a similar approach on an add-on to wait until the device came online (that was not about access, but maybe that changed now too, as we have to use dynamic access more often because whitelisting devices doesn't work anymore with cgroup2) |
Unfortunatley, a simply |
Right, it needs something which calls
|
"head -c0" which should help to deal way better with the dynamic device generation process, especially in case of using HomeAssistantOS as the based OS. This refs home-assistant/operating-system#2133 (comment)
Thanks for this great hint. Funny enough, I was already working/evaluating using |
Closing this issue as the main problem of the race condition is addressed by home-assistant/supervisor#3868. There is still a problem with the hot-plug functionality. Unfortunately the new runc device permission updates essentially does not allow to set arbitrary Closing this issue as there is nothing to be done on OS side for now. |
RaspberryMatic users report issues with Homeatic devices not being able to passed into the RaspberryMatic Add-on (see jens-maus/RaspberryMatic#1942).
The supervisor reports the following error:
The text was updated successfully, but these errors were encountered: