Docker installation error: 'Role "mathesar" doesn't exist #4231
-
|
So here i am trying to install it on a ec2 with my config file having this data: i have verified this data and can log in using this mathesar user and gave it a superuser access too but still getting this error: mathesar_db | 2025-02-05 08:11:29.708 UTC [40] FATAL: role "mathesar" does not exist
mathesar_service | Traceback (most recent call last):
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
mathesar_service | self.connect()
mathesar_service | ~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner
mathesar_service | return func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 270, in connect
mathesar_service | self.connection = self.get_new_connection(conn_params)
mathesar_service | ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner
mathesar_service | return func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
mathesar_service | connection = self.Database.connect(**conn_params)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/psycopg/connection.py", line 98, in connect
mathesar_service | attempts = conninfo_attempts(params)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/psycopg/_conninfo_attempts.py", line 50, in conninfo_attempts
mathesar_service | raise e.OperationalError(str(last_exc))
mathesar_service | psycopg.OperationalError: [Errno -3] Temporary failure in name resolution
mathesar_service |
mathesar_service | The above exception was the direct cause of the following exception:
mathesar_service |
mathesar_service | Traceback (most recent call last):
mathesar_service | File "<frozen runpy>", line 198, in _run_module_as_main
mathesar_service | File "<frozen runpy>", line 88, in _run_code
mathesar_service | File "/code/mathesar/install.py", line 21, in <module>
mathesar_service | main()
mathesar_service | ~~~~^^
mathesar_service | File "/code/mathesar/install.py", line 13, in main
mathesar_service | management.call_command('migrate')
mathesar_service | ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 194, in call_command
mathesar_service | return command.execute(*args, **defaults)
mathesar_service | ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 458, in execute
mathesar_service | output = self.handle(*args, **options)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 106, in wrapper
mathesar_service | res = handle_func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/core/management/commands/migrate.py", line 117, in handle
mathesar_service | executor = MigrationExecutor(connection, self.migration_progress_callback)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/migrations/executor.py", line 18, in __init__
mathesar_service | self.loader = MigrationLoader(self.connection)
mathesar_service | ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/migrations/loader.py", line 58, in __init__
mathesar_service | self.build_graph()
mathesar_service | ~~~~~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/migrations/loader.py", line 235, in build_graph
mathesar_service | self.applied_migrations = recorder.applied_migrations()
mathesar_service | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
mathesar_service | if self.has_table():
mathesar_service | ~~~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/migrations/recorder.py", line 57, in has_table
mathesar_service | with self.connection.cursor() as cursor:
mathesar_service | ~~~~~~~~~~~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner
mathesar_service | return func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 330, in cursor
mathesar_service | return self._cursor()
mathesar_service | ~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 306, in _cursor
mathesar_service | self.ensure_connection()
mathesar_service | ~~~~~~~~~~~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner
mathesar_service | return func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 288, in ensure_connection
mathesar_service | with self.wrap_database_errors:
mathesar_service | ^^^^^^^^^^^^^^^^^^^^^^^^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/utils.py", line 91, in __exit__
mathesar_service | raise dj_exc_value.with_traceback(traceback) from exc_value
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
mathesar_service | self.connect()
mathesar_service | ~~~~~~~~~~~~^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner
mathesar_service | return func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/base/base.py", line 270, in connect
mathesar_service | self.connection = self.get_new_connection(conn_params)
mathesar_service | ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner
mathesar_service | return func(*args, **kwargs)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
mathesar_service | connection = self.Database.connect(**conn_params)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/psycopg/connection.py", line 98, in connect
mathesar_service | attempts = conninfo_attempts(params)
mathesar_service | File "/usr/local/lib/python3.13/site-packages/psycopg/_conninfo_attempts.py", line 50, in conninfo_attempts
mathesar_service | raise e.OperationalError(str(last_exc))
mathesar_service | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
mathesar_service exited with code 1
mathesar_db | 2025-02-05 08:11:34.795 UTC [48] FATAL: role "mathesar" does not exist
mathesar_db | 2025-02-05 08:11:39.875 UTC [56] FATAL: role "mathesar" does not existif anyone need any more info please reply |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Are you running both postgresql and mathesar from the same docker-compose?
In your docker-compose.yml you find this here: So it should read: |
Beta Was this translation helpful? Give feedback.
-
|
sure will try same |
Beta Was this translation helpful? Give feedback.
-
|
Hi @veris-vaibhavs, keep us updated on your progress. Happy to help you debug or even hop on a quick call to get you set up. Good luck! |
Beta Was this translation helpful? Give feedback.
Are you running both postgresql and mathesar from the same docker-compose?
It seems you try to connect to a DB at 0.0.0.0 which does not have a "mathesar" role.
POSTGRES_HOST: ${POSTGRES_HOST:-http://0.0.0.0}/should be the name of the container running postgres (or, i guess, an external postgresql)In your docker-compose.yml you find this here:
db: image: postgres:13 container_name: mathesar_dbSo it should read:
POSTGRES_HOST: ${POSTGRES_HOST:-mathesar_db}