JSv4 / Delphic

Starter App to Build Your Own App to Query Doc Collections with Large Language Models (LLMs) using LlamaIndex, Langchain, OpenAI and more (MIT Licensed)
MIT License
303 stars 55 forks source link

Docker image fails to start #16

Open nahojjjen opened 1 year ago

nahojjjen commented 1 year ago

Hi, thanks for the project, it looks very interesting. Unfortunately I ran into some issues when trying to install it. I followed the instructions, but I am on a windows 10 computer. My googling did not help me solve this issue, I apologize if I'm doing something wrong with docker, I'm a docker novice.

I get the following error log when running the docker up command:

docker-compose --profile fullstack -f local.yml up [+] Running 7/7 ✔ Container chat_all_the_docs_local_redis Created 0.0s ✔ Container chat_all_the_docs_local_postgres Recreated 0.2s ✔ Container chat_all_the_docs_local_celeryworker Recreated 0.2s ✔ Container delphic_local_django Recreated 0.2s ✔ Container chat_all_the_docs_local_celerybeat Recreated 0.2s ✔ Container chat_all_the_docs_local_flower Recreated 0.2s ✔ Container delphic_local_frontend Recreated 0.1s Attaching to chat_all_the_docs_local_celerybeat, chat_all_the_docs_local_celeryworker, chat_all_the_docs_local_flower, chat_all_the_docs_local_postgres, chat_all_the_docs_local_redis, delphic_local_django, delphic_local_frontend chat_all_the_docs_local_postgres | chat_all_the_docs_local_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization chat_all_the_docs_local_postgres | chat_all_the_docs_local_postgres | 2023-04-22 19:41:13.462 UTC [1] LOG: starting PostgreSQL 14.7 (Debian 14.7-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit chat_all_the_docs_local_postgres | 2023-04-22 19:41:13.479 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 chat_all_the_docs_local_postgres | 2023-04-22 19:41:13.479 UTC [1] LOG: listening on IPv6 address "::", port 5432 chat_all_the_docs_local_postgres | 2023-04-22 19:41:13.483 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" chat_all_the_docs_local_postgres | 2023-04-22 19:41:13.493 UTC [27] LOG: database system was shut down at 2023-04-22 19:40:57 UTC chat_all_the_docs_local_postgres | 2023-04-22 19:41:13.498 UTC [1] LOG: database system is ready to accept connections chat_all_the_docs_local_redis | 1:C 22 Apr 2023 19:41:13.539 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo chat_all_the_docs_local_redis | 1:C 22 Apr 2023 19:41:13.539 # Redis version=6.2.12, bits=64, commit=00000000, modified=0, pid=1, just started chat_all_the_docs_local_redis | 1:C 22 Apr 2023 19:41:13.539 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.540 monotonic clock: POSIX clock_gettime chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.540 Running mode=standalone, port=6379. chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.540 # Server initialized chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.540 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.541 Loading RDB produced by version 6.2.12 chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.541 RDB age 16 seconds chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.541 RDB memory usage when created 0.77 Mb chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.541 # Done loading RDB, keys loaded: 0, keys expired: 0. chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.541 DB loaded from disk: 0.000 seconds chat_all_the_docs_local_redis | 1:M 22 Apr 2023 19:41:13.541 Ready to accept connections chat_all_the_docs_local_celerybeat | PostgreSQL is available chat_all_the_docs_local_celeryworker | PostgreSQL is available chat_all_the_docs_local_flower | PostgreSQL is available chat_all_the_docs_local_celerybeat | [19:41:14] watchfiles v0.19.0 👀 path="/app" target="celery.main.main" (function) filter=DefaultFilter... delphic_local_django | PostgreSQL is available delphic_local_frontend | /bin/sh: /usr/share/nginx/html/env.sh: not found chat_all_the_docs_local_flower | [19:41:15] watchfiles v0.19.0 👀 path="/app" target="celery.main.main" (function) filter=DefaultFilter... delphic_local_frontend exited with code 127 chat_all_the_docs_local_celeryworker | Traceback (most recent call last): chat_all_the_docs_local_celeryworker | File "/usr/local/bin/celery", line 8, in chat_all_the_docs_local_celeryworker | sys.exit(main()) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/main.py", line 15, in main chat_all_the_docs_local_celeryworker | sys.exit(_main()) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/bin/celery.py", line 217, in main chat_all_the_docs_local_celeryworker | return celery(auto_envvar_prefix="CELERY") chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call chat_all_the_docs_local_celeryworker | return self.main(args, kwargs) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main chat_all_the_docs_local_celeryworker | rv = self.invoke(ctx) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1655, in invoke chat_all_the_docs_local_celeryworker | sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 920, in make_context chat_all_the_docs_local_celeryworker | self.parse_args(ctx, args) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1378, in parse_args chat_all_the_docs_local_celeryworker | value, args = param.handle_parse_result(ctx, opts, args) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2360, in handle_parse_result chat_all_the_docs_local_celeryworker | value = self.process_value(ctx, value) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2322, in process_value chat_all_the_docs_local_celeryworker | value = self.callback(ctx, self, value) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/bin/worker.py", line 160, in chat_all_the_docs_local_celeryworker | value: value or ctx.obj.app.conf.worker_state_db, chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 112, in getattr chat_all_the_docs_local_celeryworker | return self[k] chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 392, in getitem chat_all_the_docs_local_celeryworker | return getitem(k) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 250, in getitem chat_all_the_docs_local_celeryworker | return mapping[_key] chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/collections/init.py", line 1102, in getitem chat_all_the_docs_local_celeryworker | if key in self.data: chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/kombu/utils/objects.py", line 30, in get chat_all_the_docs_local_celeryworker | return super().get(instance, owner) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/functools.py", line 981, in get chat_all_the_docs_local_celeryworker | val = self.func(instance) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 138, in data chat_all_the_docs_local_celeryworker | return self.callback() chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 967, in _finalize_pending_conf chat_all_the_docs_local_celeryworker | conf = self._conf = self._load_config() chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 977, in _load_config chat_all_the_docs_local_celeryworker | self.loader.config_from_object(self._config_source) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/loaders/base.py", line 128, in config_from_object chat_all_the_docs_local_celeryworker | self._conf = force_mapping(obj) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 43, in force_mapping chat_all_the_docs_local_celeryworker | if isinstance(m, (LazyObject, LazySettings)): chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 295, in getattribute chat_all_the_docs_local_celeryworker | value = super().getattribute(name) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 266, in inner chat_all_the_docs_local_celeryworker | self._setup() chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 79, in _setup chat_all_the_docs_local_celeryworker | self._wrapped = Settings(settings_module) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 190, in init chat_all_the_docs_local_celeryworker | mod = importlib.import_module(self.SETTINGS_MODULE) chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module chat_all_the_docs_local_celeryworker | return _bootstrap._gcd_import(name[level:], package, level) chat_all_the_docs_local_celeryworker | File "", line 1050, in _gcd_import chat_all_the_docs_local_celeryworker | File "", line 1027, in _find_and_load chat_all_the_docs_local_celeryworker | File "", line 1006, in _find_and_load_unlocked chat_all_the_docs_local_celeryworker | File "", line 688, in _load_unlocked chat_all_the_docs_local_celeryworker | File "", line 883, in exec_module chat_all_the_docs_local_celeryworker | File "", line 241, in _call_with_frames_removed chat_all_the_docs_local_celeryworker | File "/app/config/settings/local.py", line 1, in chat_all_the_docs_local_celeryworker | from .base import # noqa chat_all_the_docs_local_celeryworker | File "/app/config/settings/base.py", line 43, in chat_all_the_docs_local_celeryworker | DATABASES = {"default": env.db("DATABASE_URL")} chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 294, in db_url chat_all_the_docs_local_celeryworker | return self.db_url_config( chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 552, in db_url_config chat_all_the_docs_local_celeryworker | port = url.port chat_all_the_docs_local_celeryworker | File "/usr/local/lib/python3.10/urllib/parse.py", line 177, in port chat_all_the_docs_local_celeryworker | raise ValueError(f"Port could not be cast to integer value as {port!r}") chat_all_the_docs_local_celeryworker | ValueError: Port could not be cast to integer value as '7Ff9A5JvzgJ9' delphic_local_django | Traceback (most recent call last): delphic_local_django | File "/app/manage.py", line 31, in delphic_local_django | execute_from_command_line(sys.argv) delphic_local_django | File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line delphic_local_django | utility.execute() delphic_local_django | File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 386, in execute delphic_local_django | settings.INSTALLED_APPS delphic_local_django | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 92, in getattr delphic_local_django | self._setup(name) delphic_local_django | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 79, in _setup delphic_local_django | self._wrapped = Settings(settings_module) delphic_local_django | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 190, in init delphic_local_django | mod = importlib.import_module(self.SETTINGS_MODULE) delphic_local_django | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module delphic_local_django | return _bootstrap._gcd_import(name[level:], package, level) delphic_local_django | File "", line 1050, in _gcd_import delphic_local_django | File "", line 1027, in _find_and_load delphic_local_django | File "", line 1006, in _find_and_load_unlocked delphic_local_django | File "", line 688, in _load_unlocked delphic_local_django | File "", line 883, in exec_module delphic_local_django | File "", line 241, in _call_with_frames_removed delphic_local_django | File "/app/config/settings/local.py", line 1, in delphic_local_django | from .base import # noqa delphic_local_django | File "/app/config/settings/base.py", line 43, in delphic_local_django | DATABASES = {"default": env.db("DATABASE_URL")} delphic_local_django | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 294, in db_url delphic_local_django | return self.db_url_config( delphic_local_django | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 552, in db_url_config delphic_local_django | port = url.port delphic_local_django | File "/usr/local/lib/python3.10/urllib/parse.py", line 177, in port delphic_local_django | raise ValueError(f"Port could not be cast to integer value as {port!r}") delphic_local_django | ValueError: Port could not be cast to integer value as '7Ff9A5JvzgJ9' chat_all_the_docs_local_celeryworker exited with code 1 chat_all_the_docs_local_celerybeat | Process SpawnProcess-1: chat_all_the_docs_local_celerybeat | Traceback (most recent call last): chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/watchfiles/run.py", line 394, in set_tty chat_all_the_docs_local_celerybeat | with open(tty_path) as tty: # pragma: no cover chat_all_the_docs_local_celerybeat | OSError: [Errno 6] No such device or address: '/dev/tty' chat_all_the_docs_local_celerybeat | chat_all_the_docs_local_celerybeat | During handling of the above exception, another exception occurred: chat_all_the_docs_local_celerybeat | chat_all_the_docs_local_celerybeat | Traceback (most recent call last): chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap chat_all_the_docs_local_celerybeat | self.run() chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run chat_all_the_docs_local_celerybeat | self._target(*self._args, *self._kwargs) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/watchfiles/run.py", line 354, in run_function chat_all_the_docs_local_celerybeat | func(args, kwargs) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/main.py", line 15, in main chat_all_the_docs_local_celerybeat | sys.exit(_main()) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/bin/celery.py", line 217, in main chat_all_the_docs_local_celerybeat | return celery(auto_envvar_prefix="CELERY") chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call chat_all_the_docs_local_celerybeat | return self.main(*args, kwargs) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main chat_all_the_docs_local_celerybeat | rv = self.invoke(ctx) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1655, in invoke chat_all_the_docs_local_celerybeat | sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 920, in make_context chat_all_the_docs_local_celerybeat | self.parse_args(ctx, args) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1378, in parse_args chat_all_the_docs_local_celerybeat | value, args = param.handle_parse_result(ctx, opts, args) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2360, in handle_parse_result chat_all_the_docs_local_celerybeat | value = self.process_value(ctx, value) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2322, in process_value chat_all_the_docs_local_celerybeat | value = self.callback(ctx, self, value) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/bin/beat.py", line 23, in chat_all_the_docs_localcelerybeat | callback=lambda ctx, , value: value or ctx.obj.app.conf.beat_schedule_filename, chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 112, in getattr chat_all_the_docs_local_celerybeat | return self[k] chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 392, in getitem chat_all_the_docs_local_celerybeat | return getitem(k) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 250, in getitem chat_all_the_docs_local_celerybeat | return mapping[_key] chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/collections/init.py", line 1102, in getitem chat_all_the_docs_local_celerybeat | if key in self.data: chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/kombu/utils/objects.py", line 30, in get chat_all_the_docs_local_celerybeat | return super().get(instance, owner) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/functools.py", line 981, in get chat_all_the_docs_local_celerybeat | val = self.func(instance) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 138, in data chat_all_the_docs_local_celerybeat | return self.callback() chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 967, in _finalize_pending_conf chat_all_the_docs_local_celerybeat | conf = self._conf = self._load_config() chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 977, in _load_config chat_all_the_docs_local_celerybeat | self.loader.config_from_object(self._config_source) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/loaders/base.py", line 128, in config_from_object chat_all_the_docs_local_celerybeat | self._conf = force_mapping(obj) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 43, in force_mapping chat_all_the_docs_local_celerybeat | if isinstance(m, (LazyObject, LazySettings)): chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 295, in getattribute chat_all_the_docs_local_celerybeat | value = super().getattribute(name) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 266, in inner chat_all_the_docs_local_celerybeat | self._setup() chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 79, in _setup chat_all_the_docs_local_celerybeat | self._wrapped = Settings(settings_module) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 190, in init chat_all_the_docs_local_celerybeat | mod = importlib.import_module(self.SETTINGS_MODULE) chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module chat_all_the_docs_local_celerybeat | return _bootstrap._gcd_import(name[level:], package, level) chat_all_the_docs_local_celerybeat | File "", line 1050, in _gcd_import chat_all_the_docs_local_celerybeat | File "", line 1027, in _find_and_load chat_all_the_docs_local_celerybeat | File "", line 1006, in _find_and_load_unlocked chat_all_the_docs_local_celerybeat | File "", line 688, in _load_unlocked chat_all_the_docs_local_celerybeat | File "", line 883, in exec_module chat_all_the_docs_local_celerybeat | File "", line 241, in _call_with_frames_removed chat_all_the_docs_local_celerybeat | File "/app/config/settings/local.py", line 1, in chat_all_the_docs_local_celerybeat | from .base import * # noqa chat_all_the_docs_local_celerybeat | File "/app/config/settings/base.py", line 43, in chat_all_the_docs_local_celerybeat | DATABASES = {"default": env.db("DATABASE_URL")} chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 294, in db_url chat_all_the_docs_local_celerybeat | return self.db_url_config( chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 552, in db_url_config chat_all_the_docs_local_celerybeat | port = url.port chat_all_the_docs_local_celerybeat | File "/usr/local/lib/python3.10/urllib/parse.py", line 177, in port chat_all_the_docs_local_celerybeat | raise ValueError(f"Port could not be cast to integer value as {port!r}") chat_all_the_docs_local_celerybeat | ValueError: Port could not be cast to integer value as '7Ff9A5JvzgJ9' delphic_local_django exited with code 1 chat_all_the_docs_local_flower | [E 230422 19:41:17 signal:280] Signal handler <bound method DjangoFixup.on_import_modules of <celery.fixups.django.DjangoFixup object at 0x7f544c176b60>> raised: ValueError("Port could not be cast to integer value as '7Ff9A5JvzgJ9'") chat_all_the_docs_local_flower | Traceback (most recent call last): chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/dispatch/signal.py", line 276, in send chat_all_the_docs_local_flower | response = receiver(signal=self, sender=sender, *named) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 82, in on_import_modules chat_all_the_docs_local_flower | self.worker_fixup.validate_models() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 73, in worker_fixup chat_all_the_docs_local_flower | self._worker_fixup = DjangoWorkerFixup(self.app) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 104, in init chat_all_the_docs_local_flower | self.db_reuse_max = self.app.conf.get('CELERY_DB_REUSE_MAX', None) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 415, in get chat_all_the_docs_local_flower | return self[key] chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 392, in getitem chat_all_the_docs_local_flower | return getitem(k) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 250, in getitem chat_all_the_docs_local_flower | return mapping[_key] chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/collections/init.py", line 1102, in getitem chat_all_the_docs_local_flower | if key in self.data: chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/kombu/utils/objects.py", line 30, in get chat_all_the_docs_local_flower | return super().get(instance, owner) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/functools.py", line 981, in get chat_all_the_docs_local_flower | val = self.func(instance) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 138, in data chat_all_the_docs_local_flower | return self.callback() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 967, in _finalize_pending_conf chat_all_the_docs_local_flower | conf = self._conf = self._load_config() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 977, in _load_config chat_all_the_docs_local_flower | self.loader.config_from_object(self._config_source) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/loaders/base.py", line 128, in config_from_object chat_all_the_docs_local_flower | self._conf = force_mapping(obj) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 43, in force_mapping chat_all_the_docs_local_flower | if isinstance(m, (LazyObject, LazySettings)): chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 295, in getattribute chat_all_the_docs_local_flower | value = super().getattribute(name) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 266, in inner chat_all_the_docs_local_flower | self._setup() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 79, in _setup chat_all_the_docs_local_flower | self._wrapped = Settings(settings_module) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 190, in init chat_all_the_docs_local_flower | mod = importlib.import_module(self.SETTINGS_MODULE) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module chat_all_the_docs_local_flower | return _bootstrap._gcd_import(name[level:], package, level) chat_all_the_docs_local_flower | File "", line 1050, in _gcd_import chat_all_the_docs_local_flower | File "", line 1027, in _find_and_load chat_all_the_docs_local_flower | File "", line 1006, in _find_and_load_unlocked chat_all_the_docs_local_flower | File "", line 688, in _load_unlocked chat_all_the_docs_local_flower | File "", line 883, in exec_module chat_all_the_docs_local_flower | File "", line 241, in _call_with_frames_removed chat_all_the_docs_local_flower | File "/app/config/settings/local.py", line 1, in chat_all_the_docs_local_flower | from .base import # noqa chat_all_the_docs_local_flower | File "/app/config/settings/base.py", line 43, in chat_all_the_docs_local_flower | DATABASES = {"default": env.db("DATABASE_URL")} chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 294, in db_url chat_all_the_docs_local_flower | return self.db_url_config( chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 552, in db_url_config chat_all_the_docs_local_flower | port = url.port chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/urllib/parse.py", line 177, in port chat_all_the_docs_local_flower | raise ValueError(f"Port could not be cast to integer value as {port!r}") chat_all_the_docs_local_flower | ValueError: Port could not be cast to integer value as '7Ff9A5JvzgJ9' chat_all_the_docs_local_flower | [E 230422 19:41:17 signal:280] Signal handler <promise@0x7f544c09c160 --> <bound method Celery._autodiscover_tasks of <Celery delphic at 0x7f544c176950>>> raised: ValueError("Port could not be cast to integer value as '7Ff9A5JvzgJ9'") chat_all_the_docs_local_flower | Traceback (most recent call last): chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/dispatch/signal.py", line 276, in send chat_all_the_docs_local_flower | response = receiver(signal=self, sender=sender, named) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/vine/promises.py", line 160, in call chat_all_the_docs_local_flower | return self.throw() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/vine/promises.py", line 157, in call chat_all_the_docs_local_flower | retval = fun(*final_args, final_kwargs) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 689, in _autodiscover_tasks chat_all_the_docs_local_flower | return self._autodiscover_tasks_from_fixups(related_name) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 698, in _autodiscover_tasks_from_fixups chat_all_the_docs_local_flower | return self._autodiscover_tasks_from_names([ chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 701, in chat_all_the_docs_local_flower | for pkg in fixup.autodiscover_tasks() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 92, in autodiscover_tasks chat_all_the_docs_local_flower | return [config.name for config in apps.get_app_configs()] chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/apps/registry.py", line 147, in get_app_configs chat_all_the_docs_local_flower | self.check_apps_ready() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/apps/registry.py", line 137, in check_apps_ready chat_all_the_docs_local_flower | settings.INSTALLED_APPS chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 92, in getattr chat_all_the_docs_local_flower | self._setup(name) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 79, in _setup chat_all_the_docs_local_flower | self._wrapped = Settings(settings_module) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 190, in init chat_all_the_docs_local_flower | mod = importlib.import_module(self.SETTINGS_MODULE) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module chat_all_the_docs_local_flower | return _bootstrap._gcd_import(name[level:], package, level) chat_all_the_docs_local_flower | File "", line 1050, in _gcd_import chat_all_the_docs_local_flower | File "", line 1027, in _find_and_load chat_all_the_docs_local_flower | File "", line 1006, in _find_and_load_unlocked chat_all_the_docs_local_flower | File "", line 688, in _load_unlocked chat_all_the_docs_local_flower | File "", line 883, in exec_module chat_all_the_docs_local_flower | File "", line 241, in _call_with_frames_removed chat_all_the_docs_local_flower | File "/app/config/settings/local.py", line 1, in chat_all_the_docs_local_flower | from .base import # noqa chat_all_the_docs_local_flower | File "/app/config/settings/base.py", line 43, in chat_all_the_docs_local_flower | DATABASES = {"default": env.db("DATABASE_URL")} chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 294, in db_url chat_all_the_docs_local_flower | return self.db_url_config( chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 552, in db_url_config chat_all_the_docs_local_flower | port = url.port chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/urllib/parse.py", line 177, in port chat_all_the_docs_local_flower | raise ValueError(f"Port could not be cast to integer value as {port!r}") chat_all_the_docs_local_flower | ValueError: Port could not be cast to integer value as '7Ff9A5JvzgJ9' chat_all_the_docs_local_flower | Process SpawnProcess-1: chat_all_the_docs_local_flower | Traceback (most recent call last): chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/watchfiles/run.py", line 394, in set_tty chat_all_the_docs_local_flower | with open(tty_path) as tty: # pragma: no cover chat_all_the_docs_local_flower | OSError: [Errno 6] No such device or address: '/dev/tty' chat_all_the_docs_local_flower | chat_all_the_docs_local_flower | During handling of the above exception, another exception occurred: chat_all_the_docs_local_flower | chat_all_the_docs_local_flower | Traceback (most recent call last): chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap chat_all_the_docs_local_flower | self.run() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run chat_all_the_docs_local_flower | self._target(self._args, self._kwargs) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/watchfiles/run.py", line 354, in run_function chat_all_the_docs_local_flower | func(*args, kwargs) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/main.py", line 15, in main chat_all_the_docs_local_flower | sys.exit(_main()) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/bin/celery.py", line 217, in main chat_all_the_docs_local_flower | return celery(auto_envvar_prefix="CELERY") chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call chat_all_the_docs_local_flower | return self.main(args, kwargs) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main chat_all_the_docs_local_flower | rv = self.invoke(ctx) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke chat_all_the_docs_local_flower | return _process_result(sub_ctx.command.invoke(sub_ctx)) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke chat_all_the_docs_local_flower | return ctx.invoke(self.callback, ctx.params) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke chat_all_the_docs_local_flower | return __callback(args, kwargs) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func chat_all_the_docs_local_flower | return f(get_current_context(), *args, kwargs) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/flower/command.py", line 43, in flower chat_all_the_docs_local_flower | flower = Flower(capp=app, options=options, settings) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/flower/app.py", line 55, in init chat_all_the_docs_local_flower | self.capp.loader.import_default_modules() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/loaders/base.py", line 105, in import_default_modules chat_all_the_docs_local_flower | raise response chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/dispatch/signal.py", line 276, in send chat_all_the_docs_local_flower | response = receiver(signal=self, sender=sender, *named) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 82, in on_import_modules chat_all_the_docs_local_flower | self.worker_fixup.validate_models() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 73, in worker_fixup chat_all_the_docs_local_flower | self._worker_fixup = DjangoWorkerFixup(self.app) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 104, in init chat_all_the_docs_local_flower | self.db_reuse_max = self.app.conf.get('CELERY_DB_REUSE_MAX', None) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 415, in get chat_all_the_docs_local_flower | return self[key] chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 392, in getitem chat_all_the_docs_local_flower | return getitem(k) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 250, in getitem chat_all_the_docs_local_flower | return mapping[_key] chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/collections/init.py", line 1102, in getitem chat_all_the_docs_local_flower | if key in self.data: chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/kombu/utils/objects.py", line 30, in get chat_all_the_docs_local_flower | return super().get(instance, owner) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/functools.py", line 981, in get chat_all_the_docs_local_flower | val = self.func(instance) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 138, in data chat_all_the_docs_local_flower | return self.callback() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 967, in _finalize_pending_conf chat_all_the_docs_local_flower | conf = self._conf = self._load_config() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 977, in _load_config chat_all_the_docs_local_flower | self.loader.config_from_object(self._config_source) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/loaders/base.py", line 128, in config_from_object chat_all_the_docs_local_flower | self._conf = force_mapping(obj) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/celery/utils/collections.py", line 43, in force_mapping chat_all_the_docs_local_flower | if isinstance(m, (LazyObject, LazySettings)): chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 295, in getattribute chat_all_the_docs_local_flower | value = super().getattribute(name) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 266, in inner chat_all_the_docs_local_flower | self._setup() chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 79, in _setup chat_all_the_docs_local_flower | self._wrapped = Settings(settings_module) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 190, in init chat_all_the_docs_local_flower | mod = importlib.import_module(self.SETTINGS_MODULE) chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module chat_all_the_docs_local_flower | return _bootstrap._gcd_import(name[level:], package, level) chat_all_the_docs_local_flower | File "", line 1050, in _gcd_import chat_all_the_docs_local_flower | File "", line 1027, in _find_and_load chat_all_the_docs_local_flower | File "", line 1006, in _find_and_load_unlocked chat_all_the_docs_local_flower | File "", line 688, in _load_unlocked chat_all_the_docs_local_flower | File "", line 883, in exec_module chat_all_the_docs_local_flower | File "", line 241, in _call_with_frames_removed chat_all_the_docs_local_flower | File "/app/config/settings/local.py", line 1, in chat_all_the_docs_local_flower | from .base import # noqa chat_all_the_docs_local_flower | File "/app/config/settings/base.py", line 43, in chat_all_the_docs_local_flower | DATABASES = {"default": env.db("DATABASE_URL")} chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 294, in db_url chat_all_the_docs_local_flower | return self.db_url_config( chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/site-packages/environ/environ.py", line 552, in db_url_config chat_all_the_docs_local_flower | port = url.port chat_all_the_docs_local_flower | File "/usr/local/lib/python3.10/urllib/parse.py", line 177, in port chat_all_the_docs_local_flower | raise ValueError(f"Port could not be cast to integer value as {port!r}") chat_all_the_docs_local_flower | ValueError: Port could not be cast to integer value as '7Ff9A5JvzgJ9'

I've placed the .drango and .postgress files in .envs/.local: image and input my openai api key (censored): image

and the .frontend in /frontend image

Thanks in advance for any help / suggestions

JSv4 commented 1 year ago

Hey @nahojjjen, glad you like the project and thanks for giving it a shot. I noticed that the error message appears to be related to the container attempting to start with a port of "7Ff9A5JvzgJ9". Possibly something in your docker compose file or Dockerfiles got changed?

Have you modified any of the docker-compose or docker files? Can you share those?

nahojjjen commented 1 year ago

I have not knowingly changed any of the docker-compose or docker files. My git status shows only changes in .envs/.local/ and frontend/.frontend :

image

I'm not sure which docker files are relevant, so here's a copy of the entire project (minus the .git folder & removed my openai key): delphic_copy.zip

adhd commented 1 year ago

Having issues installing as well - followed the instructions to a T.

CleanShot 2023-04-24 at 17 25 47

JSv4 commented 1 year ago

Hey @adhd, I suspect this is also a docker configuration issue or perhaps a VPN or firewall. What is your system env? Is this a work machine (with VPN, endpoint protection, etc,)?

Check out some tips on troubleshooting your Docker setup here: https://stackoverflow.com/questions/66912085/why-is-docker-compose-failing-with-error-internal-load-metadata-suddenly

If that fails, it seems it could be related to your docker settings - see here: https://github.com/docker/buildx/issues/426

Let me know if any of these work for you.

adhd commented 1 year ago

@JSv4 appreciate the quick reply on this! I ended up trying again on a personal machine (macOS, up to date, fresh install of Docker). Pulled all the required image, and attempted to run sudo docker-compose -f local.yml run django python manage.py createsuperuser to attempt making a superuser. It successfully prompts me for a username, but when I hit enter, I get the following error message. I've tried a little soft troubleshooting on my end, to no avail. Any suggestions for a fix (re: settings.DATABASES)

~/Documents/delphic ⇢ main ! ❯ sudo docker-compose -f local.yml run django python manage.py createsuperuser 130 ↵

[+] Running 2/2 ✔ Container delphic_local_redis Created 0.0s ✔ Container delphic_local_postgres Recreated 0.1s [+] Running 2/2 ✔ Container delphic_local_redis Started 0.3s ✔ Container delphic_local_postgres Started 0.3s PostgreSQL is available APPS DIR: /app/delphic INFO 2023-04-24 21:43:32,858 utils 1 281472885955904 NumExpr defaulting to 4 threads. Username: admin Traceback (most recent call last): File "/app/manage.py", line 31, in execute_from_command_line(sys.argv) File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, cmd_options) File "/usr/local/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute return super().execute(*args, *options) File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(args, options) File "/usr/local/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 130, in handle error_msg = self._validate_username( File "/usr/local/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 297, in _validate_username self.UserModel._default_manager.db_manager(database).get_by_natural_key( File "/usr/local/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 47, in get_by_natural_key return self.get({self.model.USERNAME_FIELD: username}) File "/usr/local/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, *kwargs) File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 646, in get num = len(clone) File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 376, in len self._fetch_all() File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 1867, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 87, in iter results = compiler.execute_sql( File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1396, in execute_sql cursor = self.connection.cursor() File "/usr/local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(args, kwargs) File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 323, in cursor return self._cursor() File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 299, in _cursor self.ensure_connection() File "/usr/local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, *kwargs) File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection self.connect() File "/usr/local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(args, **kwargs) File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 262, in connect conn_params = self.get_connection_params() File "/usr/local/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 174, in get_connection_params raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME or OPTIONS['service'] value.

JSv4 commented 1 year ago

Thanks. What system environment are you in (Ubuntu?) Also, can you share the .postgres file in your .envs/.local/ directory?

MatthewKbaum commented 1 year ago

I had same issue and found a solution. If you're on Windows, you need to change the line ending format of frontend/env.sh from CRLF to LF. Github will keep auto reformatting it into CRLF so you may need to change your Github settings or disconnect your project from git.

JSv4 commented 1 year ago

Thanks, @MatthewKbaum. Really appreciate that. @adhd, are you running in WSL or somehow in a Windows env?

adhd commented 1 year ago

macOS @JSv4

Attempted changing CLRF to LF using sed -i '' 's/\r$//' frontend/env.sh, but still encountering the same issue.

.postgres file:

------------------------------------------------------------------------------

POSTGRES_HOST=postgres POSTGRES_PORT=5432 POSTGRES_DB=cookietest POSTGRES_USER=bbQXlhtKFPTMHhhCaplnwWQMFFpkTjpP POSTGRES_PASSWORD=MYOWNPASSWORD

JSv4 commented 1 year ago

Thanks @adhd. I am on Ubuntu, so a bit hard to fully troubleshoot on my end, but I have some thoughts. Can you also share your ./config/settings/base.py and ./config/settings/local.py files?

adhd commented 1 year ago

./config/settings/base.py

"""
Base settings to build other settings files upon.
"""
from pathlib import Path

import environ

BASE_DIR = Path(__file__).resolve(strict=True).parent.parent.parent

# delphic/
APPS_DIR = BASE_DIR / "delphic"
env = environ.Env()

READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
if READ_DOT_ENV_FILE:
    # OS environment variables take precedence over variables from .env
    env.read_env(str(BASE_DIR / ".env"))

# GENERAL
# ------------------------------------------------------------------------------
USE_AWS = env.bool("USE_AWS", False)
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = env.bool("DJANGO_DEBUG", False)
# Local time zone. Choices are
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# though not all of them may be available with every OS.
# In Windows, this must be set to your system time zone.
TIME_ZONE = "UTC"
# https://docs.djangoproject.com/en/dev/ref/settings/#language-code
LANGUAGE_CODE = "en-us"
# https://docs.djangoproject.com/en/dev/ref/settings/#site-id
SITE_ID = 1
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
USE_I18N = True
# https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
USE_TZ = True
# https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths
LOCALE_PATHS = [str(BASE_DIR / "locale")]

# DATABASES
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {"default": env.db("DATABASE_URL")}
# https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-DEFAULT_AUTO_FIELD
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

# URLS
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf
ROOT_URLCONF = "config.urls"
# https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
WSGI_APPLICATION = "config.wsgi.application"

# APPS
# ------------------------------------------------------------------------------
DJANGO_APPS = [
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.sites",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    # "django.contrib.humanize", # Handy template tags
    "django.contrib.admin",
    "django.forms",
]
THIRD_PARTY_APPS = [
    "channels",
    "ninja",
    "ninja_extra",
    "corsheaders",
    "django_celery_beat",
    "rest_framework",
    "rest_framework_api_key",
]

LOCAL_APPS = [
    "delphic.indexes",
    "delphic.users",
]
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS

# MIGRATIONS
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules
MIGRATION_MODULES = {"sites": "delphic.contrib.sites.migrations"}
# AUTHENTICATION
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#authentication-backends
AUTHENTICATION_BACKENDS = [
    "django.contrib.auth.backends.ModelBackend",
]
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-user-model
AUTH_USER_MODEL = "users.User"
# https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
LOGIN_REDIRECT_URL = "users:redirect"
# https://docs.djangoproject.com/en/dev/ref/settings/#login-url
LOGIN_URL = "account_login"

# PASSWORDS
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers
PASSWORD_HASHERS = [
    # https://docs.djangoproject.com/en/dev/topics/auth/passwords/#using-argon2-with-django
    "django.contrib.auth.hashers.Argon2PasswordHasher",
    "django.contrib.auth.hashers.PBKDF2PasswordHasher",
    "django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
    "django.contrib.auth.hashers.BCryptSHA256PasswordHasher",
]
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
    },
    {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
    {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
    {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]

# MIDDLEWARE
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
MIDDLEWARE = [
    "corsheaders.middleware.CorsMiddleware",
    "django.middleware.security.SecurityMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.locale.LocaleMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
]

# STATIC
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = str(BASE_DIR / "staticfiles")
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = [str(APPS_DIR / "static")]
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
STATICFILES_FINDERS = [
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
]

./config/settings/local.py

from .base import *  # noqa
from .base import env

# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
    "DJANGO_SECRET_KEY",
    default="pWahScrbZQLSKugZCroNzqo9MxfR0X1VFnykITFJmz6wjuoWcZXk176xr6rQLSsg",
)
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ["localhost", "localhost:8000", "0.0.0.0", "127.0.0.1"]

# CACHES
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = {
    "default": {
        "BACKEND": "django.core.cache.backends.locmem.LocMemCache",
        "LOCATION": "",
    }
}

# EMAIL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = env(
    "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend"
)

# django-debug-toolbar
# ------------------------------------------------------------------------------
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
INSTALLED_APPS += ["debug_toolbar"]  # noqa: F405
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]  # noqa: F405
# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
DEBUG_TOOLBAR_CONFIG = {
    "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
    "SHOW_TEMPLATE_CONTEXT": True,
}
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
if env("USE_DOCKER") == "yes":
    import socket

    hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
    INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]

# django-extensions
# ------------------------------------------------------------------------------
# https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration
INSTALLED_APPS += ["django_extensions"]  # noqa: F405
# Celery
# ------------------------------------------------------------------------------

# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-eager-propagates
CELERY_TASK_EAGER_PROPAGATES = True

# CORS (Dev Only)
# ------------------------------------------------------------------------------
CORS_ALLOW_ALL_ORIGINS = True

@JSv4

JSv4 commented 1 year ago

@adhd, did you change the postgres settings before or after you set up the application the first time? If it was after, then the database password and user are set to the old password. Try deleting and then rebuilding the stack (This will clear your database entirely):

sudo docker-compose -f local.yml down --volumes
sudo docker-compose -f local.yml build
sudo docker-compose -f local.yml up

If that's not it, really not sure what's up here.