#Getting `Oops` Error when trying to view some profiles

137 messages ยท Page 1 of 1 (latest)

lone sage
#

Just migrated from Overseer to Seer 3.0.1 and from sqlite to postgresql. Connected to Plex. When I click on my own profile, and a few others, I see a quick profile screen but it is immediately replaced with Oops Reutnr Home. Happening to Plex users as well as a local users. I'm getting the error on about 50% of my users.

Not much in the log files. I see this error occasionally but it's not when I am clicking on proifles.
2026-02-14T22:57:00.811Z [error][Plex.TV Metadata API]: Failed to retrieve watchlist items {"errorMessage":"Request failed with status code 401"}

alpine stirrup
#

Youll need to relogin

#

To update the plex token

#

Oh wait

#

Youre gettong oops?

#

Checked your console logs

#

From browser

#

I think a migration mightve borked somewhere

#

As in postgres migration

lone sage
#

Nothing really in the logs. Strange that it's only some users. If I look in the users table, I don't see any glaring inconsistency. I can edit the user. but saving them doesn't fix the Oops error.

alpine stirrup
#

Not the logs from server

lone sage
alpine stirrup
#

It seems related to media table migration

#

Or if you free CC: @wind elm

#

Imma go ๐Ÿ›Œ

wind elm
#

really have to go to sleep too, can try to take a look tomorrow

lone sage
#

Just checking to see if anyone had a chance to take a closer look at this one today? I noticed about 15% of my completed requests were coming up as Series Not Found. They were over a year old, so I deleted them all. Still getting the same error on the same users.

wind elm
#

@surreal hamlet any idea?

alpine stirrup
#

I know why

#

This comes from the old bug that was present

#

Which was fixed but old records need to be manually fixed

alpine stirrup
#

@lone sage

SELECT id, type, status, "createdAt", "updatedAt"
FROM media_request
WHERE "mediaId" IS NULL;
#

Can you run this query directly in your pgsql

surreal hamlet
alpine stirrup
#

And then send the results

alpine stirrup
#

This is for old broken records

#

Which wont be magically fixed ๐Ÿ—ฟ

alpine stirrup
lone sage
#

Thank you. It returned 0 rows.

alpine stirrup
lone sage
#

219 rows. Do you want the data?

alpine stirrup
#

Likely during the sqlite -> pgsql migration, it didnt carry over all the media rows or the IDs shifted

#

You have two options. Retry the pgloader migration again (and this time update me along the way) or easiest way is to do the following

#

Try and reconnect any that can be connected

#

And delete the rest

#
SELECT COUNT(*)
FROM media_request mr
LEFT JOIN media m ON mr."mediaId" = m.id
WHERE m.id IS NULL
  AND EXISTS (
    SELECT 1 FROM media m2
    WHERE m2."tmdbId" = mr."tmdbId" AND m2."mediaType" = mr.type
  );
#

What do you get when you run this

