Need a Postgres expert to help fix the Peertube DB. Willing to throw some cash to someone who helps.
@omnipotens cc @esm @esm 👀
@kainoa @omnipotens @esm i'd probably be down to help with postgres stuff, whether or not i'm an "expert" at it is debatable though lol

@esm @kainoa @esm

The issue is the database got corrupted

"videoRedundancy" failed: PQgetResult() failed.
pg_dump: error: Error message from server: ERROR: could not access status of transaction 3004004288
DETAIL: Could not open file "pg_xact/0B30": No such file or directory.
pg_dump: error: The command was: COPY public."videoRedundancy" (id, "expiresOn", "fileUrl", url, strategy, "videoFileId", "actorId", "createdAt", "updatedAt", "videoStreamingPlaylistId") TO stdout;

@omnipotens @kainoa @esm first of all i'd suggest applying a backup if you have one, if you don't for whatever reason, you should set up an auto backup script that uses pg_dumpall after this

give a restart a try, if that doesn't fix it you could try messing with pg_dump flags, --data-only and --schema-only are good ones to try (separately)

@esm @kainoa @esm

The data-only failed.

@omnipotens @kainoa @esm hmmmm, it seems like it keeps failing on the videoRedundancy table specifically; I'm not too familiar with peertube but after looking at the docs I think it might just be possible to recreate that table

do the actual postgres db daemon logs say anything whenever you attempt to pg_dump? we may be able to isolate and recreate what's affected

@esm @kainoa @esm

This is what comes up in the logs when I try a dump

@omnipotens @kainoa @esm about the same then

are you able to get the indexes in the videoRedundancy table, in either the current db or the backup? if not then i'd try dropping that specific table and restoring it from the november backup

@esm @kainoa @esm

Sorry my database skills are very limited and I am not to sure how to do that. I have not really messed with DB in 10 years.

@omnipotens @kainoa @esm ah, do you have access to some sort of UI like phpMyAdmin, Adminer, or DBeaver? if not, then try running this in the postgres shell (sudo -u postgres psql) to try and get the indexes on the table:

SELECT indexname, indexdef FROM pg_indexes WHERE tablename = "peertube_prod.public.videoRedundancy";

@esm @kainoa @esm

peertube_prod=> SELECT indexname, indexdef FROM pg_indexes WHERE tablename = "peertube_prod.public.videoRedundancy";
ERROR: column "peertube_prod.public.videoRedundancy" does not exist
LINE 1: ...xname, indexdef FROM pg_indexes WHERE tablename = "peertube_...
^

@omnipotens @kainoa @esm apologies, try replacing "peertube_prod.public.videoRedundancy" with 'videoRedundancy'

@esm @kainoa @esm

same
peertube_prod=> SELECT indexname, indexdef FROM pg_indexes WHERE tablename = "videoRedundancy";
ERROR: column "videoRedundancy" does not exist
LINE 1: ...xname, indexdef FROM pg_indexes WHERE tablename = "videoRedu...

@omnipotens @kainoa @esm single quotes, not double, postgres is a bit picky with that
peertube_prod=> SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'vi - Pastebin.com

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Pastebin

@omnipotens @kainoa @esm hmmm, so the table isn't completely toast, it just seems like the data is messed up

after backing up the current data directory as wolf480pl mentioned earlier (not a dump, just copying the /var/lib/pgsql or /var/lib/postgresql directory outright), give pg_restore --data-only -d peertube_prod -t videoRedundancy <november.dump> a shot (replace with the path to the database backup from november)