• Members 1 post
    May 7, 2023, 8:40 a.m.

    Hi, I am following the guide and setup server on Digital Oceam. Duirn the step ./appctl setup, following error shows up. Any idea how to solve it or configure database before setup?

    Creating misago_docker_misago_run ... done
    
    354 static files copied to '/misago/static', 1 unmodified, 411 post-processed.
    Creating misago_docker_misago_run ... done
    Migrating database
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
        self.connect()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 200, in connect
        self.connection = self.get_new_connection(conn_params)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
        connection = Database.connect(**conn_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    psycopg2.OperationalError: FATAL:  password authentication failed for user "misago_8NT5X6JBkK4UrMbG"
    
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/misago/manage.py", line 23, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
        utility.execute()
      File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
        output = self.handle(*args, **options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 89, in wrapped
        res = handle_func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 75, in handle
        self.check(databases=[database])
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 419, in check
        all_issues = checks.run_checks(
                     ^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/core/checks/registry.py", line 76, in run_checks
        new_errors = check(app_configs=app_configs, databases=databases)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/core/checks/model_checks.py", line 34, in check_all_models
        errors.extend(model.check(**kwargs))
                      ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 1303, in check
        *cls._check_indexes(databases),
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 1695, in _check_indexes
        connection.features.supports_covering_indexes or
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 48, in __get__
        res = instance.__dict__[self.name] = self.func(instance)
                                             ^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/features.py", line 92, in is_postgresql_11
        return self.connection.pg_version >= 110000
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 48, in __get__
        res = instance.__dict__[self.name] = self.func(instance)
                                             ^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 329, in pg_version
        with self.temporary_connection():
      File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
        return next(self.gen)
               ^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 603, in temporary_connection
        with self.cursor() as cursor:
             ^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 259, in cursor
        return self._cursor()
               ^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 235, in _cursor
        self.ensure_connection()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 218, in ensure_connection
        with self.wrap_database_errors:
      File "/usr/local/lib/python3.11/site-packages/django/db/utils.py", line 90, in __exit__
        raise dj_exc_value.with_traceback(traceback) from exc_value
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
        self.connect()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 200, in connect
        self.connection = self.get_new_connection(conn_params)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
        connection = Database.connect(**conn_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    django.db.utils.OperationalError: FATAL:  password authentication failed for user "misago_8NT5X6JBkK4UrMbG"
    
    Loading default avatar gallery
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
        self.connect()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 200, in connect
        self.connection = self.get_new_connection(conn_params)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
        connection = Database.connect(**conn_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    psycopg2.OperationalError: FATAL:  password authentication failed for user "misago_8NT5X6JBkK4UrMbG"
    
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/misago/manage.py", line 23, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
        utility.execute()
      File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
        output = self.handle(*args, **options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/misago/users/management/commands/loadavatargallery.py", line 13, in handle
        for avatar in AvatarGallery.objects.all():
      File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 280, in __iter__
        self._fetch_all()
      File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 1324, in _fetch_all
        self._result_cache = list(self._iterable_class(self))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 51, in __iter__
        results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
        cursor = self.connection.cursor()
                 ^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 259, in cursor
        return self._cursor()
               ^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 235, in _cursor
        self.ensure_connection()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 218, in ensure_connection
        with self.wrap_database_errors:
      File "/usr/local/lib/python3.11/site-packages/django/db/utils.py", line 90, in __exit__
        raise dj_exc_value.with_traceback(traceback) from exc_value
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
        self.connect()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 200, in connect
        self.connection = self.get_new_connection(conn_params)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
        connection = Database.connect(**conn_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    django.db.utils.OperationalError: FATAL:  password authentication failed for user "misago_8NT5X6JBkK4UrMbG"
    
    Creating first superuser account
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
        self.connect()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 200, in connect
        self.connection = self.get_new_connection(conn_params)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
        connection = Database.connect(**conn_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    psycopg2.OperationalError: FATAL:  password authentication failed for user "misago_8NT5X6JBkK4UrMbG"
    
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/misago/manage.py", line 23, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
        utility.execute()
      File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/usr/local/lib/python3.11/site-packages/misago/users/management/commands/createsuperuser.py", line 73, in execute
        return super().execute(*args, **options)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
        output = self.handle(*args, **options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/misago/users/management/commands/createsuperuser.py", line 84, in handle
        settings = get_dynamic_settings()
                   ^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/misago/conf/shortcuts.py", line 6, in get_dynamic_settings
        cache_versions = get_cache_versions()
                         ^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/misago/cache/versions.py", line 7, in get_cache_versions
        return {i.cache: i.version for i in queryset}
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 280, in __iter__
        self._fetch_all()
      File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 1324, in _fetch_all
        self._result_cache = list(self._iterable_class(self))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 51, in __iter__
        results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
        cursor = self.connection.cursor()
                 ^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 259, in cursor
        return self._cursor()
               ^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 235, in _cursor
        self.ensure_connection()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 218, in ensure_connection
        with self.wrap_database_errors:
      File "/usr/local/lib/python3.11/site-packages/django/db/utils.py", line 90, in __exit__
        raise dj_exc_value.with_traceback(traceback) from exc_value
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
        self.connect()
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 200, in connect
        self.connection = self.get_new_connection(conn_params)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 33, in inner
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
        connection = Database.connect(**conn_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    django.db.utils.OperationalError: FATAL:  password authentication failed for user "misago_8NT5X6JBkK4UrMbG"
    
    ERROR: 1
    Recreating misago_docker_postgres_1 ... 
    Recreating misago_docker_postgres_1    ... done
    Recreating misago_docker_nginx-proxy_1   ... done
    Recreating misago_docker_misago-celery_1 ... 
    Recreating misago_docker_misago-celery_1 ... done
    Recreating misago_docker_misago_1        ... done
    Setup completed.
    If you have already pointed a domain at this server, you can now visit it to access your Misago site.
    Please note that it may take up to few minutes for HTTPS to activate.
    

  • May 7, 2023, 1:06 p.m.

    Hello,

    There's apparently a bug in Docker PostgreSQL image where it sometimes fails to setup database correctly.

    When this happens recommended approach is to remove env files from config directory and then prune docker before trying again:

    docker-compose stop
    docker-compose down
    docker system prune --all --volumes -f
    

    I should add this to guide and/or readme, or see if there’s way to handle this in appctl directly.

  • arrow_forward

    Thread has been moved from Bug reports.