lone sage
#
LINE 7: WHERE m2."tmdbId" = mr."tmdbId" AND m2."mediaType" = mr....
HINT: Perhaps you meant to reference the column "m2.tmdbId" or the column "m.tmdbId".```
#

I don't mind losing old requests

alpine stirrup
#

Yeah i just checked

#

Media request table doesnt have any tmdbids

#

So cant reconnect them

alpine stirrup
#

First run this

DELETE FROM season_request
WHERE "requestId" IN (
  SELECT mr.id
  FROM media_request mr
  LEFT JOIN media m ON mr."mediaId" = m.id
  WHERE m.id IS NULL
);
#

Then

#
DELETE FROM media_request mr
USING (
  SELECT mr2.id
  FROM media_request mr2
  LEFT JOIN media m ON mr2."mediaId" = m.id
  WHERE m.id IS NULL
) orphaned
WHERE mr.id = orphaned.id;
lone sage
#

178 rows affected in first one

#

219 in the second

alpine stirrup
#

Damn so many orphans

lone sage
#

I reran the second query and got 0 rows. No more oops on those users, but more Series not found. I can just delete these?

alpine stirrup
#

Th9se are orphaned media ids (or corrupted)

#

I also hated my migration process from sqlite to pgsql

#

Spent 8 hours

#

Rerunning them

#

To get it to work. Had to still remove 5 records

lone sage
#

Haha...it's not the worst for me. No one is paying me for this service ๐Ÿ˜œ. And anything that was requested already made it to an arr.

alpine stirrup
lone sage
#

And some of them appear to be from watchlists, which are now starting to repopulate ๐Ÿคฆโ€โ™‚๏ธ

#

I hear ya....I normally am as well.

#

Interestingly, most of the ones i had to delete were from about 1 year in age or less....everything beyond that looks ok

alpine stirrup
lone sage
#

Thank you for all your work on Seerr and the help with my issue. Really appreciate it!

#

Uh oh....back to Oops

#

I got 29 rows in that first query. Just run the last 2 again?

alpine stirrup
#

In browser console?

lone sage
#

BTW, I keep testing the same user. I didn't approve any new requests for this new user from their watchlist (it's disabled). So interesting that they would be impacted.

alpine stirrup
lone sage
#

38 and 29 rows this time

#

Working again. This time no Series not found requests.

alpine stirrup
#

Sounds like your db is really messed ๐Ÿ˜ญ

surreal hamlet
alpine stirrup
lone sage
#

Sure, which screen would you like to see?

alpine stirrup
lone sage
#

Made a new request. So far, no errors. User profile loads correctly

alpine stirrup
#

Gingers crossed

#

FINGERS*

#

NOT

lone sage
#

But...lol....Issues seem broken. I get an Oops when I change them to all

alpine stirrup
#

Send the browser console for that

#

I think need to clear issues table too

wind elm
alpine stirrup
#

Not a bad idea

#

๐Ÿค”

#

Cant be any worse than pgloader

#

Whats the worst that could happen? Break it more?

lone sage
alpine stirrup
wind elm
lone sage
#

I'd be happy to test ๐Ÿ˜

wind elm
#

then i'll write a draft tonight if i got time MoyaiSalute

alpine stirrup
lone sage
#

1 row

alpine stirrup
#

Only 1 corrupted one

#
DELETE FROM issue_comment
WHERE "issueId" IN (
  SELECT i.id
  FROM issue i
  LEFT JOIN media m ON i."mediaId" = m.id
  WHERE m.id IS NULL
);
#
DELETE FROM issue i
USING (
  SELECT i2.id
  FROM issue i2
  LEFT JOIN media m ON i2."mediaId" = m.id
  WHERE m.id IS NULL
) orphaned
WHERE i.id = orphaned.id;
#

And also run this following after the above

#
SELECT 'season' AS "table", COUNT(*) FROM season s LEFT JOIN media m ON s."mediaId" = m.id WHERE m.id IS NULL
UNION ALL
SELECT 'media_request', COUNT(*) FROM media_request mr LEFT JOIN media m ON mr."mediaId" = m.id WHERE m.id IS NULL
UNION ALL
SELECT 'issue', COUNT(*) FROM issue i LEFT JOIN media m ON i."mediaId" = m.id WHERE m.id IS NULL;
#

To do a full sweep

lone sage
#

Rows: 6, 3 and 3

alpine stirrup
lone sage
#

1st one returned 6 rows. Second one 3 and the last one 3 as well

#

Sorry, I should have written it out lol

alpine stirrup
#
table          | count
---------------|------
season         | ???
media_request  | ???
issue          | ???

Something like this?

lone sage
#

Sorry...yes:
table count
season 372
media_request 0
issue 0

alpine stirrup
#

Oh dam ๐Ÿ—ฟ

lone sage
#

Issues view looks good now. No more Oops

alpine stirrup
#
DELETE FROM season s
USING (
  SELECT s2.id
  FROM season s2
  LEFT JOIN media m ON s2."mediaId" = m.id
  WHERE m.id IS NULL
) orphaned
WHERE s.id = orphaned.id;
#

So all the orphaned seasons gets removed

#

Then rerun the last command again

lone sage
#

table count
season 0
media_request 0
issue 0

alpine stirrup
#

Perfect

lone sage
#

So it was bothering me a bit that I had to drop a bunch of data. Like fallenangel, I'm a bit of a nerd with data and stats. I decided to try my postgres migration again with Claude AI's help. I'm happy to say after a bunch of back-and-forth, it was successful this time.

I thought I'd share a summary of what worked for me in case it helped anyone else or maybe to update the docs or look into the lastSeasonChange column. Apparently my source sqlite db had some corruption in it.

ETA: One additional step to fix the sequence numbers.