Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to log in after moving from preview-postgres to 2.2.2 #1201

Closed
1 task done
Cheezzhead opened this issue Dec 30, 2024 · 3 comments
Closed
1 task done

Unable to log in after moving from preview-postgres to 2.2.2 #1201

Cheezzhead opened this issue Dec 30, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Cheezzhead
Copy link

Description

Hey all, I migrated my jellyseerr container to the preview-postgres image mentioned here and everything has worked fine.

However, when moving to the new release (2.2.2), I've run into some problems. First I got an error message identical to the one posted here. After running the query mentioned in that issue to resolve, Jellyseerr seemed to start normally, however the connection with Plex appears to be broken and I can't log in with my plex account:

2024-12-30T09:44:34.068Z [info]: Commit Tag: $GIT_SHA 
2024-12-30T09:44:34.526Z [info]: Starting Overseerr version 2.2.2 
2024-12-30T09:44:34.981Z [debug][Settings Migrator]: Checking migration '0001_migrate_hostname.js'... 
2024-12-30T09:44:34.983Z [debug][Settings Migrator]: Checking migration '0002_migrate_apitokens.js'... 
2024-12-30T09:44:34.984Z [debug][Settings Migrator]: Checking migration '0003_emby_media_server_type.js'... 
2024-12-30T09:44:34.984Z [debug][Settings Migrator]: Checking migration '0004_migrate_region_setting.js'... 
2024-12-30T09:44:34.988Z [info][Notifications]: Registered notification agents 
2024-12-30T09:44:35.023Z [info][Jobs]: Scheduled jobs loaded 
2024-12-30T09:44:35.152Z [info][Server]: Server ready on port 5055 
2024-12-30T09:44:57.200Z [error][API]: Something went wrong authenticating with Plex account {"errorMessage":"column User_settings.discoverRegion does not exist","ip":"XXX"}
2024-12-30T09:45:00.005Z [debug][Jobs]: Starting scheduled job: Download Sync 
2024-12-30T09:45:00.012Z [info][Jobs]: Starting scheduled job: Plex Recently Added Scan 
2024-12-30T09:45:00.013Z [info][Plex Scan]: Scan starting {"sessionId":"0de66d50-bc4b-4a42-b630-36488abc3797"}
2024-12-30T09:45:00.015Z [error][Plex Scan]: Scan interrupted {"errorMessage":"column User_settings.discoverRegion does not exist"}

Version

2.2.2

Steps to Reproduce

  1. Migrate from 2.1.0 (sqlite) to preview-postgres and run migration (logs are here)
  2. Update from preview-postgres to 2.2.2

Screenshots

No response

Logs

No response

Platform

desktop

Database

PostgreSQL

Device

MacBook Pro

Operating System

Ubuntu 20.04 running Docker

Browser

Firefox

Additional Context

Docker version:

Client: Docker Engine - Community
 Version:           27.4.1
 API version:       1.47
 Go version:        go1.22.10
 Git commit:        b9d17ea
 Built:             Tue Dec 17 15:45:52 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.4.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.10
  Git commit:       c710b88
  Built:            Tue Dec 17 15:45:52 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.24
  GitCommit:        88bf19b2105c8b17560993bee28a01ddc2f97182
 runc:
  Version:          1.2.2
  GitCommit:        v1.2.2-0-g7cb3632
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Code of Conduct

  • I agree to follow Jellyseerr's Code of Conduct
@Cheezzhead Cheezzhead added awaiting triage This issue needs to be reviewed bug Something isn't working labels Dec 30, 2024
@fallenbagel
Copy link
Owner

fallenbagel commented Dec 30, 2024

Your migrations failed due to a changing from a preview to 2.2.2. Not a bug but you'll probably need to run that migration. This is because the postgres support PR had a few changes (that was not updated with preview) with the initial migration so the migration that adds that column is initial migration which in your case already ran without the discoverRegion column.

