saleor: Unable to install saleor

Did create a database named saleor with “createdb saleor” Did create a superuser named saleor with “createuser -s --pwprompt saleor” Password for the super user is as default “saleor”

I am not sure why am i getting this error. I did find some similar issues and fallowed them through but did not solve my problem. I would really appreciate any help.

(ecommerce) [root@site saleor]# python manage.py migrate
System check identified some issues:

WARNINGS:
saleor.W001: Session caching cannot work with locmem backend
	HINT: User sessions need to be globally shared, use a cache server like Redis.
Traceback (most recent call last):
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection
    self.connect()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 194, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 168, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  Ident authentication failed for user "saleor"


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 79, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/migrations/loader.py", line 206, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 61, in applied_migrations
    if self.has_table():
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 44, in has_table
    return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 255, in cursor
    return self._cursor()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 232, in _cursor
    self.ensure_connection()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection
    self.connect()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection
    self.connect()
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/base/base.py", line 194, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 168, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/root/environments/ecommerce/lib/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  Ident authentication failed for user "saleor"

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

It should be 👍

Let’s try to force the password of the database user saleor to be saleor. As root, run (copy/paste):

psql postgres postgres <<EOF
ALTER USER saleor WITH ENCRYPTED PASSWORD 'saleor';
\q
EOF

If the console prints:

ERROR:  role "saleor" does not exist

Recreate the user (run as root, or as postgres (sudo -sHu postgres)):

createuser -U postgres -s --pwprompt saleor

Because I suspect that it may have failed previously as it may have been run as root and not as postgres. But I think it depends on the Linux distributions sometimes.

So i solved it with adding this code host all all 127.0.0.1/32 trust to /var/lib/pgsql/data/pg_hba.conf

I know its not save to use trust as auth method. But since this is a development environment i suppose its okay for now. Should i use md5 instead of trust when i deploy my project ?

Also thanks for the help, much appreciated.