Deleted outdated sensors / lights recovered after restoring backup

I delete outdated sensors and lamps in Phoscon 2.27.0 on my Raspi 4 with Bookworm HomeBridge Image (incl. all updates).
Same with previously deleted automations / sensor controls

After a restart, the previously deleted devices will appear again, deleted sensor controls / automations the same.

After a backup and subsequent restore these deleted devices also appear again.

If I insert the backup into a new installation (https://deconz.dresden-elektronik.de/sd-card-image/Phoscon_Gateway_2024-04-24_deCONZ_2_26_3.img.xz), the previously deleted devices will appear here again.

Someone else?

Hello, you haven’t issue with the database ?
Try adding a new device to see if you have same issue.
Do you have access to deconz ? The full application, you can see on logs some error that can prevent the database be updated.

I’m using the headless version and I´m not able to install VNC because I use OMV7 on the same Pi.
So no Access to deCONZ.

So need to use command line deCONZ command line parameters · dresden-elektronik/deconz-rest-plugin Wiki · GitHub
Don’t forget the -platform minimal

/usr/bin/deCONZ -platform minimal --dbg-info=2 > debug.txt

output:

libpng warning: iCCP: known incorrect sRGB profile

This plugin does not support propagateSizeHints()

This plugin does not support propagateSizeHints()

Thoses lines are normal, can add too --dbg-error=2
And as you are reading “in live” you can remove the > debug.txt

Output from

/usr/bin/deCONZ -platform minimal --dbg-error=2 --dbg-info=2 > debug.txt

while exporting backup within phsocon 2.27.2:

https://pastebin.com/vWjuKUBY

Output from

/usr/bin/deCONZ -platform minimal --dbg-error=2 --dbg-info=2 > debug.txt

while exporting backup within phoscon 2.27.2:

So the database seem good
07:39:02:871 /home/pi/.local/share/dresden-elektronik/deCONZ/zll.db exists and is writeable

But you have at start


07:39:03:418 SQL exec failed: DELETE from nodes WHERE manufacturername = '_TZ3000_4fjiwweb', error: database is locked (5)
07:39:03:418 SQL exec failed: UPDATE config2 SET value = 0 WHERE key = 'zclvaluemaxage' AND value = 3600, error: database is locked (5)

This can happen, but it need to work later, and on your log I don’t see new request DELETE or UPDATE, so can’t be sure if the database is locked or not.
You have only SELECT request and with error too, but IDK if this one is important, I think no else nothing will work.

I don’t see zigbee config network error message.

But you have problem with your USB port.

On all your pastebin log, you have a disconnection after some mn running

07:39:03:074 COM: /dev/ttyUSB0 : ConBee III : dresden elektronik (0x0403/0x6015)

07:39:06:790 COM: /dev/ttyUSB0 : ConBee III : dresden elektronik (0x0403/0x6015)
07:39:06:815 failed open com status: (-3), path: /dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03110669-if00-port0
07:39:07:780 wait reconnect 5 seconds
07:39:07:834 COM: /dev/ttyUSB0 : ConBee III : dresden elektronik (0x0403/0x6015)

07:39:11:950 COM: /dev/ttyUSB0 : ConBee III : dresden elektronik (0x0403/0x6015)
07:39:12:008 failed open com status: (-3), path: /dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03110669-if00-port0

07:39:16:944 COM: /dev/ttyUSB0 : ConBee III : dresden elektronik (0x0403/0x6015)
07:39:16:972 failed open com status: (-3), path: /dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03110669-if00-port0

You haven’t changed something ? USB 2.0 > USB 3.0, another USB extension cable, a new SSD ?
You can found some information with searching “Failed open com status (-3)”, but I don’t found the command to test for Conbee 3.

If I insert the backup into a new installation

You have tried on another host ? like a PC machine ? It’s a good way to have the GUI and check the database integrity.
But for me the more important is your USB disconnection.

Now a new HomeBridge image with Phoscon 2.27.2 via HB-Config.

Here is the log for the creation of a backup that was previously (5 Minutes before) imported into Phoscon

No external devices.
Using a 2m USB extension Cable für Conbee III.

Not better …

Error on database

16:24:38:856 SQL exec failed: CREATE TABLE if NOT EXISTS dev_resource_items ( device_id TEXT REFERENCES devices(id) ON DELETE CASCADE, item STRING NOT NULL, value NOT NULL, timestamp INTEGER NOT NULL, PRIMARY KEY (device_id, item) ON CONFLICT REPLACE), error: database disk image is malformed (11), line: 803

And still disconnection.

16:24:46:113 COM: /dev/ttyUSB0 : ConBee III : dresden elektronik (0x0403/0x6015)
16:24:46:133 failed open com status: (-3), path: /dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03110669-if00-port0

And the only link I have found is this one > Error on setup: "failed open com status: (-3)"
But for me nothing to see with you.

You are sure not haven’t 2 deconz instance ? and they are fighting for the USB port ?

The com 3 means the stick is detached.

Is there enough power ?

Shorter 1m USB extension cable.
38W USB-C power supply.

As above starting a backup within phoscon.

HomeBridge Image from here:
https://github.com/homebridge/homebridge-raspbian-image/releases/download/v1.2.0/image_2024-05-03-Homebridge-bookworm-64bit.zip

All updates installed via:
sudo apt-get autoremove && sudo apt-get -f install && sudo apt-get update && sudo apt-get upgrade -y

Phoscon up and running, but after every reboot the formally deleted items appear within Phoscon.

How to check 2 deCONZ instances?

ps ax | grep deCONZ

But @Mimiix is right, can be hardware, you can’t make a try on another host ? Installing deconz on a PC take 10 mn. If you still have the issue > problem on the gateway, else it’s on the host.

pi@homebridge:~ $ ps ax | grep deCONZ
16637 ? Ssl 0:06 /usr/bin/deCONZ -platform minimal --http-port=4530 --ws-port=4531
17019 pts/0 S+ 0:00 grep --color=auto deCONZ

The Problem is still:

sudo systemctl stop deconz
sudo systemctl start deconz-gui

sudo systemctl stop deconz-gui
sudo systemctl start deconz

and now the formally deleted items appear in the Phoscon Web Interface.

It’s fine you have only one running, the headless ATM.
Honneslty I can’t say if your problem is from the database or the disconnection, but you can’t stay with this permanent disconnection.

I have installed deCONZ 2.27.2 on my MBAir M3 (macOS 14.5), attached the Conbee III and recovered my backup.

I delete several sensors and lights.

After quitting and starting the app deCONZ, I can start Phoscon from there.

But than, the formerly delete items still appear!?!?

Is something wrong in the process of backup / restore?

Are those lights / sensors still powered on?