Wifi-connect Error: Cannot get the NetworkManager service state

Hello, I’m attempting to do a multi-container environment. I am getting this error when running the wifi-connect start.sh. Cannot get the NetworkManager service state

Cannot get the NetworkManager service state thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: D-Bus error: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory (org.freedesktop.DBus.Error.FileNotFound)', /checkout/src/libcore/result.rs:906:4 note: Run with RUST_BACKTRACE=1 for a backtrace.

This is my docker-compose

`version: ‘2’

services:
wifi-connect:
build: ./wifi-connect
expose:

  • “80”

gateway:
build: ./gateway
command: gateway:/mozilla-iot/gateway/run-app.sh
image: mozillaiot/gateway:arm
depends_on:

  • wifi-connect
    expose:
  • “8080”

volumes:
wifi-connect:
gateway:`

I also tried not exporting DBUS_SYSTEM_BUS_ADDRESS but I still have the same issue when I run bash start.sh in the service terminal.

@mowi22 I think you are probably missing the io.balena.features.dbus label on your service(s) so that the dbus socket is mounted to the host as mentioned in the docs here https://www.balena.io/docs/learn/develop/runtime/#dbus-communication-with-host-os and you can see all the label options and their defaults here https://www.balena.io/docs/reference/supervisor/docker-compose/#labels

Thank you, this worked

@mowi22 can you share your docker-compose file , i am still getting same error after adding io.balena.features.dbus labels

@yyogeshwar it should look like this:

version: '2'
services:
  mycontainer:
    build: ./mycontainer
    expose:
      - "80"
    labels:
      io.balena.features.dbus: '1'

Can you give us more info about the error that you are getting? Could you paste your docker-compose so that we can take a look?

Hi ,
Below is my docker-compose file and error output. I am running it on jetson tx2

Error screenshot

Hi,

Your error is highlighting that the host DBUS isn’t being used; the label exposes /host/run/dbus/system_bus_socket and your vnc-app service should use this instead of /var/run/dbus/system_bus_socket.

Change that in your implementation and it should be OK :+1: