Plex Media Server constantly backing up database

Server Version#: 1.32.4.7164

I am having an issue that has me totally stumped. I have Plex Media Server running on my Synology NAS from the official packages, and all of the sudden Plex insists on backing up the database every 15-20 seconds or so. I see it happening in the “Activity” area in Plex Web. I’ve tried:

  • Disabling scheduled backups
  • Changing the database backup path
  • Completely removing the database and re-adding all of my media (losing all of my metadata in the process, which I do have backed up, thankfully)

Is there something that would cause Plex Media Server to repeatedly attempt to backup?

Please download the server logs ZIP file and attach it.

The activity will also be recorded in those logs.

There’s something else going woefully wrong.

Oh thanks for the reminder, I thought I attached the logs, but I forgot. I’ve downloaded a fresh copy now and attached here.
Plex Media Server Logs_2023-06-06_18-53-43.zip (590.1 KB)

Enable DEBUG logging please.

You turned it off at some point.

All I see are INFO, WARN, and the occasional ERROR statement; none of which are useful.

This, however, does not bode well.
Looks like DB corruption but need more to be definitive.

Jun 06, 2023 18:45:31.443 [140271110527800] ERROR - [Grabber] SQLITE3:0x80000001, 2067, abort at 46 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
Jun 06, 2023 18:45:31.443 [140271110527800] ERROR - [Grabber] Exception inside transaction (inside=1) (/data/jenkins/server/3530756315/MediaProviders/Grabbers/MediaGrabber.cpp:171): sqlite3_statement_backend::loadOne: UNIQUE constraint failed: media_provider_resources.uuid
Jun 06, 2023 18:45:31.457 [140271110527800] ERROR - [Grabber] SQLITE3:0x80000001, 2067, abort at 46 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
Jun 06, 2023 18:45:31.457 [140271110527800] ERROR - [Grabber] Exception inside transaction (inside=1) (/data/jenkins/server/3530756315/MediaProviders/Grabbers/MediaGrabber.cpp:171): sqlite3_statement_backend::loadOne: UNIQUE constraint failed: media_provider_resources.uuid
Jun 06, 2023 18:45:34.413 [140271082412856] WARN - [Req#6f] QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Jun 06, 2023 18:45:34.413 [140271082412856] WARN - [Req#6f] QueryParser: Invalid field 'pinnedContentDirectoryID' found, ignoring.
Jun 06, 2023 18:45:34.537 [140271215897232] WARN - [DatabaseFixups] Held transaction for too long (/data/jenkins/server/3530756315/Library/DatabaseFixups.cpp:357): 0.260000 seconds
Jun 06, 2023 18:45:34.559 [140271070038840] ERROR - downloadContainer: expected MediaContainer element, found html
Jun 06, 2023 18:45:34.559 [140271070038840] WARN - Subscription: No container available for /tv.plex.providers.epg.xmltv:16/metadata/tv%2Eplex%2Exmltv%3A%2F%2Fepisode%2FBig%2520Brother%2F24%2F20
Jun 06, 2023 18:45:34.559 [140271070038840] ERROR - Subscription: Error refreshing sub: No container found
Jun 06, 2023 18:45:34.609 [140271140059960] WARN - [Req#73] SLOW QUERY: It took 240.000000 ms to retrieve 13 items.
Jun 06, 2023 18:45:34.616 [140271067929400] ERROR - downloadContainer: expected MediaContainer element, found html
Jun 06, 2023 18:45:34.616 [140271067929400] WARN - Subscription: No container available for /tv.plex.providers.epg.xml

Got it. I just turned it on and downloaded new logs after a few times seeing the attempt to backup the database.

Plex Media Server Logs_2023-06-06_19-14-57.zip (629.8 KB)

Just an update – I rebooted the NAS, which doesn’t seem to have helped. I had noticed some strange network-related issues in the logs, which prompted me to attempt the reboot. I also noticed some SQL unique constraint violations related to my DVR, which I don’t really use, so I deleted that and restarted Plex Media Server, and it also didn’t fix the issue.

(Thanks a lot for troubleshooting with me, btw).

There is corruption in there.

How long has it been this way? (PMS keeps backups which you can use if it’s not been too long)

Also, you should turn off your IPv6 in Settings - Server - Network.

Your LAN is IPv4. It’s causing some network screwiness with the cert & auth.

[::ffff:192.168.7.20]:55924 came in with unrecognized plex.direct SNI name '172-21-0-1.
Jun 06, 2023 18:45:36.464 [140271167236920] WARN - [HttpClient/HCl#2c] HTTP error requesting GET https://172-21-0-1.7bff3dc0cc334f4b99ecf2203012e96e.plex.direct:32400 (60, SSL peer certificate or SSH remote key was not OK) (SSL: no alternative certificate subject name matches target host name ‘172-21-0-1.7bff3dc0cc334f4b99ecf2203012e96e.plex.direct’)
Jun 06, 2023 18:45:36.476 [140271167236920] WARN - [HttpClient/HCl#2d] HTTP error requesting GET https://172-18-0-1.7bff3dc0cc334f4b99ecf2203012e96e.plex.direct:32400 (60, SSL peer certificate or SSH remote key was not OK) (SSL: no alternative certificate subject name matches target host name ‘172-18-0-1.7bff3dc0cc334f4b99ecf2203012e96e.plex.direct’)
Jun 06, 2023 18:45:36.476 [140271167236920] WARN - [HttpClient/HCl#2e] HTTP error requesting GET https://172-23-0-1.7bff3dc0cc334f4b99ecf2203012e96e.plex.direct:32400 (60, SSL peer certificate or SSH remote key was not OK) (SSL: no alternative certificate subject name matches target host name ‘172-23-0-1.7bff3dc0cc334f4b99ecf2203012e96e.plex.direct’)
Jun 06, 2023 18:45:36.626 [140271146076984] INFO - LibraryUpdateManager path watching is disabled

Okay, after much troubleshooting and tinkering, I’ve resolved the issue. I restored to a backup of my library, rebooted again, reinstalled PMS, disabled IPv6, and made a few other changes. Some combination of those actions has fixed the issue. Whew!

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