https://github.com/Fallenbagel/jellyseerr/blob/f8a8ebdf76f939ccc28ce7b39343e3a606c90b33/server/migration/postgres/1734786061496-InitialMigration.ts#L43-L45

Not a bug, but you'll need to fix this manually by using a pg client and running

DELETE FROM migrations;
INSERT INTO migrations VALUES
(1, 1734786061496, 'InitialMigration1734786061496'),
(2, 1734786596045, 'AddTelegramMessageThreadId1734786596045'),
(3, 1734809898562, 'FixNullFields1734809898562');
ALTER TABLE "user_settings" ADD IF NOT EXISTS "discoverRegion" character varying;

Could you try that?

@fallenbagel fallenbagel added question Further information is requested and removed bug Something isn't working awaiting triage This issue needs to be reviewed labels Dec 30, 2024
@Cheezzhead
Copy link
Author

Cheezzhead commented Dec 30, 2024

Great, I managed to fix it with your queries and 2 more that seemed to be required. For posterity (and anybody else running into similar problems) this is the full batch I had to run:

DELETE FROM migrations;
INSERT INTO migrations VALUES
(1,	1734786061496,	'InitialMigration1734786061496'),
(2,	1734786596045,	'AddTelegramMessageThreadId1734786596045'),
(3,	1734809898562,	'FixNullFields1734809898562'),
(5,	1735553645562,	'AddOverrideRules1734805738349');
ALTER TABLE "user_settings" ADD IF NOT EXISTS "discoverRegion" character varying;
ALTER TABLE "user_settings" ADD IF NOT EXISTS "streamingRegion" character varying;

Thanks for the quick help!

@dasunsrule32
Copy link

dasunsrule32 commented Dec 30, 2024

I was missing region, once I added that table the data migrated successfully. Thank you.

DELETE FROM migrations;
INSERT INTO migrations VALUES
(1, 1734786061496, 'InitialMigration1734786061496'),
(2, 1734786596045, 'AddTelegramMessageThreadId1734786596045'),
(3, 1734809898562, 'FixNullFields1734809898562');
ALTER TABLE "user_settings" ADD IF NOT EXISTS "region" character varying;

Migration output:

2024-12-30T22:42:33.604004Z LOG report summary reset
              table name     errors       rows      bytes      total time
------------------------  ---------  ---------  ---------  --------------
                   fetch          0          0                     0.000s
         fetch meta data          0         26                     0.032s
       Drop Foreign Keys          0         32                     0.020s
------------------------  ---------  ---------  ---------  --------------
            "migrations"          1          0                     0.032s
               "session"          0          5     0.9 kB          0.052s
                "season"          0         39     2.0 kB          0.060s
        "season_request"          0          0                     0.044s
                 "media"          0        134    18.6 kB          0.100s
                  "user"          1          0                     0.068s
                 "issue"          0          0                     0.084s
         "media_request"          0          2     0.2 kB          0.108s
             "watchlist"          0          0                     0.112s
"user_push_subscription"          0          0                     0.068s
             "blacklist"          0          0                     0.132s
         "issue_comment"          0          0                     0.084s
       "discover_slider"          1          0                     0.108s
         "user_settings"          0          0                     0.124s
------------------------  ---------  ---------  ---------  --------------
 COPY Threads Completion          0          4                     0.144s
         Reset Sequences          0         13                     0.092s
     Create Foreign Keys          0         16                     0.020s
        Install Comments          0          0                     0.000s
------------------------  ---------  ---------  ---------  --------------
       Total import time          3        180    21.7 kB          0.256s

Migration command:

docker run --rm -v /mnt/data/jellyseerr/db/db.sqlite3:/db.sqlite3:ro ghcr.io/ralgar/pgloader:pr-1531 pgloader --with "quote identifiers" --with "data only" /db.sqlite3 postgresql://jellyseerr:<password>@<pg-host>:5432/jellyseerr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants