Score:1

Bluetooth error "Unable to load key file"

us flag

I am on 22.04 and I have an error with my bluetooth. I can turn Bluetooth on, I can see other Bluetooth device to connect with, but I cannot connect. The toggle Connection doesn't work.

Running sudo systemctl status bluetooth.service returns the following:

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-02-01 12:22:59 EET; 12min ago
       Docs: man:bluetoothd(8)
   Main PID: 7426 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 38166)
     Memory: 808.0K
        CPU: 95ms
     CGroup: /system.slice/bluetooth.service
             └─7426 /usr/lib/bluetooth/bluetoothd

systemd[1]: Starting Bluetooth service...
bluetoothd[7426]: Bluetooth daemon 5.64
systemd[1]: Started Bluetooth service.
bluetoothd[7426]: Starting SDP server
bluetoothd[7426]: Bluetooth management interface 1.21 initialized
bluetoothd[7426]: src/device.c:load_gatt_db() Unable to load key file from /var/lib/bluetooth/84:5C:F3:92:6F:4D/cache/6E:92:30:B5:4A:0D: (No such file or directory)
bluetoothd[7426]: src/device.c:load_gatt_db() No cache for 6E:92:30:B5:4A:0D
bluetoothd[7426]: Too small Add Device complete event

Edit:

The output of sudo dmesg | grep -i blue is:

[    3.356236] Bluetooth: Core ver 2.22
[    3.356430] NET: Registered PF_BLUETOOTH protocol family
[    3.356431] Bluetooth: HCI device and connection manager initialized
[    3.356433] Bluetooth: HCI socket layer initialized
[    3.356434] Bluetooth: L2CAP socket layer initialized
[    3.356447] Bluetooth: SCO socket layer initialized
[    3.427475] Bluetooth: hci0: Legacy ROM 2.x revision 5.0 build 25 week 20 2015
[    3.428603] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.8.10-fw-22.50.19.14.f.bseq
[    3.662489] Bluetooth: hci0: Intel BT fw patch 0x43 completed & activated
[    3.996584] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    3.996587] Bluetooth: BNEP filters: protocol multicast
[    3.996589] Bluetooth: BNEP socket layer initialized
[  410.123831] Bluetooth: hci0: link tx timeout
Pilot6 avatar
cn flag
Please add output of `sudo dmesg | grep -i blue` command.
Michael Kolesidis avatar
us flag
Thanks for the reply. I added it to the original question.
Pilot6 avatar
cn flag
Try to reset the headphones. Find a manual for them. Also remove other devices.
Michael Kolesidis avatar
us flag
I did the reset and now the toggle in the settings (as in the screenshot) seems to work, but by the moment I turn it to ON, it gets back to OFF again.
Pilot6 avatar
cn flag
There is another device showing "Not Set Up". Did you try to remove it? The problem is with some other `6E:92:30:B5:4A:0D` device.
Michael Kolesidis avatar
us flag
How can I remove all devices?
Pilot6 avatar
cn flag
You can click them and remove.
Score:0
nl flag

I encountered the same problem today when I tried to pair my bluetooth mouse on both Windows and Ubuntu of the same PC. I renamed /var/lib/bluetooth/PC:MAC:ADDRESS/MOUSE:MAC:ADDRESS to match the mouse address on Windows, and when I restart bluetooth.service, it fails with "Unable to load key file" error. Turns out there need to be a cached attribute file in /var/lib/bluetooth/PC:MAC:ADDRESS/cache directory, which should match the name and content of MOUSE:MAC:ADDRESS directory too. So I have to remove MOUSE:MAC:ADDRESS directory (which in your case is 6E:92:30:B5:4A:0D), restart bluetooth service, and everything works fine again (though I still have to repair my mouse).

Note that removing this directory requires sudo -i first.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.