Synology NAS DS215J 'Synology Failed to run the package service' error

DS215j
DSM 6.2.4-25556 Update 7
Plex version installed 1.32.5.7210-6000
As title suggests - noticed this evening that my media content via Plex wasnt available on my devices.
Accessed my synology nas where I run the plex media server and checked I could still access my media on the nas which I could but I couldnt access my content in plex on any device or via the web.
Checked the package and saw it was stopped - selected run and got the error.
Then tried uninstalling and re-installing the provided version of PMS.
Then tried the latest Plex version from your website
Tried rebooting and doing it, basically tried every which way.
Baffled as to why this has suddenly happened. Its been fine for years.
I have noticed on other posts that you need a copy of the log file - can you give me precise instructions on how to obtain this. I am not very technical.
Just about grasp the basics of this area but not much more.
Greatful for any help
thanks

Server Version#:
Player Version#:
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>

Using FileStation –

  1. Open the Plex shared folder
  2. Navigate Plex / Library / Application Support / Plex Media Server
  3. Right-click “Logs” → Compress to Logs.zip
  4. When that completes –
  5. Download the ZIP and upload it here.

Logs.zip (1.5 MB)

Thankyou ChuckPa for the guidance, hope this is able to help

Thank you for the logs.

I unfortunately have bad news. The DBs are damaged.

Did you suffer a power outage or abrupt power off of the Syno?

