FATAL: password authentication failed for user "admin"

I followed this guide for installing Rasa on a server and got stuck at point 3 where it says to set the admin password.

I get this error:

`2020-01-13T16:05:22.442531066Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect 
2020-01-13T16:05:22.442537483Z     return fn() 
2020-01-13T16:05:22.442541109Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
2020-01-13T16:05:22.442544830Z     return _ConnectionFairy._checkout(self)
2020-01-13T16:05:22.442548442Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
2020-01-13T16:05:22.442552228Z     fairy = _ConnectionRecord.checkout(pool)
2020-01-13T16:05:22.442555636Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
2020-01-13T16:05:22.442559256Z     rec = pool._do_get()
2020-01-13T16:05:22.442562551Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
2020-01-13T16:05:22.442566102Z     self._dec_overflow()
2020-01-13T16:05:22.442569378Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
2020-01-13T16:05:22.442580268Z     compat.reraise(exc_type, exc_value, exc_tb)
2020-01-13T16:05:22.442583876Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
2020-01-13T16:05:22.442587404Z     raise value
2020-01-13T16:05:22.442590619Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
2020-01-13T16:05:22.442594086Z     return self._create_connection()
2020-01-13T16:05:22.442597403Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
2020-01-13T16:05:22.442600928Z     return _ConnectionRecord(self)
2020-01-13T16:05:22.442604207Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
2020-01-13T16:05:22.442607682Z     self.__connect(first_connect_check=True)
2020-01-13T16:05:22.442611006Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
2020-01-13T16:05:22.442614484Z     connection = pool._invoke_creator(self)
2020-01-13T16:05:22.442617833Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
2020-01-13T16:05:22.442621427Z     return dialect.connect(*cargs, **cparams)
2020-01-13T16:05:22.442624765Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 453, in connect
2020-01-13T16:05:22.442628342Z     return self.dbapi.connect(*cargs, **cparams)
2020-01-13T16:05:22.442631675Z   File "/usr/local/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
2020-01-13T16:05:22.442635250Z     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2020-01-13T16:05:22.442638783Z psycopg2.OperationalError: FATAL:  password authentication failed for user "admin"
2020-01-13T16:05:22.442642359Z
2020-01-13T16:05:22.442646049Z
2020-01-13T16:05:22.442650812Z The above exception was the direct cause of the following exception:
2020-01-13T16:05:22.442654323Z
2020-01-13T16:05:22.442657583Z Traceback (most recent call last):
2020-01-13T16:05:22.442660996Z   File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
2020-01-13T16:05:22.442664562Z     "__main__", mod_spec)
2020-01-13T16:05:22.442668058Z   File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
2020-01-13T16:05:22.442671505Z     exec(code, run_globals)
2020-01-13T16:05:22.442674885Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/server.py", line 114, in <module>
2020-01-13T16:05:22.442678918Z     main()
2020-01-13T16:05:22.442682200Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/server.py", line 30, in main
2020-01-13T16:05:22.442685815Z     sql_migrations.run_migrations(session)
2020-01-13T16:05:22.442692270Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/sql_migrations.py", line 25, in run_migrations
2020-01-13T16:05:22.442696064Z     _run_schema_migrations(session)
2020-01-13T16:05:22.442699387Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/sql_migrations.py", line 41, in _run_schema_migrations
2020-01-13T16:05:22.442703019Z     _run_alembic_migration(alembic_config)
2020-01-13T16:05:22.442706339Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/sql_migrations.py", line 65, in _run_alembic_migration
2020-01-13T16:05:22.442709883Z     command.upgrade(alembic_config, target_revision)
2020-01-13T16:05:22.442713253Z   File "/usr/local/lib/python3.6/site-packages/alembic/command.py", line 276, in upgrade
2020-01-13T16:05:22.442716736Z     script.run_env()
2020-01-13T16:05:22.442720001Z   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 475, in run_env
2020-01-13T16:05:22.442723457Z     util.load_python_file(self.dir, "env.py")
2020-01-13T16:05:22.442726874Z   File "/usr/local/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
2020-01-13T16:05:22.442730431Z     module = load_module_py(module_id, path)
2020-01-13T16:05:22.442733762Z   File "/usr/local/lib/python3.6/site-packages/alembic/util/compat.py", line 156, in load_module_py
2020-01-13T16:05:22.442737278Z     spec.loader.exec_module(module)
2020-01-13T16:05:22.442740575Z   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-01-13T16:05:22.442744215Z   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-01-13T16:05:22.442747862Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 89, in <module>
2020-01-13T16:05:22.442751727Z     run_migrations_online()
2020-01-13T16:05:22.442755130Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 67, in run_migrations_online
2020-01-13T16:05:22.442759118Z     with connectable.connect() as connection:
2020-01-13T16:05:22.442762412Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2193, in connect
2020-01-13T16:05:22.442765873Z     return self._connection_cls(self, **kwargs)
2020-01-13T16:05:22.442769206Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 103, in __init__
2020-01-13T16:05:22.442772653Z     else engine.raw_connection()
2020-01-13T16:05:22.442775938Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2293, in raw_connection
2020-01-13T16:05:22.442779404Z     self.pool.unique_connection, _connection
2020-01-13T16:05:22.442782754Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect
2020-01-13T16:05:22.442786297Z     e, dialect, self
2020-01-13T16:05:22.442792447Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
2020-01-13T16:05:22.442796112Z     util.raise_from_cause(sqlalchemy_exception, exc_info)
2020-01-13T16:05:22.442799480Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
2020-01-13T16:05:22.442802992Z     reraise(type(exception), exception, tb=exc_tb, cause=cause)
2020-01-13T16:05:22.442806354Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
2020-01-13T16:05:22.442809853Z     raise value.with_traceback(tb)
2020-01-13T16:05:22.442813147Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
2020-01-13T16:05:22.442816678Z     return fn()
2020-01-13T16:05:22.442819955Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
2020-01-13T16:05:22.442823501Z     return _ConnectionFairy._checkout(self)
2020-01-13T16:05:22.442826813Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
2020-01-13T16:05:22.442830303Z     fairy = _ConnectionRecord.checkout(pool)
2020-01-13T16:05:22.442833605Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
2020-01-13T16:05:22.442837083Z     rec = pool._do_get()
2020-01-13T16:05:22.442840439Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
2020-01-13T16:05:22.442843945Z     self._dec_overflow()
2020-01-13T16:05:22.442847240Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
2020-01-13T16:05:22.442850793Z     compat.reraise(exc_type, exc_value, exc_tb)
2020-01-13T16:05:22.442854116Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
2020-01-13T16:05:22.442857595Z     raise value
2020-01-13T16:05:22.442862990Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
2020-01-13T16:05:22.442866873Z     return self._create_connection()
2020-01-13T16:05:22.442870336Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
2020-01-13T16:05:22.442873880Z     return _ConnectionRecord(self)
2020-01-13T16:05:22.442877167Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
2020-01-13T16:05:22.442880647Z     self.__connect(first_connect_check=True)
2020-01-13T16:05:22.442884025Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
2020-01-13T16:05:22.442887517Z     connection = pool._invoke_creator(self)
2020-01-13T16:05:22.442890850Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
2020-01-13T16:05:22.442899346Z     return dialect.connect(*cargs, **cparams)
2020-01-13T16:05:22.442902783Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 453, in connect
2020-01-13T16:05:22.442906341Z     return self.dbapi.connect(*cargs, **cparams)
2020-01-13T16:05:22.442909706Z   File "/usr/local/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
2020-01-13T16:05:22.442913179Z     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2020-01-13T16:05:22.442916671Z sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  password authentication failed for user "admin"`

