# 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:** 26

<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:** [March 18, 2025, 2:21am UTC](https://forums.plex.tv/t/dbrepair-development/822684/554 "2025-03-18T02:21:36Z")

</div>

I see if I can get ahold of my MacOS guy and have him try it.

My Mac Mini died last year

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:21am UTC](https://forums.plex.tv/t/dbrepair-development/822684/555 "2025-03-18T02:21:56Z")

</div>

So should I try manual commands?

---

<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:** [March 18, 2025, 2:22am UTC](https://forums.plex.tv/t/dbrepair-development/822684/556 "2025-03-18T02:22:24Z")

</div>

are you confortable with the Linux shell / bash ?

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:22am UTC](https://forums.plex.tv/t/dbrepair-development/822684/557 "2025-03-18T02:22:48Z")

</div>

Nah, not at all

---

<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:** [March 18, 2025, 2:23am UTC](https://forums.plex.tv/t/dbrepair-development/822684/558 "2025-03-18T02:23:29Z")

</div>

Before I rip this apart.

You’ve not had any trouble until this update of MacOS ?  
(DBRepair hasn’t changed in months either)

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:25am UTC](https://forums.plex.tv/t/dbrepair-development/822684/559 "2025-03-18T02:25:27Z")

</div>

I have not noticed prior to 15.3, thats when this AI rubbish was introduced

---

<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:** [March 18, 2025, 2:27am UTC](https://forums.plex.tv/t/dbrepair-development/822684/560 "2025-03-18T02:27:12Z")

</div>

Thanks. That really points the finger at Apple.

Have you the time to talk to them about it?

I realize we’ll need to get a repeatable example of the failure for them to take action — which means running the code in full verbose debug and then examining it.

I’ll work on a procedure for you to capture that verbose output

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:29am UTC](https://forums.plex.tv/t/dbrepair-development/822684/561 "2025-03-18T02:29:26Z")

</div>

So what harm is the error to my Mac or more important PMS. God help me if Plex craps itself, divorce or a shooting 😬

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:31am UTC](https://forums.plex.tv/t/dbrepair-development/822684/562 "2025-03-18T02:31:38Z")

</div>

As for Talking to apple I would not know where to start considering this is all third party analysis.

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [March 18, 2025, 2:37am UTC](https://forums.plex.tv/t/dbrepair-development/822684/563 "2025-03-18T02:37:42Z")

</div>

My guess is this: [regex - RE error: illegal byte sequence on Mac OS X - Stack Overflow](https://stackoverflow.com/questions/19242275/re-error-illegal-byte-sequence-on-mac-os-x)

Try prefixing the `sed` commands with `LC_ALL=C`.

```auto
# Edit the .SQL files if all OK
    if [$Fail -eq 0]; then

      # Edit
      LC_ALL=C sed -i -e 's/ROLLBACK;/COMMIT;/' "$TMPDIR/library.plexapp.sql-$TimeStamp"
      LC_ALL=C sed -i -e 's/ROLLBACK;/COMMIT;/' "$TMPDIR/blobs.plexapp.sql-$TimeStamp"
    fi

```

---

<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:** [March 18, 2025, 2:40am UTC](https://forums.plex.tv/t/dbrepair-development/822684/564 "2025-03-18T02:40:32Z")

</div>

WTH? Why now ?

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:48am UTC](https://forums.plex.tv/t/dbrepair-development/822684/565 "2025-03-18T02:48:10Z")

</div>

Ok, do you mean?

 ![Screenshot 2025-03-18 at 12.46.54 pm](https://global.discourse-cdn.com/plex/original/4X/0/6/9/0692ff1312fe9c551f266dc77262e2abb4256d74.jpeg)

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [March 18, 2025, 2:48am UTC](https://forums.plex.tv/t/dbrepair-development/822684/566 "2025-03-18T02:48:12Z")

</div>

Maybe the database has some new extended text characters now, a movie or person name with something, or an emoji even.

@SE56 … you could share a database file, zipped up?

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [March 18, 2025, 2:49am UTC](https://forums.plex.tv/t/dbrepair-development/822684/567 "2025-03-18T02:49:13Z")

</div>

I’m sorry I meant to modify the script, that’s the section @ChuckPa identified as the likely failing commands.

---

<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:** [March 18, 2025, 2:49am UTC](https://forums.plex.tv/t/dbrepair-development/822684/568 "2025-03-18T02:49:33Z")

</div>

The SQL won’t cause a RE error.

Setting `LC=C` controls the operation of sed arguments

Standby please, I’m crafting a test

---

<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:** [March 18, 2025, 2:59am UTC](https://forums.plex.tv/t/dbrepair-development/822684/570 "2025-03-18T02:59:49Z")

</div>

DBRepair with _correct_ mods 😎

[DBRepair-test.tar.gz](https://forums.plex.tv/uploads/short-url/1yWjMOWFocJn3hEkuNZ7UohOIwx.gz) (16.6 KB)

Sorry about that

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 3:00am UTC](https://forums.plex.tv/t/dbrepair-development/822684/571 "2025-03-18T03:00:30Z")

</div>

Instructions, just run it

---

<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:** [March 18, 2025, 3:00am UTC](https://forums.plex.tv/t/dbrepair-development/822684/572 "2025-03-18T03:00:54Z")

</div>

1. 🍿
2. 🍺
3. Run it

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 3:04am UTC](https://forums.plex.tv/t/dbrepair-development/822684/573 "2025-03-18T03:04:58Z")

</div>

So just zip it and post

[DBRepair-test.sh.zip](https://forums.plex.tv/uploads/short-url/wuwW7KEDR8YFeWs2i6tyozSZFbX.zip) (17.1 KB)

---

<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:** [March 18, 2025, 3:06am UTC](https://forums.plex.tv/t/dbrepair-development/822684/574 "2025-03-18T03:06:14Z")

</div>

I gave you the tar.gz.

1. Extract it. (tar xf DBRepair-test.tar.gz)
2. Make popcorn & pour beer
3. Run it
4. Use fire extinguisher as required.  
( it’s been a long day )

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

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