# Database insert exception errors in the logs

**URL:** <https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148>\
**Category:** Live TV & DVR\
**Created:** [October 6, 2023, 9:45am UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148 "2023-10-06T09:45:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [October 6, 2023, 9:45am UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/1 "2023-10-06T09:45:55Z")

</div>

> [@I'm finding Plex server stopped every day](https://forums.plex.tv/t/im-finding-plex-server-stopped-every-day/855256/26):
>
> @sa2000 could you check also my logs?  
> [Plex Media Server Logs\_2023-10-05\_17-10-06.zip](https://forums.plex.tv/uploads/short-url/4VyvPE7MqySPkEsSBbMXeclw9rX.zip) (3.8 MB)

I would like to follow up on another issue I am seeing in your logs - relates to your DVRs and the Plex Media Server database - I will create a separate forum topic for this for you - once I have the information I need to investigate:

Could you download the Plex Media Server Database zip - through the Plex Web Settings / Troubleshooting web page and send it to me - probably too big to attach, so please upload externally and send me link by private message

Your logs show errors inserting entries into the database for a DVR

```auto
Oct 04, 2023 23:34:52.095 [7884] ERROR - [Grabber] SQLITE3:0x7ff73c3c7d20, 2067, abort at 34 in [update media_provider_resources set parent_id=:media_provider_resources_parent_id,type=:media_provider_resources_type,status=:media_provider_resources_status,state=:media_provider_resources_state,identifier=:media_provider_resources_identifier,protocol=:media_provider_resources_protocol,uri=:media_provider_resources_uri,uuid=:media_provider_resources_uuid,extra_data=:media_provider_resources_extra_data,last_seen_at=:media_provider_resources_last_seen_at,created_at=:media_provider_resources_created_at,updated_at=:media_provider_resources_updated_at where id=:media_provider_resources_id]: UNIQUE constraint failed: media_provider_resources.uuid

Oct 04, 2023 23:34:52.095 [7884] ERROR - [Grabber] Exception inside transaction (inside=1) (E:\jenkins\server\4164555190\MediaProviders\Grabbers\MediaGrabber.cpp:171): sqlite3_statement_backend::loadOne: UNIQUE constraint failed: media_provider_resources.uuid

Oct 04, 2023 23:34:52.095 [7884] DEBUG - DVR:Device: Device was alive, refreshed device://tv.plex.grabbers.hdhomerun/2022-09-BQIH-Z6V6QE:4.

```

We addressed issues like this before on VBox DVRs - looks like a similar issue or may be the fix needs further tweaks. We try to create a unique uuid (device identifier) for each DVR to add entries for in the database and this is failing with the above error

Could you please get me the responses from these requests - saving each in a text file with a suitable name to identify the request

```auto
http://costinr:S1_3_b1n3@192.168.100.216:34400/discover.json
http://costinr:S1_3_b1n3@192.168.100.216:34400/lineup_status.json

```

Could you also do the same for these - are these for the same physical DVR?

```auto
https://costinr:S1_3_b1n3@cloud.rizescu.eu:2087/discover.json
https://costinr:S1_3_b1n3@cloud.rizescu.eu:2087/lineup_status.json

```

and these

```auto
http://costinr:S1_3_b1n3@192.168.100.17:34400/discover.json
http://costinr:S1_3_b1n3@192.168.100.17:34400/lineup_status.json

```

and these - are these the same DVR as the one above?

```auto
http://costinr:C31_ma1_b1n3@192.168.100.17:34400/discover.json
http://costinr:C31_ma1_b1n3@192.168.100.17:34400/lineup_status.json

```

---

<div class="post-metadata">

**Author:** ![costinr](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@costinr](https://forums.plex.tv/u/costinr)\
**Post date:** [October 6, 2023, 6:10pm UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/2 "2023-10-06T18:10:55Z")

</div>

> [@I'm finding Plex server stopped every day](https://forums.plex.tv/t/im-finding-plex-server-stopped-every-day/855256/26):
>
> > [@I'm finding Plex server stopped every day](https://forums.plex.tv/t/im-finding-plex-server-stopped-every-day/855256/26):
> >
> > @sa2000 could you check also my logs?  
> > [Plex Media Server Logs\_2023-10-05\_17-10-06.zip](https://forums.plex.tv/uploads/short-url/4VyvPE7MqySPkEsSBbMXeclw9rX.zip) (3.8 MB)
> 
> I would like to follow up on another issue I am seeing in your logs - relates to your DVRs and the Plex Media Server database - I will create a separate forum topic for this for you - once I have the information I need to investigate:
> 
> Could you download the Plex Media Server Database zip - through the Plex Web Settings / Troubleshooting web page and send it to me - probably too big to attach, so please upload externally and send me link by private message
> 
> Your logs show errors inserting entries into the database for a DVR
> 
> ```auto
> Oct 04, 2023 23:34:52.095 [7884] ERROR - [Grabber] SQLITE3:0x7ff73c3c7d20, 2067, abort at 34 in [update media_provider_resources set parent_id=:media_provider_resources_parent_id,type=:media_provider_resources_type,status=:media_provider_resources_status,state=:media_provider_resources_state,identifier=:media_provider_resources_identifier,protocol=:media_provider_resources_protocol,uri=:media_provider_resources_uri,uuid=:media_provider_resources_uuid,extra_data=:media_provider_resources_extra_data,last_seen_at=:media_provider_resources_last_seen_at,created_at=:media_provider_resources_created_at,updated_at=:media_provider_resources_updated_at where id=:media_provider_resources_id]: UNIQUE constraint failed: media_provider_resources.uuid
> 
> Oct 04, 2023 23:34:52.095 [7884] ERROR - [Grabber] Exception inside transaction (inside=1) (E:\jenkins\server\4164555190\MediaProviders\Grabbers\MediaGrabber.cpp:171): sqlite3_statement_backend::loadOne: UNIQUE constraint failed: media_provider_resources.uuid
> 
> Oct 04, 2023 23:34:52.095 [7884] DEBUG - DVR:Device: Device was alive, refreshed device://tv.plex.grabbers.hdhomerun/2022-09-BQIH-Z6V6QE:4.
> 
> ```
> 
> We addressed issues like this before on VBox DVRs - looks like a similar issue or may be the fix needs further tweaks. We try to create a unique uuid (device identifier) for each DVR to add entries for in the database and this is failing with the above error
> 
> Could you please get me the responses from these requests - saving each in a text file with a suitable name to identify the request
> 
> ```auto
> http://costinr:S1_3_b1n3@192.168.100.216:34400/discover.json
> http://costinr:S1_3_b1n3@192.168.100.216:34400/lineup_status.json
> 
> ```
> 
> Could you also do the same for these - are these for the same physical DVR?
> 
> ```auto
> https://costinr:S1_3_b1n3@cloud.rizescu.eu:2087/discover.json
> https://costinr:S1_3_b1n3@cloud.rizescu.eu:2087/lineup_status.json
> 
> ```
> 
> and these
> 
> ```auto
> http://costinr:S1_3_b1n3@192.168.100.17:34400/discover.json
> http://costinr:S1_3_b1n3@192.168.100.17:34400/lineup_status.json
> 
> ```
> 
> and these - are these the same DVR as the one above?
> 
> ```auto
> http://costinr:C31_ma1_b1n3@192.168.100.17:34400/discover.json
> http://costinr:C31_ma1_b1n3@192.168.100.17:34400/lineup_status.json
> 
> ```

None of the DVR’s are up anymore.  
I’ve tried several tuners with Live TV & DVR but I gave up because there were a lot of errors (wrong or missing recordings, wrong EPG mappings, etc.)  
Thank you very much,

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [October 9, 2023, 11:26am UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/3 "2023-10-09T11:26:30Z")

</div>

@costinr the issue I noticed in the logs relating to DVRs in now moved from [I'm finding Plex server stopped every day - #26 by costinr](https://forums.plex.tv/t/im-finding-plex-server-stopped-every-day/855256/26) to this topic

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [October 9, 2023, 12:31pm UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/4 "2023-10-09T12:31:02Z")

</div>

Thank you for sending me the database zip and json responses from the DVR devices

The issue appears to be due to the same device is being accessed with more than one http url - I don’t know if this was a configuration error or it could legitimately arise

Both of these have entries in the database with different deviceID’s but at this moment they are both returning the same deviceID

```auto
http://costinr:S1_3_b1n3@192.168.100.17:34400/discover.json

http://costinr:C31_ma1_b1n3@192.168.100.17:34400/discover.json

```

---

<div class="post-metadata">

**Author:** ![costinr](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@costinr](https://forums.plex.tv/u/costinr)\
**Post date:** [October 9, 2023, 12:53pm UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/5 "2023-10-09T12:53:06Z")

</div>

> [@sa2000](#):
>
> he same device is being accessed with more than one http url

But all DVR’s are deleted in PMS, since several month ago, I’m wondering why PMS is still trying to access that machines?  
Thank you,

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [October 9, 2023, 1:10pm UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/6 "2023-10-09T13:10:48Z")

</div>

> [@costinr](#):
>
> But all DVR’s are deleted in PMS, since several month ago, I’m wondering why PMS is still trying to access that machines?

At this moment DVRs are never removed but - soft deleted - in case they come back again, We allow users to delete and recreate DVRs and all continues as before

I have been discussing with the development team the idea of providing a Delete All Data option on the Delete DVR command

Where does the DeviceID come from in your xSteVe setup  
Trying to understand how the id’s are set

This url  
`http://costinr:S1_3_b1n3@192.168.100.17:34400/discover.json`  
previously returned deviceID: 2022-06-1CRZ-KLYJ8J:8  
It is now returning deviceID: 2022-09-S0VS-KKUGFW:8

This url  
`http://costinr:C31_ma1_b1n3@192.168.100.17:34400/discover.json`  
previously returned deviceID: 2022-09-S0VS-KKUGFW:8  
and continues to return deviceID: 2022-09-S0VS-KKUGFW:8

For real actual physical DVRs - the manufacturer would give a unique device Idenfifier

I do not know how xSteVe is setup and why the deviceID changed

---

<div class="post-metadata">

**Author:** ![costinr](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@costinr](https://forums.plex.tv/u/costinr)\
**Post date:** [October 9, 2023, 8:11pm UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/7 "2023-10-09T20:11:35Z")

</div>

> [@sa2000](#):
>
> I do not know how xSteVe is setup and why the deviceID changed

I could have a possible explanation: when I’ve made tests with Plex DVR, trying to obtain a functional PMS DVR, I’ve changed several times the xteve machines, and I’ve made backups from inside xteve interface (only xteve backups, not Plex). Also, for testing purposes, I’ve raised up to 4 Plex servers, all connected with my Plex account, each server with it’s own DVR. But when I’ve restored the xteve backups, there is a big probability the backups were switched between them. Also, I’ve switched back and forth between 2 versions of xteve.  
Thank you,

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [October 10, 2023, 10:21am UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/8 "2023-10-10T10:21:10Z")

</div>

I will discuss with the development team. It is effectively a configuration error. I will send you by PM edits to the database to remove the two entries in the provider\_media\_resources table that have the same deviceID (uuid) as what is being returned now on different virtual DVR and will see if that stops the database exception errors - I mentioned before I also have a feature request to give an option to purge all DVR cached data in this table.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2024, 10:21am UTC](https://forums.plex.tv/t/database-insert-exception-errors-in-the-logs/856148/9 "2024-01-08T10:21:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
