# Deleted outdated sensors / lights recovered after restoring backup

**URL:** <https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902>\
**Category:** General\
**Created:** [May 26, 2024, 8:12pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902 "2024-05-26T20:12:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 26, 2024, 8:12pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/1 "2024-05-26T20:12:10Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 27, 2024, 7:29am UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/2 "2024-05-27T07:29:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 27, 2024, 7:11pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/3 "2024-05-27T19:11:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 28, 2024, 1:01pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/4 "2024-05-28T13:01:05Z")

</div>

So need to use command line [deCONZ command line parameters · dresden-elektronik/deconz-rest-plugin Wiki · GitHub](https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/deCONZ-command-line-parameters#available-debug-parameters)  
Don’t forget the `-platform minimal`

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 29, 2024, 7:49am UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/5 "2024-05-29T07:49:54Z")

</div>

/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()

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 29, 2024, 1:22pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/6 "2024-05-29T13:22:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 29, 2024, 6:27pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/7 "2024-05-29T18:27:39Z")

</div>

> **[deCONZ Log - Pastebin.com](https://pastebin.com/1rCADKQc)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 30, 2024, 5:36am UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/8 "2024-05-30T05:36:09Z")

</div>

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](https://pastebin.com/vWjuKUBY)

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 30, 2024, 5:41am UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/9 "2024-05-30T05:41:34Z")

</div>

Output from

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

while exporting backup within phoscon 2.27.2:

> **[Phoscon Backup - Pastebin.com](https://pastebin.com/kQpariFs)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 30, 2024, 3:00pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/10 "2024-05-30T15:00:43Z")

</div>

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

```auto

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 31, 2024, 2:29pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/11 "2024-05-31T14:29:43Z")

</div>

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.

> **[Phoscon 2.27.2 exporting backup - Pastebin.com](https://pastebin.com/f2kYTkP1)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 31, 2024, 3:36pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/12 "2024-05-31T15:36:42Z")

</div>

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.

```auto
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)"](https://forum.phoscon.de/t/error-on-setup-failed-open-com-status-3/646)  
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 ?

---

<div class="post-metadata">

**Author:** ![Mimiix](https://forum.phoscon.de/user_avatar/forum.phoscon.de/mimiix/32/10_2.png) [@Mimiix](https://forum.phoscon.de/u/Mimiix)\
**Post date:** [May 31, 2024, 3:40pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/13 "2024-05-31T15:40:32Z")

</div>

The com 3 means the stick is detached.

Is there enough power ?

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 31, 2024, 4:24pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/14 "2024-05-31T16:24:34Z")

</div>

> **[Backup Phoscon 2.27.2 - Pastebin.com](https://pastebin.com/yA8A6X9W)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

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](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.

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 31, 2024, 5:03pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/15 "2024-05-31T17:03:27Z")

</div>

How to check 2 deCONZ instances?

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 31, 2024, 5:08pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/16 "2024-05-31T17:08:43Z")

</div>

```auto
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.

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 31, 2024, 5:21pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/17 "2024-05-31T17:21:28Z")

</div>

> [@Smanar](#):
>
> `ps ax | grep deCONZ`

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.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [May 31, 2024, 5:52pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/18 "2024-05-31T17:52:02Z")

</div>

> [@dvbcheck](#):
>
> 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

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.

---

<div class="post-metadata">

**Author:** ![dvbcheck](https://forum.phoscon.de/user_avatar/forum.phoscon.de/dvbcheck/32/4238_2.png) [@dvbcheck](https://forum.phoscon.de/u/dvbcheck)\
**Post date:** [May 31, 2024, 6:02pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/19 "2024-05-31T18:02:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Mimiix](https://forum.phoscon.de/user_avatar/forum.phoscon.de/mimiix/32/10_2.png) [@Mimiix](https://forum.phoscon.de/u/Mimiix)\
**Post date:** [May 31, 2024, 6:10pm UTC](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902/20 "2024-05-31T18:10:27Z")

</div>

Are those lights / sensors still powered on?

[Next page](https://forum.phoscon.de/t/deleted-outdated-sensors-lights-recovered-after-restoring-backup/4902.md?page=2)
