[Solved] Plex cant play anything new added - Database is Locked

Server Version#: 1.41.6.9685
Player Version#: 4.145.1

Hi, iv been struggling for the past 2 days with this issue and i cant find anything anywhere related to my issue, so im gonna try to explain myself the best i can

I installed my plex media server on a docker container in a vm inside a proxmoxve server, already did the passthrough and all that, imported the Library folder from my previous PMS (a few months ago was on ubuntu server, then i moved all to windows and now im back to linux), issue is, that i cant play anything new added into my plex, no issues playing content that was already on my PMS, but if i add something new, i keep getting a

Error code: s1003 (Network)

I know the files are good because if i try to play them over from my windows pc, using the smb share on the same location that the file is stored for plex, it works with no issues, when i check on the logs i keep getting this same error:

May 09, 2025 13:23:25.118 [135316304608056] DEBUG - [Req#198/Transcode] Streaming Resource: Attempting to create AdHoc transcode session xx031iwcdyc0v3n0spa7c79g
May 09, 2025 13:23:25.118 [135316304608056] ERROR - [Req#198/Transcode] MDE: video has neither a video stream nor an audio stream
May 09, 2025 13:23:25.118 [135316304608056] DEBUG - [Req#198/Transcode] MDE: received PLEX_PROTOCOL_ANY from client, but could not determine best protocol. Defaulting to HTTP
May 09, 2025 13:23:25.118 [135316304608056] DEBUG - [Req#198/Transcode] MDE: analyzing media item 110996
May 09, 2025 13:23:25.118 [135316304608056] ERROR - [Req#198/Transcode] MDE: video has neither a video stream nor an audio stream
May 09, 2025 13:23:25.118 [135316304608056] ERROR - [Req#198/Transcode] Streaming Resource: Cannot make a decision because either the file is unplayable or the client provided bad data
May 09, 2025 13:23:25.118 [135316304608056] WARN - [Req#198/Transcode] Failed to obtain a streaming resource for transcode of key /library/metadata/32966

After some googling, some ppl said it could be a database issue, so i found the DBRepair.sh script on the internet to do the repair, when it try to repair the database, in the end i get the following error:

Select

  1 - 'stop'      - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check'     - Perform integrity check of database.
  4 - 'vacuum'    - Remove empty space from database without optimizing.
  5 - 'repair'    - Repair/Optimize databases.
  6 - 'reindex'   - Rebuild database indexes.
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky).
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive).
 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).
 12 - 'undo'      - Undo last successful command.

 21 - 'prune'     - Remove old image files (jpeg,jpg,png) from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 88 - 'update'    - Check for updates.
 99 - 'quit'      - Quit immediately.  Keep all temporary files.
      'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : 5

Exporting current databases using timestamp: 2025-05-09_13.16.59
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.
Start importing into new databases.
Importing Main DB.
Runtime error near line 494120: database is locked (5)
Error 1 from Plex SQLite while importing from './dbtmp/library.plexapp.sql-2025-05-09_13.16.59'
Cannot continue.

Now for this one theres no information anywhere, i already tried option 3, 4, 5 n 6, 3 4 n 6 r successfull, but when i try to run 5 i get the same database locked error.

i also tried option 9, i have 4 backups, all of them r affected by the same problem, so i dont know if its a database issue or not, im guessing it is and ill say why after i finish my explanation.

Runing docker logs plex --follow, shows no errors whatsoever.

The only “Solution” iv found so far, is to shutdown my PMS docker, rename my Library folder and start fresh, if i do that everything runs like it should, but if i go back to my previous Library folder, well i go back to the same issue.

I dont know what else to do, i would love to avoid having to start from scratch, id like to keep my play history and all that, unless someone knows how to import that to a new server?

Anyway, here is my docker compose file for plex:

services:
  plex:
    image: plexinc/pms-docker
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Mexico_City
      - VERSION=docker
      - PLEX_CLAIM= #optional
    volumes:
      - ./plex/config:/config
      - ./transcode:/transcode
      - ./storages/Movies:/media/Movies
      - ./storages/Series:/media/Series
    devices:
      - /dev/dri:/dev/dri
    restart: unless-stopped

my movies, series and config folder r on a hard disk on my proxmox server which im sharing over smb with an fstab config, which im posting as well

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
/dev/disk/by-id/dm-uuid-LVM-c7zbscAUMuDdqw2PBVMNp5oqjvTypFDNIMWP1ol1CxdnD0ocA9RGVu1UbvD0tfge / ext4 defaults 0 1
# /boot was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/e8fe5366-d91f-421e-8359-6a485c11b577 /boot ext4 defaults 0 1

# Storage A
#UUID=e57fa923-d372-49f4-b451-bb579ae546a7      /media/StorageA ext4    rw,user,exec    0       0
//10.0.1.250/E$ /media/StorageA cifs    username=user,password=pass   0       0

# Storage B
#UUID=e5edcbb4-7b4d-46af-9e8f-129564a25f4c       /media/StorageB ext4    rw,user,exec        0       0
//10.0.1.250/F$ /media/StorageB cifs    username=user,password=pass   0       0

# Nextcloud Data
#/media/StorageB/Nextcloud      /var/lib/docker/volumes/nextcloud_aio_nextcloud_data    none    bind
//10.0.1.250/F$/Nextcloud  /var/lib/docker/volumes/nextcloud_aio_nextcloud_data cifs rw,mfsymlinks,seal,username=user,password=pass,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0

# Transmission Data
//10.0.1.250/F$/Torrents  /media/Transmission cifs rw,mfsymlinks,seal,username=user,password=pass,uid=1000,gid=1000,file_mode=0770,dir_mode=0770 0 0

# Plex Config
//10.0.1.250/F$/Plex/  /root/plex/plex/config cifs rw,mfsymlinks,seal,username=user,password=pass,uid=1000,gid=1000,file_mode=0770,dir_mode=0770 0 0

# Plex Storages
//10.0.1.250/E$/Movies  /root/plex/storages/Movies cifs rw,mfsymlinks,seal,username=user,password=pass,uid=1000,gid=1000,file_mode=0770,dir_mode=0770 0 0
//10.0.1.250/F$/Series  /root/plex/storages/Series cifs rw,mfsymlinks,seal,username=user,password=pass,uid=1000,gid=1000,file_mode=0770,dir_mode=0770 0 0

if anyone has anything that i could try to get my previous PMS back to normal function would be great :slight_smile:

When you’re running a docker in a VM, you’re adding a completely unnecessary layer of abstraction with the docker.

The VM is already providing a completely abstracted environment.
The Docker wrapper is adding an unnecessary layer of obfuscation and complication which is causing the failure.

You don’t need Docker when in a VM.

Therefore:

  1. Create the Proxmox VM using Ubuntu/Debian as the OS – with PMS native DEB file for Ubuntu/Debian
  2. Now, in the VM,
  • DBRepair will recognize it’s in a Ubuntu environment
  • Be able to stop / start PMS, and perform the functions
  1. Therefore. from the command line INSIDE the VM
  • sudo ./DBRepair.sh stop auto start exit

The README.md documents all this.

FWIW: I created a proxmox VM with the TTECK helper scripts.

1 Like

So u use PMS with an LXC?

I ran PMS in an LXC for many years and it was great. No need for the additional overhead of a full VM when you have access to LXC. Just install PMS on it as you would in a native VM.

I use PMS with LXC (all the distros I test) on my workstation with incus. I previously used LXD.

My main server is Ubuntu 22.04.5 LTS Server. PMS runs native there without container.

The Proxmox machine is a TTECK LXC.

This runs on a little N100 4x4 cube

1 Like

Aight so i decided to try ur way, but im still getting the same error when i try to repair the database

Select

  1 - 'stop'      - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check'     - Perform integrity check of database.
  4 - 'vacuum'    - Remove empty space from database without optimizing.
  5 - 'repair'    - Repair/Optimize databases.
  6 - 'reindex'   - Rebuild database indexes.
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky).
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive).
 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).
 12 - 'undo'      - Undo last successful command.

 21 - 'prune'     - Remove old image files (jpeg,jpg,png) from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 88 - 'update'    - Check for updates.
 99 - 'quit'      - Quit immediately.  Keep all temporary files.
      'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : 2
 
Automatic Check,Repair,Index started.

Checking the PMS databases
Check complete.  PMS main database is OK.
Check complete.  PMS blobs database is OK.

Exporting current databases using timestamp: 2025-05-10_00.23.10
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.
Start importing into new databases.
Importing Main DB.
Runtime error near line 519882: database is locked (5)
Error 1 from Plex SQLite while importing from './dbtmp/library.plexapp.sql-2025-05-10_00.23.10'
Cannot continue.
Repair failed. Automatic mode cannot continue. Please repair with individual commands

I also tried to play the new movies i added, but nope, not a chance, i can play the old movies just fine, but not new ones.

this is the fstab of my lxc container

root@Plex-Media-Server:/# cat /etc/fstab 
# UNCONFIGURED FSTAB FOR BASE SYSTEM

#Plex Config
//10.0.1.250/F$/Plex/  /var/lib/plexmediaserver cifs rw,mfsymlinks,seal,username=user,password=pass,file_mode=0777,dir_mode=0777 0 0

#Movies
//10.0.1.250/E$/Movies/  /media/Movies cifs rw,mfsymlinks,seal,username=user,password=pass,file_mode=0777,dir_mode=0777 0 0

#Series
//10.0.1.250/F$/Series/  /media/Series cifs rw,mfsymlinks,seal,username=user,password=pass,file_mode=0777,dir_mode=0777 0 0
root@Plex-Media-Server:/#

One thing i did notice tho, is that if i dont use the Plex config folder as a mount and instead use it as a local folder, my library gets scanned really fast, i have about 700+ movies, but if i use it as a mount, even as a fresh one, it takes a long time to complete the scan, so maybe im not doing something right? maybe the way im mounting the resources on the fstab? or maybe plex doesnt like to use the config on a network folder? if thats the case id have to copy my entire Library folder to the lxc and increase the size of it, cause i only made the disk 20gb and my Libray weights about 60gb

I should also mention, that the SMB share is directly on my proxmox enviroment os, so debian is sharing the disks directly, the account i created also has full access to the shares

NO! DO NOT put /var/lib/plexmediaserver over the network.

FIle lock do not work right.

Then thats prolly the issue i have :frowning: i already increase the size of the disk and copying my Library folder to my lxc container, will update when its done to see if that fix my problem, fingers crossed :folded_hands:

Yup, that was indeed the issue lol, i moved my Library folder to my plex server and all my problems went away lol, ill still keep the lxc container cause iv been meaning to give it a try at this, but everything is back to normal now hehe, tycm :laughing:

Btw im surprise with only 4 cores and 4gb ram, plex is able to run, do transcoding and all, i though it had bigger requirements lol

Now i gotta do some research on how to be able to ssh into the lxc container directly, cause i dont like the webui for that and certenly not the pct attach thingy, i rather have a full ssh console for this

every LXC container should have its own IP because it has a network stack

you can lxc shell container_name after you ssh into the proxmox machine
from here, you can install ssh/sshd and setup whatever you like

got it hehe, i just edited the /etc/ssh/sshd_config file and added PermitRootLogin yes, restarted the sshd service and done :laughing:

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