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

Lemmy from scratch install instructions fail with "thread ‘main’ panicked at ‘Couldn’t run DB Migrations’, crates/db_schema/src/utils.rs:165:25" #201

Closed
RocketDerp opened this issue Jun 9, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@RocketDerp
Copy link
Contributor

As a workaround, before starting the lemmy server:

sudo -iu postgres psql -c “ALTER USER lemmy WITH SUPERUSER;”

It seems that the problematic SQL has been identified in this pull request?

LemmyNet/lemmy@29c4144

@RocketDerp RocketDerp added the bug Something isn't working label Jun 9, 2023
@dessalines dessalines transferred this issue from LemmyNet/lemmy Jun 9, 2023
@dessalines
Copy link
Member

Could you do a PR to add that to the docs?

@sunaurus
Copy link
Contributor

Adding superuser privileges is not an ideal solution - it means that Lemmy won't work on any managed cloud database which prevents superuser access. This PR seems like a better solution: LemmyNet/lemmy#3002

@sunaurus
Copy link
Contributor

FYI as LemmyNet/lemmy#3002 was merged, I believe this issue can be closed

@ffolkes
Copy link

ffolkes commented Jun 14, 2023

This is not working for me, and I'm puzzled why. I confirmed it was added, but I'm still getting the migrations error. When will the patch be available via crates.io? I'm anxious to get my instance up and running. :)

postgres=# \du
lemmy | Superuser

@Nutomic
Copy link
Member

Nutomic commented Jun 14, 2023

That fix is not released yet, it will be in 0.18

@bengtfredh
Copy link

@ffolkes I had same issue. Found out database server was missing postgresql extensions ltree and pgcrypto.

@ffolkes
Copy link

ffolkes commented Jun 16, 2023

@ffolkes I had same issue. Found out database server was missing postgresql extensions ltree and pgcrypto.

Thank you! That did it. :) On Rocky 9 I needed to do "dnf install postgresql-contrib" and then "CREATE EXTENSION IF NOT EXISTS pgcrypto;" and "CREATE EXTENSION IF NOT EXISTS ltree;" then grant lemmy superuser to start it until the patch rolls out.

@kartonrad
Copy link

had trouble finding this since it was already closed

almost updated my postgres version oh no

thank you for the workaround!

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

No branches or pull requests

7 participants