If you want to get running again, install the old version of plex that was working and restore your old database.
That will work too for the short term.
Itâll buy time to figure out what the next step is but, given PMS 1.40.x is now tripping over the damaged DB, a rebuild / something is sooner-than-later
Iâm going to ask in tomorrowâs meeting about what best to do here.
After that meeting, Iâll reach out to you.
Iâll most likely want to arrange to obtain a copy of your DB do I/we can deep dive into it.
Thank you so much! Iâll keep an eye out tomorrow and respond as quickly as possible.
I have answers from Engineering about your database problem.
-
The problem can originate if any of the shared servers (another server with this server)
-
At some point, the âotherâ server is nuked and a fresh DB is created without first removing it. (now there is an orphaned entry in the DB).
-
After the other server is rebuilt, it is also added to the DB. Now thereâs duplication.
-
PMS 1.40 attempts to upgrade â BOOM.
Engineering will address this but has given instructions for now.
- Stop PMS
- Using SQLITE3 for
com.plexapp.plugins.library.db(`Plex SQLite) DELETE from external_metadata_items;- Exit SQLITE3
- Start PMS
The table will repopulate itself through normal refresh/operation.
They will be tweaking the DB to ensure the database doesnât have a duplicate again.
Thanks for this update. I tested this out and the problem seems to be resolved, no other issues so far.
Took me a minute to figure out SQLITE3, but after I did that got me back up as well! Just to clarify, when you said âThey will be tweaking the DB to ensure the database doesnât have a duplicate again.â are you referring to my DB? Is the tweaked DB something you will be sending back to me or something that would be pushed in an update?
@L_D (and all who are following)
Engineering will be making a change in PMS with a corresponding change in the database.
This change will be released through the normal update cycle
In your case, given we identified where it got confused.
As long as you or those who share their servers with you donât delete and recreate their servers by using
, it wonât happen again.
Purging the table took care of the bad record which had gotten in there.
Hi ChuckPa - I raised this thread originally - will the solution you mentioned work for me?
Yes,
"Plex SQLite" com.plexapp.plugins.library.db
sqlite> DELETE from external_metadata_items;
sqlite> .quit
Sorry for the trouble, but I am having difficulty figuring this out. My server is on a windows installation, I have tried running these commands but get syntax errors etc.
I had the same issue as op, and downgraded and restored. Now I am wanting to upgrade to 1.40, should I do these commands prior to the update, or update to 1.40 then try these commands? As when I do it on my current 1.32(?) installation, I cannot get it to work.
I tried following a few guides, and managed to get close i think, but it then said external_metadata_items not found iirc.
Any help completing this task would be wonderful!
Thanks
Rob
Once you have sqlite3 downloaded copy your db to the sqlite3 directory then try this through the cmd prompt that sqlite3 launches.
.open com.plexapp.plugins.library.db
DELETE from external_metadata_items;
.quit
EDIT: For paths to Plex SQLite and the database files on other platforms, see Repair a Corrupted Database.
On Windows 10, running Plex Media Server 64-bit. If still running PMS 32-bit, use Program Files (x86).
SQLite is picky with syntax. Note the semicolon at the end of the DELETE line and the period before quit.
This is a small database with no problems. Not sure if anything appears on-screen after issuing the DELETE command if something was actually deleted.
C:\>"C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe" "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db"
SQLite version 3.39.4 2022-09-29 15:55:41
Enter ".help" for usage hints.
sqlite> DELETE from external_metadata_items;
sqlite> .quit
C:\
Donât download SQLite. Use the custom version installed with Plex Media Server.
Sincerely appreciate the reply. I must be doing something wrong. I have gone to program files, plex media server and double clicked the plex âSQLite.exeâ.
Once that opens its command line interface, i see this:
SQLite version 3.39.4 2022-09-29 15:55:41
Enter â.helpâ for usage hints.
Connected to a transient in-memory database.
Use â.open FILENAMEâ to reopen on a persistent database.
sqlite>
I think I am pointed at the wrong database? But I have tried the .open command with the location of my database, then following the instructions, as well as just following your instructions from the prompt as it originally opens. I feel like an idiot I cannot figure this out lol. I have insured the semi colon is present etc, as well as capitals exactly as shown.
I am running the .exe right out of the plex program file folder. Am I suppose to move the .exe to the database folder, or the com.plexapp.plugins.library.db to the program files/plex folder to modifiy it?
It seems the fact that sqlite shows âConnected to a transient in-memory database.â is an issue?
Thanks again for the help!
Rob
Donât do that. Run it from the command prompt.
Plex Media Server must not be running when issuing the commands.
No need to move anything anywhere.
Use the full path, including quotes, to the executables and database files.
If PMS and the database are in the default locations, you can copy/paste the line from my reply above.
If you installed PMS in a different location or have moved the Plex data folder (different drive, etc.), then adjust the path accordingly.
I didnât realize it shipped with SQLite. I downloaded SQLite3 and used it to get back up and running should I recover an old database and use the SQLite that shipped with Plex to run the commands or should I be ok?
Ok thanks, going to give this a go now. Only difference is it is windows, just not win 10. I have a home server with server 2022 on it for my plex and backup solutions. I may be in over my head lol. Hopefully it works the same on the server 2022 kernel.
Iâll ping someone for more info.
However, if youâve already deleted the info, updated to 1.40, and the system is stable, then you could be OK.
My db experience is limited. For doing things like repairing corruption, the Plex version is needed. For a DELETE, the custom version may not be needed.
Ok so I ran it from the command prompt instead of the program directly, but I received an error that this program cannot run on this pcâŠso may be a server os issue.
Would it be a fair workaround to install plex on a regular pc, copy my database folder over, run those commands then copy the modified database back to my server database folder?
Thanks
Rob
