realsuayip / django-sozluk

an exhaustive ekşi sözlük clone, powered by Python
https://sozluk.me
BSD 3-Clause "New" or "Revised" License
320 stars 79 forks source link

docker compose has an error #30

Closed alimkoca closed 2 years ago

alimkoca commented 2 years ago

Backend installation have some problems like: sozluk_dev_celery_worker | [2021-12-28 21:21:24,153: INFO/MainProcess] Connected to redis://redis:6379/1 sozluk_dev_celery_worker | [2021-12-28 21:21:24,169: INFO/MainProcess] mingle: searching for neighbors sozluk_dev_celery_beat | generic_private has been created with the username anonymous and email private@example.com. You can edit the details of this user via admin page if you wish. sozluk_dev_celery_worker | [2021-12-28 21:21:25,205: INFO/MainProcess] mingle: all alone sozluk_dev_celery_worker | [2021-12-28 21:21:25,239: INFO/MainProcess] celery@d656610deeb1 ready. sozluk_dev_celery_beat | CommandError: Error: That e-mail is already taken. sozluk_dev_celery_beat | celery beat v4.4.7 (cliffs) is starting. sozluk_dev_celery_beat | __ - ... __ - _ sozluk_dev_celery_beat | LocalTime -> 2021-12-28 21:21:26 sozluk_dev_celery_beat | Configuration -> sozluk_dev_celery_beat | . broker -> redis://redis:6379/1 sozluk_dev_celery_beat | . loader -> celery.loaders.app.AppLoader sozluk_dev_celery_beat | . scheduler -> celery.beat.PersistentScheduler sozluk_dev_celery_beat | . db -> celerybeat-schedule sozluk_dev_celery_beat | . logfile -> [stderr]@%INFO sozluk_dev_celery_beat | . maxinterval -> 5.00 minutes (300s) sozluk_dev_celery_beat | [2021-12-28 21:21:26,559: INFO/MainProcess] beat: Starting... sozluk_dev_db | 2021-12-28 18:21:27.092 UTC [74] ERROR: duplicate key value violates unique constraint "dictionary_author_username_key" sozluk_dev_db | 2021-12-28 18:21:27.092 UTC [74] DETAIL: Key (username)=(djangosozluk) already exists. sozluk_dev_db | 2021-12-28 18:21:27.092 UTC [74] STATEMENT: INSERT INTO "dictionary_author" ("password", "last_login", "is_superuser", "first_name", "last_name", "is_staff", "date_joined", "username", "slug", "email", "is_active", "is_novice", "application_status", "application_date", "last_activity", "queue_priority", "suspended_until", "is_frozen", "is_private", "allow_uncategorized", "birth_date", "gender", "entries_per_page", "topics_per_page", "message_preference", "pinned_entry_id", "allow_receipts", "allow_site_announcements", "theme", "karma", "announcement_read") VALUES ('pbkdf2_sha256$260000$KBgNo9tjf0HKGSrNsq7TnA$ExW5T4Xhf8+BNdcUesUlt/C+Pz8KaRT+x7NZUUMKC2U=', NULL, false, '', '', false, '2021-12-28T18:21:26.998966+00:00'::timestamptz, 'djangosozluk', 'djangosozluk-1', 'superuser@example.com', true, false, 'AP', NULL, NULL, 0, NULL, false, false, true, NULL, 'NO', 10, 50, 'DS', NULL, true, true, 'light', 0, '2021-12-28T18:21:27.091468+00:00'::timestamptz) RETURNING "dictionary_author"."id" sozluk_dev_backend | Hata: Bu isimle bir kullanıcı zaten oluşturulmuş veya e-posta adresi kullanımda. sozluk_dev_db | 2021-12-28 18:21:29.224 UTC [75] ERROR: duplicate key value violates unique constraint "dictionary_author_username_key" sozluk_dev_db | 2021-12-28 18:21:29.224 UTC [75] DETAIL: Key (username)=(anonymous) already exists. sozluk_dev_db | 2021-12-28 18:21:29.224 UTC [75] STATEMENT: INSERT INTO "dictionary_author" ("password", "last_login", "is_superuser", "first_name", "last_name", "is_staff", "date_joined", "username", "slug", "email", "is_active", "is_novice", "application_status", "application_date", "last_activity", "queue_priority", "suspended_until", "is_frozen", "is_private", "allow_uncategorized", "birth_date", "gender", "entries_per_page", "topics_per_page", "message_preference", "pinned_entry_id", "allow_receipts", "allow_site_announcements", "theme", "karma", "announcement_read") VALUES ('pbkdf2_sha256$260000$GKgMQfqwCgEElegEhAcFRu$SvcXT5zHQVjCsgYKqYhfstVy93vVAJkTV9sNXUIhP5Y=', NULL, false, '', '', false, '2021-12-28T18:21:29.130384+00:00'::timestamptz, 'anonymous', 'anonymous-1', 'private@example.com', true, false, 'AP', NULL, NULL, 0, NULL, false, true, true, NULL, 'NO', 10, 50, 'DS', NULL, true, true, 'light', 0, '2021-12-28T18:21:29.224311+00:00'::timestamptz) RETURNING "dictionary_author"."id" sozluk_dev_backend | Hata: Bu isimle bir kullanıcı zaten oluşturulmuş veya e-posta adresi kullanımda.

realsuayip commented 2 years ago

hi, the entrypoint script of dev docker setup creates some predefined users, if you start the script again it tries to do that again and fails as those are already created. you may ignore them in dev, it's not a big deal at all.

alimkoca commented 2 years ago

I'm not sure about topic, is it uses command "CREATE TABLE USERS without "IF NOT EXISTS"?

alimkoca commented 2 years ago

Also, it's prevents installation but I don't know main reason.

realsuayip commented 2 years ago

no, tables are created at that point, it tries to create a user instance that already exists. as I said, shouldn't be a problem; it can be ignored.