# DBRepair development

**URL:** <https://forums.plex.tv/t/dbrepair-development/822684>\
**Category:** Apps & Creations\
**Created:** [December 14, 2022, 3:57am UTC](https://forums.plex.tv/t/dbrepair-development/822684 "2022-12-14T03:57:23Z")\
**Posts on this page:** 20\
**Page:** 63

<div class="post-metadata">

**Author:** ![Viralfrag](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Viralfrag](https://forums.plex.tv/u/Viralfrag)\
**Post date:** [October 8, 2026, 6:17pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1341 "2026-10-08T18:17:52Z")

</div>

Additionally, the results from each of my selections appeared above the rest of the text. I had to scroll up to see them; otherwise, it looked like the program had done nothing but return to the main menu.

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [October 8, 2026, 6:23pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1342 "2026-10-08T18:23:04Z")

</div>

> [@Viralfrag](#):
>
> To run the program, I had to right-click and select “Run as Administrator.”

That’s the way to do it on Windows, and will be in the Wiki when it’s ready

> [@Viralfrag](#):
>
> Even though PMS was turned off, the program wouldn’t let me choose “3 - check,” claiming that PMS was still running.

Maybe one of the child processes was still running and locking the database?  
DBRepair handles that when you issue a `Stop` from the menu

> [@Viralfrag](#):
>
> Additionally, the results from each of my selections appeared above the rest of the text. I had to scroll up to see them; otherwise, it looked like the program had done nothing but return to the main menu.

Heh, and I bet you would not be the only one that would be coming to the same conclusion  
@ChuckPa : Maybe a prompt after each run saying something like: `Job ended. Press a key to proceed` and only show the main menu after that?

---

<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:** [October 8, 2026, 8:27pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1343 "2026-10-08T20:27:07Z")

</div>

A prompt ? Interesting thought.

I usually just make the window taller (about 30 lines) and everything fits

I’ll look at improving the guy

---

<div class="post-metadata">

**Author:** ![StephenH](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stephenh/32/313798_2.png) [@StephenH](https://forums.plex.tv/u/StephenH)\
**Post date:** [October 8, 2026, 9:00pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1344 "2026-10-08T21:00:37Z")

</div>

> [@ChuckPa](#):
>
> I’ll look at improving the guy

I think a Clear Screen, send results and then a “Press Any Key To Continue …” to go back to menu (maybe after another Clear Screen?) could work well?

My brain keeps looking for the results after the menu, and then I realise what I’m after is above the (new) menu, not below? Maybe I’m weird though … others may feel differently?

---

<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:** [October 8, 2026, 9:19pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1345 "2026-10-08T21:19:56Z")

</div>

### ALL:

From your responses and having chatted around here,  
I think there’s a few messages for me to take into consideration.

1. Scrolling control
2. Tightening up the output (less wasted space)

If I’m understanding correctly, how does this sound ?

1. In command line mode (arguments on the command line), nothing changes.
2. În interactive mode:

- Tighten up each command’s output to be less white space
- Before printing the menu, show a “Press any key to continue prompt”  
(Where is the “any” key? I don’t have one. 🙄 )

1. To disable the prompt, command line option `--noprompt`
2. You still have the “menu on” and “menu off” commands.

Did I get everyone’s concerns ?

---

<div class="post-metadata">

**Author:** ![Viralfrag](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Viralfrag](https://forums.plex.tv/u/Viralfrag)\
**Post date:** [October 8, 2026, 9:21pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1346 "2026-10-08T21:21:54Z")

</div>

**UI Suggestion:** Make the navigation menu stationary and add a live command window directly underneath it. The window would log active and completed system actions so users have clear, real-time feedback. (Just a constructive suggestion, not a complaint!)

---

<div class="post-metadata">

**Author:** ![balthazarr1](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@balthazarr1](https://forums.plex.tv/u/balthazarr1)\
**Post date:** [October 8, 2026, 9:23pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1347 "2026-10-08T21:23:18Z")

</div>

I just tried the latest version on QNAP Hero 6.xx (the latest non-beta version), and using the latest PMS non-beta. Option 2 - Auto.

It reported all DBs as healthy, but did raise a warning:

\*\*\*\*

Stopping PMS. (60 second max delay)

Stopped PMS.

Checking the PMS databases…

Warning: Failed to set cache size: SQL logic error

Main DB is OK.

Blobs DB is OK.

Main and Blobs databases are healthy - nothing to do.

Starting PMS.

Started PMS.

\*\*\*\*

Thanks for your great work!

---

<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:** [October 8, 2026, 9:25pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1348 "2026-10-08T21:25:11Z")

</div>

@Viralfrag

I can make the menu stationary ( ‘curses’ and ‘pdcurses’ windowed mode )

My only concern with that is a 24x80 window gets really cramped.  
I would need to height-compact it pretty severely but it would fit.

The problem with stationary menu is that you’d have 4 lines for the command’s output and you’d have to scroll through it all the time. That didn’t feel like a good option. Did I miss something there with how to implement it ?

---

<div class="post-metadata">

**Author:** ![Viralfrag](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Viralfrag](https://forums.plex.tv/u/Viralfrag)\
**Post date:** [October 8, 2026, 9:26pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1349 "2026-10-08T21:26:59Z")

</div>

> [@ChuckPa](#):
>
> y only concern with that is a 24x80 window gets really cram

What about a side by side view? kind of like the old plex ui. Menu to the left, output on the right.

---

<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:** [October 8, 2026, 9:27pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1350 "2026-10-08T21:27:34Z")

</div>

> [@balthazarr1](#):
>
> Warning: Failed to set cache size: SQL logic error

Thank you! That’s a first from QNAP to do that.  
Are you trying to set the DB’s record size for the dataset ?

---

<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:** [October 8, 2026, 9:28pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1351 "2026-10-08T21:28:44Z")

</div>

@Viralfrag

Cool idea!

What about the descriptive text ? Drop it ?

---

<div class="post-metadata">

**Author:** ![Viralfrag](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Viralfrag](https://forums.plex.tv/u/Viralfrag)\
**Post date:** [October 8, 2026, 9:29pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1352 "2026-10-08T21:29:36Z")

</div>

I like that or a simple hover description on each item in menu?

---

<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:** [October 8, 2026, 9:30pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1353 "2026-10-08T21:30:12Z")

</div>

@Viralfrag

This is a Text UI, not a Graphical UI.

I’m not sure that can be done but I will look

---

<div class="post-metadata">

**Author:** ![balthazarr1](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@balthazarr1](https://forums.plex.tv/u/balthazarr1)\
**Post date:** [October 8, 2026, 9:37pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1354 "2026-10-08T21:37:46Z")

</div>

No, I just fired up DBRepair 00.99.12 and selected Option 2. TBH, not sure where I would even start to do that 😕

Not sure if it makes any difference, but it’s the x86\_64 version.  
EDIT: Okay, something really screwy is going on with my PMS - can’t access it - QNAP reports it running, but no client can connect.

Also, for giggles, I thought I’d try reindexing (option 6):

-– Reindexing Main DB —

Warning: Failed to set cache size: SQL logic error

ERROR: Index could not open source database: /share/ZFS530\_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db

ERROR: Main DB Reindex failed.

\*\*\*\*\*

Still investigating what’s going on, but seems that DBRepair should not have reported ‘all good’ with the auto option.

---

<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:** [October 8, 2026, 9:41pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1355 "2026-10-08T21:41:54Z")

</div>

@balthazarr1

Are you running in a SSH session with ‘sudo’ privilege ( “#” prompt )

```auto
Warning: Failed to set cache size: SQL logic error

ERROR: Index could not open source database: /share/ZFS530_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db

```

what’s the exact command line you used ?

---

<div class="post-metadata">

**Author:** ![balthazarr1](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@balthazarr1](https://forums.plex.tv/u/balthazarr1)\
**Post date:** [October 8, 2026, 9:43pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1356 "2026-10-08T21:43:48Z")

</div>

Yes, won’t run otherwise - raises errors about unable to open the logs, and then prints a statement that QNAP requires root.

EDIT: Commands:

sudo bash

./DBRepair

2 [enter]

Then, later, in a new SSH session - same, except option 6.

---

<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:** [October 8, 2026, 9:44pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1357 "2026-10-08T21:44:45Z")

</div>

that’s a requirement.

On QNAP, PMS runs as “admin” user. (aka ‘root’)

You must type:

```auto
sudo DBRepair

```

go elevate your privileges

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [October 8, 2026, 9:45pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1358 "2026-10-08T21:45:13Z")

</div>

> [@balthazarr1](#):
>
> then prints a statement that QNAP requires root.

Did you run this as a user with admin rights, but not as admin perhaps?

---

<div class="post-metadata">

**Author:** ![balthazarr1](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@balthazarr1](https://forums.plex.tv/u/balthazarr1)\
**Post date:** [October 8, 2026, 9:46pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1359 "2026-10-08T21:46:12Z")

</div>

Hmm… it seems to be reindexing the Blobs DB just fine - but that’s taking a while, so still running.

EDIT: Yes, it completed the reindex of blobs, but didn’t make any changes because the main DB failed:

-– Reindexing Main DB —

Warning: Failed to set cache size: SQL logic error

ERROR: Index could not open source database: /share/ZFS530\_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db

ERROR: Main DB Reindex failed.

-– Reindexing Blobs DB —

Reindexing Blobs DB

Database REINDEX completed successfully.

Checking Blobs DB after reindex…

ERROR: One or both pipelines failed. Aborting file swap.

---

<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:** [October 8, 2026, 9:47pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/1360 "2026-10-08T21:47:02Z")

</div>

Can you share your “DBRepair.log” file please ?

It’s stored with the Plex Databases

[Previous page](https://forums.plex.tv/t/dbrepair-development/822684.md?page=62)

[Next page](https://forums.plex.tv/t/dbrepair-development/822684.md?page=64)
