-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
No serial device connection in root-less podman container #378
Comments
At least it work when running the same container as root. Any idea which kind of access it needs in addition?
|
Honestly ... no idea ... In fact the adapter, and so the nodejs process is not getting any data because your debug log do not show it. In nodejs I can not do anything ... so it must be a config thing in the container ... !? Maybe the nodejs process needs to get additional capabilities or such? @buanet any idea? |
Capabilities was my first guess and I already tried a few, but didn't find the right one(s) yet |
I tried adding all capabilities to podman but it didn't help. podman exec -it iobroker-app sh
Not yet sure why this not needed if podman runs as root. |
@stephanritscher try environment variable |
Unfortunately chown doesn't work (I also tried manually).
Maybe again due to running podman in root-less mode? |
Pretty sure thats the problem. The startup script of the container is designed to run as root. |
According to my understanding of containers/podman#13090 (comment) there is no good solution which propagates the user or group ownership to a non-root process in a root-less container. So I'll stick with allowing all users to modify the character device (chmod on the host) since my system only has very few users. |
Describe the bug
A raspberry pi 2 is running iobroker in slave mode in a root-less podman container. The infrared reader (FT232R) is connected to it and redirected to the container. But the smartmeter adapter runs into read timeouts.
To Reproduce
podman play kube --annotation run.oci.keep_original_groups=1 podman.txt
(see attached podman.txt)Expected behavior
Smartmeter adapter should start reading the current meter values.
Screenshots & Logfiles
Instead the communication times out (the infrared head hasn't been moved since successfully reading the meter values using smartmeter adapter on "server" running iobroker natively, i.e. not using podman).
smartmeter.1 | 2023-10-24 21:31:03.094 | warn | No or too long answer from Serial Device after last request.
smartmeter.1 | 2023-10-24 21:31:03.092 | debug | Error: No or too long answer from Serial Device after last request.
smartmeter.1 | 2023-10-24 21:31:03.089 | debug | MESSAGE TIMEOUT TRIGGERED
smartmeter.1 | 2023-10-24 21:29:03.086 | debug | SET MESSAGE TIMEOUT TIMER: 120000
smartmeter.1 | 2023-10-24 21:29:03.078 | debug | CREATE SERIALPORT: 9600 8 1 none
smartmeter.1 | 2023-10-24 21:24:03.075 | debug | SCHEDULE NEXT RUN IN 300s
smartmeter.1 | 2023-10-24 21:24:03.070 | debug | Transport Reset!! Restart = true
smartmeter.1 | 2023-10-24 21:24:03.067 | debug | Error: No or too long answer from Serial Device after last request.
smartmeter.1 | 2023-10-24 21:24:03.063 | warn | No or too long answer from Serial Device after last request.
smartmeter.1 | 2023-10-24 21:24:03.056 | debug | Error: No or too long answer from Serial Device after last request.
smartmeter.1 | 2023-10-24 21:24:03.050 | debug | MESSAGE TIMEOUT TRIGGERED
smartmeter.1 | 2023-10-24 21:22:03.174 | debug | connected set to false
smartmeter.1 | 2023-10-24 21:22:03.042 | debug | SET MESSAGE TIMEOUT TIMER: 120000
smartmeter.1 | 2023-10-24 21:22:03.016 | debug | CREATE SERIALPORT: 9600 8 1 none
smartmeter.1 | 2023-10-24 21:22:03.003 | debug | SmartmeterObis options: {"debug":2,"protocol":"SmlProtocol","transport":"SerialResponseTransport","requestInterval":"300","anotherQueryDelay":"1000","transportSerialPort":"/dev/ttySMARTMETER","transportSerialBaudrate":null,"transportSerialMessageTimeout":null,"protocolSmlIgnoreInvalidCRC":false}
smartmeter.1 | 2023-10-24 21:22:02.807 | info | starting. Version 3.3.4 in /opt/iobroker/node_modules/iobroker.smartmeter, node: v18.18.2, js-controller: 5.0.14
Versions:
Additional context
The behaviour is the same as in #374.
The text was updated successfully, but these errors were encountered: