Immediate Database Corruption on Fresh Docker Install

Server Version#: Latest

Here’s my scenario. Up until today I’d been running Plex directly off my Ubuntu install. I’d been having some issues with upgrading and decided it was a good opportunity to move to Kubuntu and also migrate to docker for better manageability.

So I install Docker on a completely fresh Kubuntu install. I use the official yml file for the official plex image. Docker compose file contents:

version: ‘2’
services:
plex:
container_name: plex
image: plexinc/pms-docker
restart: unless-stopped
environment:
- TZ=America/New_York
- PLEX_UID=1000
- PLEX_GID=1000
- PLEX_CLAIM=REDACT
network_mode: host
volumes:
- /home/wpx/DockerFolders/PlexConfig:/config
- /mnt/wpx/Plex Library:/data

The mounted directory for my media is on a Synology NAS and mounted over NFS. I copy pasted my fstab from the previous install for mapping, and this was the exact same setup as on the old install. The only different piece is Docker.

What happens is every single time I add a Library and start scanning it, the database immediately goes corrupt. In the docker logs output I can see it:

****** PLEX MEDIA SCANNER CRASHED, CRASH REPORT WRITTEN: /config/Library/Application Support/Plex Media Server/Crash Reports/1.41.6.9685-d301f511a/PLEX MEDIA SCANNER/e8e387d7-e016-42f9-1f15bf91-72c9eef8.dmp

In the Plex logs you can see the corruption happen as well:

Apr 15, 2025 23:19:10.306 [140521045502776] DEBUG - Found existing show 4 Apr 15, 2025 23:19:10.309 [140521150360376] DEBUG - Activity: updated activity fb674c8b-e564-4b79-a352-9cba8d03a6be - completed 0.4% - Scanning TV Shows Apr 15, 2025 23:19:10.309 [140521150360376] DEBUG - Scanner: Processing directory /data/TV Shows/30 Rock/30.Rock.S03.PROPER.1080p.BluRay.x265-KONTRAST/Subs/30.Rock.S03E10.PROPER.1080p.BluRay.x265-KONTRAST (parent: yes) Apr 15, 2025 23:19:10.309 [140521045502776] ERROR - SQLITE3:0x80000001, 11, database corruption at line 68825 of [a29f994989]

Followed by many more lines of database corruption being called out.

I’m at a complete loss. I’ve tried completely clean installs four times now and the second I add a library and start scanning, it immediately corrupts the DB. Every time. Completely fresh system.

Any help is greatly appreciated, I’m at my wits’ end here. I thought this would be a five minute process and now the family’s mad at me because we have no media.

Two things I’d suggest, and I’m unsure if either are your core problem.

  1. Move your docker files out of /home and into a root folder. I use a root folder at /docker for all docker files that aren’t media. /docker/plex works fine. Using stuff in home folders can cause unexpected permissions issues.
  2. Your file naming structure is messed up badly. For troubleshooting, try using just a few files instead of your entire library, and use the correct naming convention to see if that suddenly allows things to work.
  3. Try adding local files that are on the same machine to rule out behavior with the network mount.

Hey bgrngod- thanks for the reply! A couple of things:

(1) That’s actually three things not two :smiley:

(b) File naming structure definitely isn’t the problem, I’ve replicated the install on bare metal on the same files and it works fine. It also reads from the NFS share fine there

(iii) Local files on the same machine were working. So it’s got to specifically be something with NFS and Docker, or it’s your first point about storing them in /home, though I’m not sure that would be the case here since it seems to be intermittent (but inevitable) corruption which wouldn’t be a typical behavior for permissions issues, which are rigid and predictable.

Move stuff out of /home, its bad practice to keep it there.

I will never understand why people think adding a layer of complexity (IE docker) is a good idea for long term production software. Throw it on the OS and call it day. Remember KISS is a rule for a reason.

Is this volume on a local filesystem? Not mounted over SMB/NFS?
/home/wpx/DockerFolders/PlexConfig

That would be bad for the Plex data folder if it were on a network share. The results would be, well, what you’re currently seeing.

Hey- thanks for the reply, no my home folder is not on a share, that’s local. Only the data folder is on a share.

Are you talking about the Plex data folder, or about the actual media files?
The former must not be on a file share.

In docker, you specify a data volume, which is exposed as /data and contains your media. That’s on an NFS share.

The database is specified with the config volume, exposed as /config. That’s on the local system.

Maybe it’s a Kubuntu thing, I have an instance running in Docker on Ubuntu 22.04 with no issues.
@ChuckPa any known problems with Kubuntu?

There have been some instances of Kubuntu.

I would like to see both the Docker logs and the PMS logs ZIP

  1. The docker logs will be those from creation / first start
    (Sometimes this is visible in the console but usually in the container’s log)

  2. The PMS DEBUG logs (from PMS or manually captured from “Logs” directory where /config is mapped to in the local filesystem – with PMS stopped.

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