Hello,
I have a quick question that I haven’t been able to find the answer to after several hours of searching online.
I am running a OpenHAB from OpenHABian, and the text-based rules I have developed over the years are displayed as immutable entries under ‘Rules’ in the configuration section.
Now, I have set up a container with the current 4.x version, but the *.rules files are no longer displayed under ‘Rules’ in the settings.
Is this a setting problem? Am I doing something wrong?
Maybe someone here has the solution as to why the rules are displayed in one instance, but not in the Docker instance.
10:01:18.240 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'MitAutomatisierung.rules'
10:01:18.834 [INFO ] [del.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'MitAutomatisierung.rules', using it anyway:
The import 'org.openhab.core.model.script.ScriptServiceUtil' is never used.
The import 'java.util.Map' is never used.
The import 'java.util.Set' is never used.
10:01:18.848 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'demo.rules'
Then I’m not sure why they don’t show up. If they otherwise work you can file an issue. There isn’t a whole lot you can do with unmanaged rules in MainUI so the fact that they dont’ show up isn’t that big of a deal. But they should show up.
Note this really has nothing to do with Docker or anything like that. If it’s loading the files in the first place it’s beyond any of those differences in deployments.
Hi,
after some more testing, I would say that the issue is deeper.
The rules, as show above, are loaded but do not work, also the log system does not work.
I can add items via the UI, but any config-files in the config directory seem to be inoperable. Custom icons are usable though.
I then whent ahead and setup the container from WSL2 and everything works.
I assume, that this is an issue stemming from the Linux-Docker Container running in an Windows environment on an NFS drive. The WSL2 seems to fix that issue.
Has anyone managed to setup a direct windows docker container without going through WSL, or is the indirect way via WSL2 the only way to go?
This part could be relevant as the user OH runs as inside the container (9001 if you didn’t supply the USER_ID environment property) must have read and write access on the folders. In my experience getting that to work with NFS is a real pain, so much so that some services I run I’ve given up trying to run from NFS mounts (e.g. Nextcloud, PostgreSQL, etc.).
IIRC Windows Docker doesn’t support hardware passthrough (unless something changed in the past year or so) so you may not want to go that route anyway.