Skip to content
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

dbus[70]: arguments to dbus_connection_get_object_path_data() were incorrect #79

Closed
Sjeff opened this issue Jan 9, 2019 · 22 comments
Closed

Comments

@Sjeff
Copy link

Sjeff commented Jan 9, 2019

Running Intel NUC Docker Configuration.

After i updated to latest beta i receive the following error.

Looks like everything is working as is should be.
Thought i would be good to report this error anyway.

dbus[70]: arguments to dbus_connection_get_object_path_data() were incorrect, assertion "connection != NULL" failed in file ../../../dbus/dbus-connection.c line 5904.

This is normally a bug in some application using the D-Bus library.

   D-Bus not built with -rdynamic so unable to print a backtrace
> XX:XX:XX:XX:XX:XX has not previously connected to hci0
> XX:XX:XX:XX:XX:XX will publish updates to: monitor/home/XX:XX:XX:XX:XX:XX
> YY:YY:YY:YY:YY:YY has not previously connected to hci0
> YY:YY:YY:YY:YY:YY will publish updates to: monitor/home/YY:YY:YY:YY:YY:YY
@andrewjfreyer
Copy link
Owner

Appreciate the report, but since docker isn't the default method for running this script (although it may be in the future), I'll go ahead and close this. Please follow up if you notice anything negative happening.

Thanks!

@hatemzidi
Copy link

hatemzidi commented Feb 8, 2019

i know that this issue is closed but i managed to fix the bluetooth problem under docker.

i'm using

  • Intel NUC NUC7CJYH
  • Debian stretch with kernel 4.19.0-0.bpo.1-amd64
  • docker v.18.09.1, build 4c52b90

i managed to create an image using this Docker file:

FROM debian:stretch-slim

RUN set -x && \
    apt-get update && \
    apt-get install -y  --no-install-recommends \
        bash \
        bc \
        bluez \
        bluez-hcidump \
        bluetooth \
#        usbutils \ #if you are using an external usb stick
        ca-certificates \
        curl \
        git \
        mosquitto-clients

RUN mkdir /monitor && \
    git clone https://github.com/andrewjfreyer/monitor.git /monitor

VOLUME ["/monitor", "/config"]

# Set up the entry point script and default command
COPY run.sh /
RUN chmod +x /run.sh
ENTRYPOINT ["/run.sh"]

WORKDIR /monitor

CMD ["/bin/bash", "monitor.sh", "-D", "/config"]

the run.sh file

#!/bin/bash
set -e

# inspired from https://github.com/moby/moby/issues/16208#issuecomment-161770118
service dbus start
service bluetooth start
hciconfig hci0 up

exec "$@"

my docker-compose.

version: '3'

services:
  monitor.sh:
    build:
      context: /PATH/TO/YOUR/DOCKERFILE
    image: hatemzidi/monitor.sh:v0.1.981
    container_name: monitor.sh-test
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /srv/monitor/config:/config
    network_mode: host
    privileged: true
    command: bash monitor.sh -x -a -D /config

just run docker-compose up, configure your monitor properly and rerun it.
et voilà :)

@andrewjfreyer
Copy link
Owner

Thanks for the follow-up!

@Sjeff
Copy link
Author

Sjeff commented Mar 16, 2019

@hatemzidi do you have a working dockerfile with mosquitto 1.5+ for the latest monitor update?

@hatemzidi
Copy link

@Sjeff since i'm using mosquitto with other services, i just added it in my docker-compose as a separate service and linked monitor with mosquitto.

@Sjeff
Copy link
Author

Sjeff commented Mar 17, 2019

@hatemzidi can you share the docker-compose file?
i'm running mosquitto in a separate container already.

@hatemzidi
Copy link

hatemzidi commented Mar 18, 2019

@Sjeff
here is a snippet of my docker-compose

version: '3'

services:
#[...]
  monitor.sh:
    image: hatemzidi/monitor.sh:v0.2.053
    container_name: monitor.sh
    restart: always
    network_mode: host
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /run/dbus:/run/dbus
      - /etc/localtime:/etc/localtime:ro
      - ./config/monitor:/config
    privileged: true
    cap_add:
      - NET_ADMIN
    command: bash monitor.sh -x -a -D /config

  mosquitto:
    container_name: mosquitto
    image: eclipse-mosquitto:latest
    ports:
      - "1883:1883/tcp"
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/mosquitto/settings:/mosquitto/config
      - mosquitto-data:/mosquitto/data

#[...]

since monitor is in host mode, i call the mosquitto using the loopback (localhost:1883)

ps: my images aren't shared yet on docker hub.

@Sjeff
Copy link
Author

Sjeff commented Mar 18, 2019

Thanks @hatemzidi compose file is kinda similar to mine.

When updating to latest version 0.2.068 we need mosquitto_pub and mosquitto_sub version 1.5+.
its seems there is no mosquitto-clients package version 1.5+ yet.

@hatemzidi
Copy link

@Sjeff i just verified my mosquitto image and it’s v1.5.8
my monitor image seems to work flowlessly... except some bluetooth bugs for the moment.

1552604785: mosquitto version 1.5.8 starting
1552604785: Config loaded from /mosquitto/config/mosquitto.conf.
1552604785: Opening ipv6 listen socket on port 1883.
1552604785: Warning: Address family not supported by protocol
1552604785: Opening ipv4 listen socket on port 1883.

@Sjeff
Copy link
Author

Sjeff commented Mar 19, 2019

When i update the monitor image to the latest version :
(when i change back to version 0.2.053 no issues at all)

