kieraneglin / pinchflat

Your next YouTube media manager
GNU Affero General Public License v3.0
1.23k stars 22 forks source link

Pinchflat not working anymore after update. Internal Server Error #450

Open shaunvis1 opened 5 days ago

shaunvis1 commented 5 days ago

Describe the bug I updated my docker and now get "Internal Server Error"

To Reproduce Steps to reproduce the behavior:

  1. Start Pinchflat, go to homepage

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Diagnostic info

Status: 500

Reason: %Exqlite.Error{message: "database disk image is malformed", statement: "SELECT count(m0.\"id\") FROM \"media_items\" AS m0 WHERE (NOT (m0.\"media_filepath\" IS NULL))"}

Stacktrace:

    (ecto_sql 3.12.0) lib/ecto/adapters/sql.ex:1078: Ecto.Adapters.SQL.raise_sql_call_error/1
    (ecto_sql 3.12.0) lib/ecto/adapters/sql.ex:976: Ecto.Adapters.SQL.execute/6
    (ecto 3.12.3) lib/ecto/repo/queryable.ex:232: Ecto.Repo.Queryable.execute/4
    (ecto 3.12.3) lib/ecto/repo/queryable.ex:19: Ecto.Repo.Queryable.all/3
    (ecto 3.12.3) lib/ecto/repo/queryable.ex:162: Ecto.Repo.Queryable.one!/3
    (pinchflat 2024.10.30) lib/pinchflat_web/controllers/pages/page_controller.ex:30: PinchflatWeb.Pages.PageController.render_home_page/1
    (pinchflat 2024.10.30) lib/pinchflat_web/controllers/pages/page_controller.ex:1: PinchflatWeb.Pages.PageController.action/2
    (pinchflat 2024.10.30) lib/pinchflat_web/controllers/pages/page_controller.ex:1: PinchflatWeb.Pages.PageController.phoenix_controller_pipeline/2

pinchflat-logs-2024-11-02.txt

Additional context

Add any other context about the problem here.

kieraneglin commented 2 days ago

Hey there - thanks for the report!

This isn't an issue with Pinchflat per se, but rather an issue with SQLite itself. This can be caused by any number of things, but common ones include:

See more here. This can happen with any sqlite-backed app including things like Sonarr/Radarr, but let's see about getting that fixed.


Possible fix for SQLite error:

  1. Stop the Pinchflat Docker container
  2. On your host machine, navigate to the directory that holds your Pinchflat config. You should see that there's a folder called db. Back up this folder before continuing.
  3. Once backed up, open terminal on your host and navigate to the db directory that was the source of the backup you just created. For me, that looks like cd /appdata/pinchflat/db
  4. Install the sqlite CLI. This will vary depending on your distro, but it's usually something like sudo apt install sqlite3
  5. Run these commands (adapted from this SO answer):
    
    mv pinchflat.db pinchflat_bak.db
    mv pinchflat.db-shm pinchflat_bak.db-shm 2>/dev/null
    mv pinchflat.db-wal pinchflat_bak.db-wal 2>/dev/null

echo '.recover' | sqlite3 pinchflat_bak.db | sqlite3 pinchflat.db


6. Re-start the Pinchflat Docker container and see if everything's working again

---

Let me know if you have any questions!