COVESA / dlt-daemon

Diagnostic Log and Trace.
https://covesa.github.io/dlt-daemon/
Mozilla Public License 2.0
359 stars 287 forks source link

ENXIO Error When Opening Host FIFO File from Docker Container #617

Open san-tekart opened 3 months ago

san-tekart commented 3 months ago

Description: I am experiencing an issue where my application, running inside a Docker container, fails to send DLT logs to the dlt-daemon running on the host system. Specifically, the application encounters an ENXIO (No such device or address) error when attempting to open the DLT daemon FIFO (/tmp/dlt) for writing, despite the FIFO being correctly mounted and accessible within the container. The following message is outputted when executing dlt_register_application.

"[846134.595925]~DLT~ 30~INFO ~FIFO /tmp/dlt cannot be opened. Retrying later..."

Steps to Reproduce:

  1. Start dlt-daemon on the host with the FIFO file located at /tmp/dlt.
  2. Run a Docker container with the host's /tmp/dlt directory mounted inside the container using -v /tmp/dlt:/tmp/dlt.
  3. Inside the Docker container, attempt to register a DLT application and send logs via the dlt_register_app function, which internally tries to open the FIFO file with open(dlt_daemon_fifo, O_WRONLY | O_NONBLOCK | O_CLOEXEC).

Expected Behavior: The application running inside the Docker container successfully opens the FIFO file and sends logs to the dlt-daemon running on the host.

Actual Behavior: The open() call for the FIFO file fails with errno set to 6 (ENXIO), indicating "No such device or address", preventing the application from sending logs to the host's dlt-daemon.

Environment:

Additional Context:

I suspect this issue may involve how Docker containers interact with FIFO files or a potential race condition with dlt-daemon initialization. Any insights or suggestions on how to address this problem would be greatly appreciated.

minminlittleshrimp commented 2 months ago

Hello @san-tekart this is a known issue and we have some idea to overcome. I will create PR for this as a request. Nice to have this issue on my list, thank you