Crash after relogon

Hello! I use Sentry 8.21.0, Docker, for authentication use django-auth-ldap
sentry-ldap-auth. Description of the problem: I authorize using the AD’s credentials, everything works without problems, but as soon as I make an exit and try to relogin, the system falls. In error logs:

[ERROR] django.request: Internal Server Error: / auth / login / sentry / ((status_code = 500 request = <WSGIRequest: POST u ‘/ auth / login / sentry /’>)

postgres_1 | ERROR: duplicate key value violates unique constraint "sentry_environmentproject_project_id_29250c1307d3722b_uniq"
postgres_1 | DETAIL: Key (project_id, environment_id) = (1, 12) already exists.
postgres_1 | STATEMENT: INSERT INTO “sentry_environmentproject” (“project_id”, “environment_id”) VALUES (1, 12) RETURNING “sentry_environmentproject”. “Id”

Hope for your help!