[SOLVED] Qnap container oh2.4 /dev/ttyACM0

Using

version: '2.2'

services:
    openhab:
        image: "openhab/openhab:2.4.0.M3-amd64-debian-data-12"
        restart: always
        network_mode: host
        devices:
        - "/dev/ttyACM0:/dev/ttyACM0:rwm"
        - "/dev/ttyUSB0:/dev/ttyUSB0:rwm"
        volumes:
        - "/share/Container/openHab/addons:/openhab/addons"
        - "/share/Container/openHab/conf:/openhab/conf"
        - "/share/Container/openHab/userdata:/openhab/userdata"
        environment:
            OPENHAB_HTTP_PORT: "8090"
            OPENHAB_HTTPS_PORT: "8443"
            EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"

but still getting this error

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK…ttyUSB0: File exists.

testRead() Lock file failed

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK…ttyACM0: File exists.

testRead() Lock file failed

Please help

If this is using the Docker container, or something like the Docker container, then there is currently a bug where the locks are not being removed when the container restarts. For Docker, you can go into the container and manually delete the lock files and restart the container.