====================== DEBUG ======================
starting monitor.sh (v. 0.2.068)...
report all scan results mode enabled
retaining mqtt status reports
generic bluetooth beacon, ibeacon, and known beacon address reporting mode enabled
trigger mode: report out MQTT arrive/depart scan triggers to other devices
trigger mode: depart scan only on MQTT trigger
using custom config directory [/config]
error: minimum required mosquitto_sub version 1.5+ not found. please update.
error: minimum required mosquitto_pub version 1.5+ not found. please update.
using /config as config dir
preference: using default mqtt protocol version

Dockerfile:

FROM debian:stretch-slim

RUN set -x && \
    apt-get update && \
    apt-get install -y  --no-install-recommends \
        bash \
        bc \
        bluez \
        bluez-hcidump \
        bluetooth \
#        usbutils \ #if you are using an external usb stick
        ca-certificates \
        curl \
        git \
        mosquitto-clients

RUN mkdir /monitor && \
    git clone https://github.com/andrewjfreyer/monitor.git /monitor

VOLUME ["/monitor", "/config"]

# Set up the entry point script and default command
COPY run.sh /
RUN chmod +x /run.sh
ENTRYPOINT ["/run.sh"]

WORKDIR /monitor
    
CMD ["/bin/bash", "monitor.sh", "-D", "/config"]

mosquitto version:

/ # mosquitto --help
mosquitto version 1.5.8

mosquitto is an MQTT v3.1.1 broker.

mosquitto log:

1552979599: mosquitto version 1.5.8 starting
1552979599: Config loaded from /mosquitto/config/mosquitto.conf.
1552979599: Opening ipv4 listen socket on port 1883.
1552979599: Opening ipv6 listen socket on port 1883.

@hatemzidi
Copy link

preference: using default mqtt protocol version

did you force the version in your preferences ?

mqtt_version='mqttv311'

@Sjeff
Copy link
Author

Sjeff commented Mar 19, 2019

Here are the mosquitto_preferences:
I use a username and password.

same error occurse when i use

mqtt_version='mqttv311'
# ---------------------------
#
# MOSQUITTO PREFERENCES
#
# ---------------------------

# IP ADDRESS OR HOSTNAME OF MQTT BROKER
mqtt_address=x.x.x.x

# MQTT BROKER USERNAME (OR BLANK FOR NONE)
mqtt_user= 

# MQTT BROKER PASSWORD (OR BLANK FOR NONE)
mqtt_password= 

# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath=monitor

# PUBLISHER IDENTITY
mqtt_publisher_identity='first floor'

# MQTT PORT
mqtt_port='1883'

# MQTT CERTIFICATE FILE (LEAVE BLANK IF NONE)
mqtt_certificate_path=''

#MQTT VERSION (LEAVE BLANK FOR DEFAULT; EXAMPLE: 'mqttv311')
mqtt_version=''

@hatemzidi
Copy link

@Sjeff
could you please check this ?

dpkg -s mosquitto-clients | grep '^Version:'

i have a feeling that this package isn't updated.

@Sjeff
Copy link
Author

Sjeff commented Mar 19, 2019

From inside the monitor container.

pi@raspberrypi:/srv/docker/monitor $ docker exec -it monitor /bin/bash
root@raspberrypi:/monitor# dpkg -s mosquitto-clients | grep '^Version:'
Version: 1.4.10-3+deb9u4
root@raspberrypi:/monitor# 

@hatemzidi
Copy link

aha ... here is it ...
i may have to change/update the dockerfile to force the good version.
debian stretch delivers version 1.4.10-3+deb9u4 marked as stable.

@Sjeff
Copy link
Author

Sjeff commented Mar 19, 2019

yes we should be able to add : https://packages.debian.org/buster/mosquitto-clients

@Sjeff
Copy link
Author

Sjeff commented Mar 19, 2019

When building the dockerfile FROM debian:buster-slim the problem seems to be solved.

pi@raspberrypi:/srv/docker/monitor $ docker exec -it monitor /bin/bash
root@raspberrypi:/monitor# dpkg -s mosquitto-clients | grep '^Version:'
Version: 1.5.7-1
root@raspberrypi:/monitor# 

@xenio
Copy link

xenio commented Apr 28, 2019

@hatemzidi I am trying to build on my Intel NUC monitor.sh with your docker files, I am almost there but when on Home Assistant restart publish the topic "monito/scan/restart" to refresh the devices I get this:

monitor.sh | monitor.sh: line 1201: systemctl: command not found
monitor.sh | monitor.sh: line 74: pkill: command not found
monitor.sh | Exited.

any help?

@andrewjfreyer
Copy link
Owner

I will probably have to fix this on my side. The restart command doesn't work easily with docker.

@xenio
Copy link

xenio commented Apr 28, 2019

Could you please share your latest Dockerfile, docker-compose and run.sh?
I am trying to run monitor.sh on my Intel Nuc but it's all day I am trying unsuccessful. With the Raspberry Pi it is working fine (latest beta branch) but I want to dismiss the Raspberry.
For the presence I am using a Bluetooth Tile.

@hatemzidi
Copy link

@xenio hi, sorry for the late reply.

as @andrewjfreyer said, i guess that's how monitor works for restart.
nevertheless, that command won't work on a/my docker image as it's not running as a service/daemon but as the unique process.

my dockerfile above is to update too, as @Sjeff montioned by changing the image to debian:buster-slim rather than debian:stretch-slim.

@andrewjfreyer
Copy link
Owner

@xenio you can always trigger a restart of monitor by restarting the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants