# \[Req#46c8/Database optimization/com.plexapp.plugins.library.db\] SQLITE3:0x7f97147a18, 17, statement

**URL:** <https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202>\
**Category:** Plex Media Server\
**Tags:** server-synology, media-optimizer\
**Created:** [July 13, 2023, 6:12pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202 "2023-07-13T18:12:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdreed72](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mdreed72](https://forums.plex.tv/u/mdreed72)\
**Post date:** [July 13, 2023, 6:12pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202/1 "2023-07-13T18:12:37Z")

</div>

Could I please get some help with the error in the subject line. My database in good working order and has been checked and fixed in @ChuckPa tool.

I think this is the issue but I run on raid (SHR). I wouldn’t know how to fix it. - [plex-fix-db.sh · GitHub](https://gist.github.com/scrathe/289b92681cb2b51daa1631013d19d4c1)

from this reddit post - [Reddit - Dive into anything](https://www.reddit.com/r/PleX/comments/vcc95i/database_repair_script_for_common_plex_db_errors/)

any help would be appreciated!

Server Version#:1.32.5.7318-7000  
[Plex Media Server Logs\_2023-07-12\_15-26-57.zip](https://forums.plex.tv/uploads/short-url/ahd27zVOwoB1udJAcvoogBBZXbM.zip) (7.9 MB)

Player Version#:  
\<If providing [server logs](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) please do NOT turn on verbose logging, only [debug logging](https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/#toc-1) should be enabled\>

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [July 13, 2023, 6:33pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202/2 "2023-07-13T18:33:12Z")

</div>

No idea what tool you’re referencing is doing.

What I can offer you is this:

> **[GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server...](https://github.com/ChuckPa/PlexDBRepair)**
>
> Database repair utility for Plex Media Server databases - GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases

---

<div class="post-metadata">

**Author:** ![mdreed72](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mdreed72](https://forums.plex.tv/u/mdreed72)\
**Post date:** [July 13, 2023, 6:48pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202/3 "2023-07-13T18:48:29Z")

</div>

That’s the tool i was referencing. It doesn’t fix the issue.

---

<div class="post-metadata">

**Author:** ![mdreed72](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mdreed72](https://forums.plex.tv/u/mdreed72)\
**Post date:** [July 13, 2023, 6:50pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202/4 "2023-07-13T18:50:35Z")

</div>

Is there any other help available? like troubleshooting help? Problem solving help? All associated with PMS of course.

Thanks

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [July 13, 2023, 7:29pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202/5 "2023-07-13T19:29:15Z")

</div>

The tool you linked is not mine `plex-fix-db.sh` (this isn’t mine)

Looking through your logs, I see this:

> Jul 12, 2023 15:26:05.536 [547508502752] INFO - [Req#453/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f87058a18, 17, statement aborts at 58: [select \* from metadata\_items limit 1] database schema has changed

This happens when “Optimize Databases” has been selected (PMS is running) before PMS finishes the upgrade process (I see you are running 1.32.57318 – which is new)

The error isn’t really an error. It’s telling us it’s refusing to optimize the databases because the DB’s are still changing.

Here is where it’s changing:

```auto
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db/DatabaseFixups] Running database fix-ups completed in 2.6 seconds.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 0.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 1.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 2.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 3.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 4.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 5.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 6.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 7.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 8.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 9.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 10.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 11.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 12.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 13.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 14.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 15.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 16.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 17.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 18.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Captured session 19.
Jul 12, 2023 15:24:25.205 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Rebuilding full text search tables.
Jul 12, 2023 15:24:25.206 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Activity: updated activity ca8f460c-4a23-45a9-98ee-0d452cb263ce - completed 40.0% - Optimizing database
Jul 12, 2023 15:24:36.726 [547593236704] DEBUG - BPQ: [Starting] -> [Processing]

```

Right before you grabbed the ZIP file, it did finish optimizing the DB…

```auto
Jul 12, 2023 15:26:06.286 [547593236704] DEBUG - PlayQueue: 0 generated IDs compressed down to a 20 byte blob.
Jul 12, 2023 15:26:06.287 [547593236704] DEBUG - BPQ: [Processing] -> [Idle]
Jul 12, 2023 15:26:06.289 [547508502752] DEBUG - [Req#453/Database optimization/com.plexapp.plugins.library.db] Activity: Ended activity ca8f460c-4a23-45a9-98ee-0d452cb263ce.
Jul 12, 2023 15:26:43.228 [547643433184] DEBUG - WebSocket: client initiated close
Jul 12, 2023 15:26:43.228 [547643433184] DEBUG - NotificationStream: Removing because of close
Jul 12, 2023 15:26:43.240 [547643433184] DEBUG - handleStreamRead code 1: stream truncated
Jul 12, 2023 15:26:43.240 [547643433184] DEBUG - Completed after connection close: [192.168.1.31:63205] -3 GET /:/websockets/notifications?filters=log (8 live) #443 TLS GZIP 138478ms 21929 bytes
Jul 12, 2023 15:26:43.277 [547538055392] DEBUG - Request: [192.168.1.31:63238 (Subnet)] GET /:/prefs (10 live) #4ef TLS GZIP Signed-in Token (mdreed72) (Chrome)
Jul 12, 2023 15:26:43.280 [547593269472] DEBUG - Request: [192.168.1.31:63239 (Subnet)] GET /accounts/1 (10 live) #565 TLS GZIP Signed-in Token (mdreed72) (Chrome)
Jul 12, 2023 15:26:43.285 [547576361184] DEBUG - Request: [192.168.1.31:63240 (Subnet)] GET /myplex/account (10 live) #564 TLS GZIP Signed-in Token (mdreed72) (Chrome)
Jul 12, 2023 15:26:43.299 [547641323744] DEBUG - Completed: [192.168.1.31:63239] 200 GET /accounts/1 (10 live) #565 TLS GZIP 22ms 683 bytes (pipelined: 1)
Jul 12, 2023 15:26:43.299 [547641323744] DEBUG - Completed: [192.168.1.31:63240] 200 GET /myplex/account (10 live) #564 TLS GZIP 14ms 3965 bytes (pipelined: 1)
Jul 12, 2023 15:26:43.311 [547641323744] DEBUG - Completed: [192.168.1.31:63238] 200 GET /:/prefs (10 live) #4ef TLS GZIP 34ms 8863 bytes (pipelined: 1)
Jul 12, 2023 15:26:45.951 [547593269472] DEBUG - Request: [192.168.1.31:63244 (Subnet)] GET /diagnostics/logs (11 live) #566 TLS GZIP Signed-in Token (mdreed72) (Chrome)
Jul 12, 2023 15:26:45.951 [547593269472] DEBUG - [Req#566] Diagnostics: Building logfile zip

```

What is it doing now?

Lastly, Regarding my tool, it knows the all the syno & docker structures (when run from inside the docker container), so that should still be good for you …

Please advise.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [October 11, 2023, 7:29pm UTC](https://forums.plex.tv/t/req-46c8-database-optimization-com-plexapp-plugins-library-db-sqlite3-0x7f97147a18-17-statement/847202/6 "2023-10-11T19:29:47Z")

</div>

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