@erohmensing? @stephens? anybody?

You’re using the wrong username. The username is me and you are passing admin.

Here’s the error from your log above:

FATAL:  password authentication failed for user "admin"

Here’s the command you should be running. This sets the password for the username me.

sudo python rasa_x_commands.py create --update admin me <PASSWORD>
1 Like

Hi @stephens, this same error came up again after some time.

I did run the command you said, but I still get the error:

If I look at the log, the error is the same:

(venv2) root@chatbot-ubuntu-s-4vcpu-8gb-lon1-01:/etc/rasa# sudo python rasa_x_commands.py create --update admin me charlie123
Error response from daemon: Container f1e571c1c3e6037206c7de3dd148771a70bb3144ae878d790381da297adfe908 is restarting, wait until the container is running
ERROR:__main__:Failed to create user.
(venv2) root@chatbot-ubuntu-s-4vcpu-8gb-lon1-01:/etc/rasa# docker logs --tail 50 --follow --timestamps f1e571c1c3e6037206c7de3dd148771a70bb3144ae878d790381da297adfe908
2020-03-13T12:06:18.422319226Z   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-03-13T12:06:18.422330698Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 87, in <module>
2020-03-13T12:06:18.422341961Z     run_migrations_online()
2020-03-13T12:06:18.422353311Z   File "/usr/local/lib/python3.6/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 65, in run_migrations_online
2020-03-13T12:06:18.422367031Z     with connectable.connect() as connection:
2020-03-13T12:06:18.422377834Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2193, in connect
2020-03-13T12:06:18.422390170Z     return self._connection_cls(self, **kwargs)
2020-03-13T12:06:18.422401388Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 103, in __init__
2020-03-13T12:06:18.422412223Z     else engine.raw_connection()
2020-03-13T12:06:18.422423825Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2293, in raw_connection
2020-03-13T12:06:18.422435850Z     self.pool.unique_connection, _connection
2020-03-13T12:06:18.422446505Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect
2020-03-13T12:06:18.422458302Z     e, dialect, self
2020-03-13T12:06:18.422469277Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
2020-03-13T12:06:18.422480766Z     util.raise_from_cause(sqlalchemy_exception, exc_info)
2020-03-13T12:06:18.422491673Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
2020-03-13T12:06:18.422503186Z     reraise(type(exception), exception, tb=exc_tb, cause=cause)
2020-03-13T12:06:18.422513873Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
2020-03-13T12:06:18.422524473Z     raise value.with_traceback(tb)
2020-03-13T12:06:18.422535779Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
2020-03-13T12:06:18.422546972Z     return fn()
2020-03-13T12:06:18.422566978Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
2020-03-13T12:06:18.422579380Z     return _ConnectionFairy._checkout(self)
2020-03-13T12:06:18.422589993Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
2020-03-13T12:06:18.422601781Z     fairy = _ConnectionRecord.checkout(pool)
2020-03-13T12:06:18.422613017Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
2020-03-13T12:06:18.422624091Z     rec = pool._do_get()
2020-03-13T12:06:18.422635256Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
2020-03-13T12:06:18.422646248Z     self._dec_overflow()
2020-03-13T12:06:18.422658183Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
2020-03-13T12:06:18.422669601Z     compat.reraise(exc_type, exc_value, exc_tb)
2020-03-13T12:06:18.422680183Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
2020-03-13T12:06:18.422699412Z     raise value
2020-03-13T12:06:18.422712254Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
2020-03-13T12:06:18.422725271Z     return self._create_connection()
2020-03-13T12:06:18.422737685Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
2020-03-13T12:06:18.422749104Z     return _ConnectionRecord(self)
2020-03-13T12:06:18.422760421Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
2020-03-13T12:06:18.422772287Z     self.__connect(first_connect_check=True)
2020-03-13T12:06:18.422783445Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
2020-03-13T12:06:18.422794577Z     connection = pool._invoke_creator(self)
2020-03-13T12:06:18.422805179Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
2020-03-13T12:06:18.422817104Z     return dialect.connect(*cargs, **cparams)
2020-03-13T12:06:18.422829865Z   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 453, in connect
2020-03-13T12:06:18.422842157Z     return self.dbapi.connect(*cargs, **cparams)
2020-03-13T12:06:18.422852960Z   File "/usr/local/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
2020-03-13T12:06:18.422863889Z     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2020-03-13T12:06:18.422874590Z sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  password authentication failed for user "admin"

Your log shows an error that a container is not running. I suspect this is your database container.

Container f1e571c1c3e6037206c7de3dd148771a70bb3144ae878d790381da297adfe908 is restarting, wait until the container is running

After that error, I ran the command for seeing what was causing that and apparently this is the problem:

FATAL: password authentication failed for user "admin"

Please help me installing Rasa on my server… I’m ruining a whole project because of that

For me the issue seems, that the database password was changed after the database was initialized. So the database expects a password A while Rasa X tries to use a “newer” password B