New users unable to join the forum, accepting invitation leads to internal server error

Help!
I’m an admin of a Discuss forum in PractiTest.

Recently new users cannot log in, they receive an error message “Something went wrong, perhaps the username or email is already registered. Try the forgot password link.”.
When I invite the new users, they get the invitation email, but after feeling all details have an “Internal Server Error” message.
I checked error logs, and this is what I see for invitation acceptance attempt:

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "user_emails_pkey" DETAIL: Key (id)=(45) already exists. ) app/models/invite_redeemer.rb:80:

Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "user_emails_pkey" DETAIL: Key (id)=(45) already exists.

I tried to upgrade to the latest Discource version, and it seems like I managed to (2.9.0.beta1).

Please help!

What version were you upgrading from? What version is postgres?

Don’t remember, but this is what I could find in the logs:

from_version: 11d61cb
repository: /var/www/discourse/plugins/docker_manager

And how can I check the Postgres version?

Any other info I can provide?

anyone?
I’d really appreciate any guidance in regards
@pfaffman

I think no one has offered answers because there aren’t any good ones.

Postgres version is in

 /var/discourse/shared/standalone/postgres_data/PG_VERSION

Or something like that. I’m in my phone.

It sounds like you have a corrupt index, which I haven’t seen in a while. The solution is to try to rebuild the index and if it fails delete or fix the duplicate entries. It requires understanding some stuff about sql and indexes and discourse.

You can search for “corrupt index”

It could be something else. I thought this hasn’t happened to anyone on postgres 13. How old is you forum.

Thank you very much BTW, this helped!

1 Like