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

Issue with DB migration after the latest update. Jellyseerr fails to start. #1176

Closed
1 task done
Darkfella91 opened this issue Dec 22, 2024 · 2 comments
Closed
1 task done
Labels
bug Something isn't working confirmed This bug has been reproduced

Comments

@Darkfella91
Copy link

Description

Hello, i've been using postgres db for my jellyseerr instance for a few days but it recently broke after updating and it fails to start. There are some errors i receive related to the db migration.

Version

develop@sha256:3fb9e6409c9a4d54630c72cc46c2f4eda6e66ca1753a093c734c7c7cd40c9a09

Steps to Reproduce

Update to the newest version.

Screenshots

No response

Logs

Migration "InitialMigration1734786061496" failed, error: relation "blacklist" already exists
2024-12-22T13:16:03.179Z [error]: QueryFailedError: relation "blacklist" already exists
    at PostgresQueryRunner.query (/app/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]_@[email protected]_@swc+h_wzz2xcsisc7bz3xl7invzcnodu/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async InitialMigration1734786061496.up (/app/dist/migration/postgres/1734786061496-InitialMigration.js:9:9)
    at async MigrationExecutor.executePendingMigrations (/app/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]_@[email protected]_@swc+h_wzz2xcsisc7bz3xl7invzcnodu/node_modules/typeorm/migration/MigrationExecutor.js:223:17)
    at async DataSource.runMigrations (/app/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]_@[email protected]_@swc+h_wzz2xcsisc7bz3xl7invzcnodu/node_modules/typeorm/data-source/DataSource.js:249:35)
    at async /app/dist/index.js:88:13 
 ELIFECYCLE  Command failed with exit code 1.

Platform

desktop

Database

PostgreSQL

Device

Linux Server

Operating System

Talos OS

Browser

Chrome

Additional Context

No response

Code of Conduct

  • I agree to follow Jellyseerr's Code of Conduct
@Darkfella91 Darkfella91 added awaiting triage This issue needs to be reviewed bug Something isn't working labels Dec 22, 2024
@gauthier-th gauthier-th added confirmed This bug has been reproduced and removed awaiting triage This issue needs to be reviewed labels Dec 22, 2024
@gauthier-th
Copy link
Collaborator

After investigating, I think the best solution would be to :

  • Delete your PostgreSQL database and restart with a fresh install, if you don't have that much data.
  • Or ignore the migrations and try to fix manually your PostgreSQL database to match the new schema.

This issue is coming from the PR implementing PostgreSQL, which introduced unwanted changes to SQLite databases.
A fix has already been made for this, but it introduced breaking changes.

If your instance was running the develop branch just after the Postgres PR has been merged (44a9221 or a bit later), you could try something like that to fix your db:

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

Could you please try this and tell me if it solves your issue? This shouldn't happen anymore for new instances.

@Darkfella91
Copy link
Author

Yes, that solved my issue :) Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed This bug has been reproduced
Projects
None yet
Development

No branches or pull requests

3 participants