home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.81k stars 30.51k forks source link

Ubuntu app armor update causes Bluetooth sensors to stop working #117768

Closed hajo62 closed 1 week ago

hajo62 commented 5 months ago

The problem

My bluetooth sensors stopped working after the update to 2024.5.4. At the same time, I have installed some ubuntu 22.04 system updates and did a reboot. Have not changed something in the AppArmor area.

image

What version of Home Assistant Core has the issue?

2024.5.4

What was the last working version of Home Assistant Core?

2024.5.2

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Bluetooth

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bluetooth/

Diagnostics information

home-assistant_bluetooth_2024-05-20T06-47-45.111Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Posted as comment in release notes and was asked to open a issue. Hope I added all information necessary.

on ubuntu:

lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 𝜋  ~ hciconfig
hci0:   Type: Primary  Bus: UART
    BD Address: DC:A6:32:CF:13:96  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING 
    RX bytes:2281 acl:0 sco:0 events:122 errors:0
    TX bytes:2597 acl:0 sco:0 commands:99 errors:0

I have exposed the dbus stuff in my docker-compose.yaml:

    volumes:
      # DIRECTORY HOLDING HOME ASSISTANT CONFIG files
      - /home/hajo/docker-volumes/homeassistant:/config
      - /etc/localtime:/etc/localtime:ro
      # Making the DBus socket available in the Docker container 
      # See: https://www.home-assistant.io/integrations/bluetooth
      - /run/dbus:/run/dbus:ro
home-assistant[bot] commented 5 months ago

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (bluetooth) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `bluetooth` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign bluetooth` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


bluetooth documentation bluetooth source (message by IssueLinks)

bdraco commented 5 months ago

I fixed the exception not retrieved in https://github.com/Bluetooth-Devices/dbus-fast/pull/281

The app armor settings aren't controlled by Home Assistant so that's something you'll have to fix on your local system.

hajo62 commented 5 months ago

app armor settings ... so that's something you'll have to fix on your local system.

Of cause, but... I have never actively installed or activated AppArmor nor have I consciously made changes.

bdraco commented 5 months ago

https://github.com/home-assistant/core/issues/76392#issuecomment-1214300459

erlapso commented 5 months ago

Having the same issue, unclear how to address/fix it

EDIT: Actually I'm experiencing something different. Since the upgrade, my Home Assistant Yellow with Bluetooth does not seem to see the Bluetooth adapter anymore.

Screenshot 2024-05-21 at 12 24 58 PM
erkr commented 5 months ago

I have the same issue on my pi3b rev 1.2. Disabled the Bluetooth integration for now

jariloiskis commented 5 months ago

I have same issue too just like another ones

bdraco commented 5 months ago

might be related to https://github.com/home-assistant/supervisor/issues/4839 but not sure

erkr commented 5 months ago

Maybe it's related to haos 12.3

https://github.com/home-assistant/core/issues/117225

hajo62 commented 5 months ago

Maybe it's related to haos 12.3

Hhm. At least I go with docker in ubuntu 22.04...

hajo62 commented 4 months ago

Some more info: hcitool lescan called from inside the HA container as well as outside shows lots of devices including my MJ_HT_V1 device.

docker exec -it homeassistant /bin/sh

/config # hcitool -i hci0 leinfo  4C:65:A8:DD:FF:D3
Requesting information ...
    Handle: 64 (0x0040)
    LMP Version: 4.1 (0x7) LMP Subversion: 0x64
    Manufacturer: Nordic Semiconductor ASA (89)
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

But the integration shows the same error status.

I have copied this docker-default to /etc/apparmor.d/docker-default and fired this command: aa-disable /etc/apparmor.d/docker-default

After this the integration shows no error anymore; but still no sensors

rewse commented 3 months ago

I have copied this docker-default to /etc/apparmor.d/docker-default and fired this command: aa-disable /etc/apparmor.d/docker-default

I had the same issue with HA Container 2024.7.2 on Ubuntu 24.04, but this command solved it. For example, the SwtichBot Bluetooth integration is working fine now.

issue-triage-workflows[bot] commented 2 weeks ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.