bluetooth icon indicating copy to clipboard operation
bluetooth copied to clipboard

Ubuntu 22.04 Error AddService - Failed to create characteristic entry in database

Open Martim-Sensefinity opened this issue 1 year ago • 5 comments
trafficstars

Bluetooth version: bluetoothctl: 5.75

Version: 0.9.0

Ubuntu version: Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy

Logs

Apr 17 20:13:15 martim-sensefinity bluetoothd[25936]: src/gatt-database.c:database_add_chrc() Failed to create characteristic entry in database
Apr 17 20:13:15 martim-sensefinity bluetoothd[25936]: src/gatt-database.c:database_add_service() Failed to add characteristic
Apr 17 20:13:15 martim-sensefinity bluetoothd[25936]: src/gatt-database.c:database_add_app() Failed to add service
Apr 17 20:13:15 martim-sensefinity bluetoothd[25936]: src/gatt-database.c:client_ready_cb() Failed to create GATT service entry in local database

Code (same as example Nordic server)

must("add service", adapter.AddService(&bluetooth.Service{
		UUID: serviceUUID,
		Characteristics: []bluetooth.CharacteristicConfig{
			{
				Handle: &rxChar,
				UUID:   rxUUID,
				Flags:  bluetooth.CharacteristicWritePermission | bluetooth.CharacteristicWriteWithoutResponsePermission,
				WriteEvent: func(client bluetooth.Connection, offset int, value []byte) {
					txChar.Write(value)
					for _, c := range value {
						rawterm.Putchar(c)
					}
				},
			},
			{
				Handle: &txChar,
				UUID:   txUUID,
				Flags:  bluetooth.CharacteristicNotifyPermission | bluetooth.CharacteristicReadPermission,
			},
		},
	}))

I tested the version 0.8.0 same error I also tested using bluetoothctl with -experimental flag

Martim-Sensefinity avatar Apr 17 '24 19:04 Martim-Sensefinity

Issue 46 looks similar error

Martim-Sensefinity avatar Apr 17 '24 19:04 Martim-Sensefinity

I downgraded bluetoothctl to 5.66 and works.

The version number is suggested in: bluez.org/download I followed the following tutorial: askubuntu.com

Reboot was required.

Martim-Sensefinity avatar Apr 17 '24 19:04 Martim-Sensefinity

I'm also experiencing the same error on Arch Linux.

Looks like it's similar issue reported on other repo. https://github.com/bluez/bluez/issues/821

webcaptcha avatar Apr 27 '24 06:04 webcaptcha

I can confirm this is an issue with BlueZ 5.75 on Fedora 39. It appears to be an upstream bug, so I'll wait until they've investigated the issue. Thanks @webcaptcha for pointing to the upstream bug report!

aykevl avatar Apr 27 '24 08:04 aykevl

Looks like the bug has been found and a fix submitted, so hopefully this will be fixed in the next BlueZ version. (In the meantime I hope we can find a workaround for this bug!)

aykevl avatar May 03 '24 16:05 aykevl

This is fixed in BlueZ 5.75 (tested on Fedora 40). I don't think there's anything to fix here from our side, so closing.

aykevl avatar May 25 '24 20:05 aykevl