Jul 11, 2023 23:22:31.049 [0x2d4b3000] ERROR - SQLITE3:0x77e5, 1, no such table: sqlite_schema in "UPDATE sqlite_schema SET sql = replace(sql, 'dt_integer(8)', 'datetime') WHERE name = 'media_subscriptions' AND type = 'table'"
Jul 11, 2023 23:22:31.050 [0x2d4b3000] ERROR - Exception inside transaction (inside=1) (../Library/DatabaseMigrations.cpp:209): sqlite3_statement_backend::prepare: no such table: sqlite_schema for SQL: UPDATE sqlite_schema SET sql = replace(sql, 'dt_integer(8)', 'datetime') WHERE name = 'media_subscriptions' AND type = 'table'
Jul 11, 2023 23:22:31.068 [0x2d4b3000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::prepare: no such table: sqlite_schema for SQL: UPDATE sqlite_schema SET sql = replace(sql, 'dt_integer(8)', 'datetime') WHERE name = 'media_subscriptions' AND type = 'table'
Jul 11, 2023 23:22:31.069 [0x2d4b3000] ERROR - SQLITE3:0x77e5, 1, no such table: synced_metadata_items in "select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items"
Jul 11, 2023 23:22:31.070 [0x2d4b3000] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: synced_metadata_items for SQL: select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items
Jul 11, 2023 23:22:31.071 [0x2d4b3000] ERROR - Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: synced_metadata_items for SQL: select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items (N4soci10soci_errorE)

The best I can offer you is my tool (unless you want to do the work manually).
It will attempt to repair the DB.

If the DB is too badly damaged, you’ll need to RESTore a backup (one of the menu options in my tool).

The tool and details / README.md are here:

Hey there. Sorry for the lack of a response as I had to travel on business for 48 hrs. I am not aware of any sudden outage that you suggest but it is possible as we have had some thunderstorms in recent days.
I will be returning home tonight and thankyou for providing your DB repair utility but can I just ask - when you say the DB’s are damaged do you mean Synology NAS DB’s or Plex media server? I assume the latter.
I ask because I have checked and can still access all of my media files on my NAS drive and they will play with the built in Synology media server… this is what I would be most concerned about in terms of losing that content.
IN terms of Plex media server I’m happy to do whatever it takes in terms of wiping it and removing it entirely and starting from scratch if I need to. I understand that simply uninstalling the PMS does not seem to effect this level of change and restart option. But if it is simpler then I am happy to do this and rebuild my content this might be easier. However again some guidance as to how to ensure everything PMS related is removed would be helpful. e.g. the Plex Folder share in File Station - I did consider deleting that but identified that it was many tens of gb big and was unsure what i was doing so didnt proceed.

Obviously based on your answers to the above I can either:

  1. try the repair utility
    or
  2. look to do the full restore via the menu option i your tool,
    or
  3. wipe the PMS off my NAS drive and start again (with some help).
    I will try number 1 in the next 12 hrs or so and get the results back to you
    thanks for your assistance thus far

Hey there. Whilst not being savvy with this sort of thing - your instructions were pretty much spot on and I was able to access your utility and enact it on my NAS drive. It appears to tell me that everything is fine once I’d run the repair and then checked it etc etc. But the problem is not solved in that the server still won’t “Run” and tells me the error a few seconds after i select “Run” that Synology failed to run the package server. My instinct tells me that whatever error is there and the utility didnt repair it. After what it claimed was a successful repair, I then restarted my NAS and tried everything over. I then also went back to the utility and tried to restore, I basically tried every option in the utility but according to the utility everything is ok??
My guess is the next action is to delete the PMS fully off my NAS drive and start again.
If you agree could you give me some guidance as to how to do this fully please.
Thanks
Logs (1).zip (1.5 MB)

I have uploaded the latest log file for you to confirm this.

hey there, I have added in further messages to the thread for my error that you have been so helpful so far in helping me with. Hope I’ve done everything right. But sadly it doesnt seem to resolve the issue that I cannot access my content when I log in to my plex account

I regrettably agree the databases, and their backups, are all damaged beyond repair.
While the file structure is intact, the data inside the databases is nonsensical at this point.

That having been said.

  1. Stop PMS
  2. Using FileStation, Navigate to Plex/Library/Application Support/Plex Media Server
  3. Delete the following folders
    – Plug-in Support
    – Metadata
    – Media
  4. Start PMS

When it starts, be VERY patient with it before attempting to open it
Watch the CPU utilization. Wait for it to return to its normal near-idle state.

We are giving it more time because PMS has to create all the data structures and databases new again (but empty)

When the machine is quiescent , Open it in the browser.

You should be able to start creating new library sections again

So i was just following these instructions to the letter but its Step 4 which fails (every single time) which makes me think the databases perhaps weren’t the issue?
I have deleted plug-in support, metadata and media.
I then started the PMS and I got the exact same error - Synology Failed to run the package service.
Now I’m confused…if my understanding is correct, that what you had me do was basically delete the databases. and by then starting the media server it would create them from scratch. But my problem is the install on my NAS drive just doesnt seem to get ‘running’.
Any thoughts as always are appreciated.
the errors are identical to when I first shared the log with you:

Jul 14, 2023 12:06:02.137 [0x2d595000] ERROR - SQLITE3:0x71cc, 1, no such table: sqlite_schema in “UPDATE sqlite_schema SET sql = replace(sql, ‘dt_integer(8)’, ‘datetime’) WHERE name = ‘media_subscriptions’ AND type = ‘table’”
Jul 14, 2023 12:06:02.139 [0x2d595000] ERROR - Exception inside transaction (inside=1) (…/Library/DatabaseMigrations.cpp:209): sqlite3_statement_backend::prepare: no such table: sqlite_schema for SQL: UPDATE sqlite_schema SET sql = replace(sql, ‘dt_integer(8)’, ‘datetime’) WHERE name = ‘media_subscriptions’ AND type = ‘table’
Jul 14, 2023 12:06:02.159 [0x2d595000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::prepare: no such table: sqlite_schema for SQL: UPDATE sqlite_schema SET sql = replace(sql, ‘dt_integer(8)’, ‘datetime’) WHERE name = ‘media_subscriptions’ AND type = ‘table’
Jul 14, 2023 12:06:02.160 [0x2d595000] ERROR - SQLITE3:0x71cc, 1, no such table: synced_metadata_items in “select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items”
Jul 14, 2023 12:06:02.161 [0x2d595000] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: synced_metadata_items for SQL: select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items
Jul 14, 2023 12:06:02.162 [0x2d595000] ERROR - Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: synced_metadata_items for SQL: select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items (N4soci10soci_errorE)

But how can the DB’s be corrupted if they arent there yet??

This is from the log file you previously provided.

Jul 14, 2023 12:06:01.990 [0x2d595000] DEBUG - Running migrations. (EPG 0)
Jul 14, 2023 12:06:02.134 [0x2d595000] DEBUG - Running down migration 202212022300.021.
Jul 14, 2023 12:06:02.135 [0x2d595000] DEBUG - Captured session 0.
Jul 14, 2023 12:06:02.135 [0x2d595000] DEBUG - Captured session 1.
Jul 14, 2023 12:06:02.135 [0x2d595000] DEBUG - Captured session 2.
Jul 14, 2023 12:06:02.135 [0x2d595000] DEBUG - Captured session 3.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 4.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 5.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 6.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 7.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 8.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 9.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 10.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 11.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 12.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 13.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 14.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 15.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 16.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 17.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 18.
Jul 14, 2023 12:06:02.136 [0x2d595000] DEBUG - Captured session 19.
Jul 14, 2023 12:06:02.137 [0x2d595000] ERROR - SQLITE3:0x71cc, 1, no such table: sqlite_schema in "UPDATE sqlite_schema SET sql = replace(sql, 'dt_integer(8)', 'datetime') WHERE name = 'media_subscriptions' AND type = 'table'"
Jul 14, 2023 12:06:02.139 [0x2d595000] ERROR - Exception inside transaction (inside=1) (../Library/DatabaseMigrations.cpp:209): sqlite3_statement_backend::prepare: no such table: sqlite_schema for SQL: UPDATE sqlite_schema SET sql = replace(sql, 'dt_integer(8)', 'datetime') WHERE name = 'media_subscriptions' AND type = 'table'
Jul 14, 2023 12:06:02.159 [0x2d595000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::prepare: no such table: sqlite_schema for SQL: UPDATE sqlite_schema SET sql = replace(sql, 'dt_integer(8)', 'datetime') WHERE name = 'media_subscriptions' AND type = 'table'
Jul 14, 2023 12:06:02.160 [0x2d595000] ERROR - SQLITE3:0x71cc, 1, no such table: synced_metadata_items in "select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items"
Jul 14, 2023 12:06:02.161 [0x2d595000] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: synced_metadata_items for SQL: select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items
Jul 14, 2023 12:06:02.162 [0x2d595000] ERROR - Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: synced_metadata_items for SQL: select max(max(synced_metadata_items.changed_at),max(synced_metadata_items.first_packaged_at)) from synced_metadata_items (N4soci10soci_errorE)

Notice the date/time stamp is identical to what you just submitted again.

I do not know what’s happening here but now firmly suspect file permissions / ownership for the Plex shared folder have been damaged

Have you placed anything in the Plex share? Only Plex itself should be using the shared folder .

To remedy this problem.

  1. Open File Station
  2. Right-click on ‘Plex’ (Left Pane) → Properties
  3. The properties page will open
  4. Click on the permissions tab
  5. Confirm user plex is the owner
  6. Apply to this folder, sub-folders and files
  7. While still in the properties page,
  8. Ensure user ‘plex’ minimally has R/W access. Full Control is better but not required.
  9. Also “Apply to this folder, subfolders and files”

When this is complete (which may take a while). Start Plex.

There is one final thing we can do if it doesn’t start up



Happy to share whats in my plex folder - whilst i do this.
As I believe everything is ok with the permissions - it didnt say owner but its clear it had higher permissions than either admin or administrator.
But what is disconcerting are the other files in the PLex folder - these text files - which I assume are just different language versions of the phrase ‘PLease do not place any media files here’ but figured it might be worth checking hence the screenshot.

So no , after doing that Step 9 - Apply - I then pressed ‘Run’ and the same error re-occurred.
To be clear - I don’t know what your one final thing is but now i have lost the media libraries, I am quite prepared to return the NAS drive back to a state where Plex and any content relating to Plex is removed from my NAS drive. As long as this doesnt or cannot remove any of the actual media files I have stored on my NAS - then I am more than happy to do this if, again, you just provide me guidance on where I need to go to delete everything - i.e. I assume its the whole Plex Folder in File Station but where else also?
I’m wondering whether you have been kind in trying to avoid having me go through that but I am more than happy to do so as long as it doesnt delete any actual content from other drives I have set up or were defaulted when new like ‘video’ and ‘photo’
I assume to get back to this state means an installation of PLex media server would be just like any other application I choose to install on my NAS?
I should also add that in each of these different steps you’ve had me followed, I’ve not rebooted or restarted the NAS drive - thought id just make that clear

just so you know I can see you are replying - I have just edited this response above a little with further info

  1. My DSM script is what creates those files in the Plex shared folder.
    The installer scripts do anything/everything needed to make it all work on DSM.

  2. Let’s take a big step

  • Sign out of Plex/web if you have it open somewhere
  • Rename Plex/Library → Plex/Library.unused
  • UNINSTALL the package
  • REINSTALL the same package file again
  1. PMS will create a new PMS instance on the Syno and start

  2. If it does not keep “RUN” status, then there is a DSM problem.

  3. Presuming it does keep running, Open Plex on the Syno and setup a whole new server.

  4. All your media is still there – completely untouched.

PS: I was trying to avoid scrapping all the existing metadata and server ID but at this point, let’s try the machine by creating entirely new. If that works then we know there was a problem somewhere in PMS. If it fails then we have a bigger problem to figure out with the Syno.

Okay this seems to have done the trick. Its started and I have been patient whilst the cpu was a bit all over the place. Ive then created a single media library, which has scanned for content etc. I’ve then checked that library appears on a plex instance via another device which it does and the content plays okay which it does.
So firstly thankyou very much for your patience and assistance.
Can i now delete the ‘library.unused’ folder?

If you are happy with what you now have then YES, please go ahead and delete Library.unused.

Also, in Settings - Authorized Devices - Server (dropdown)

Remove the old server instance if you haven’t already
(the old one won’t have been seen in a long time)

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