First installation: python manage.py migrate errors

628 views
Skip to first unread message

francesc...@gmail.com

unread,
Aug 31, 2017, 4:16:16 AM8/31/17
to OpenREM
I followed the online docs for the first time installation.

The command

python manage.py migrate

fails with following errors (I check my database openremdb user (root) password is correctly written in the configuration file):

c:\Python27\Lib\site-packages\openrem>python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 354, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 445, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "C:\Python27\lib\site-packages\django\db\migrations\executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 47, in __init__
self.build_graph()
File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 164, in cursor
cursor = self.make_cursor(self._cursor())
File "C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 135, in _cursor
self.ensure_connection()
File "C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 130, in ensure_connection
self.connect()
File "C:\Python27\lib\site-packages\django\db\utils.py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 130, in ensure_connection
self.connect()
File "C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
File "C:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "C:\Python27\lib\site-packages\psycopg2\__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL: password authentication failed for user "root"


c:\Python27\Lib\site-packages\openrem>

David Platten

unread,
Aug 31, 2017, 10:05:09 AM8/31/17
to OpenREM
Hi,

I don't use a "root" PostgreSQL user with OpenREM to access my PostgreSQL database - I created a specific user called "openremuser" using the pgAdmin tool. I used the (Windows) instructions here: http://docs.openrem.org/en/0.7.4/postgresql_windows.html. I then used pgAdmin to create a new database for OpenREM, and assigned "openremuser" as the database owner.

Are you sure that your "root" user owns the PostgreSQL database that you've created for OpenREM to use?

Regards,

David

Francesco Gigante

unread,
Aug 31, 2017, 11:25:09 AM8/31/17
to OpenREM
Yes, I set the "root" user as owner of the new openremdb database and I set all the privileges too.

al...@raforninn.is

unread,
Jun 13, 2018, 12:35:08 PM6/13/18
to OpenREM
I know this is old, but in case someone else stumbles on this as well. What fixed the error for me was that I didn't have a host specified in the settings.py file (localhost). Also double check if you're entering the user and password define in that same file.

David Platten

unread,
Jun 13, 2018, 12:52:49 PM6/13/18
to OpenREM
Hi. Do you mean you didn't have a host specified in `local_settings.py` in the `ALLOWED_HOSTS` section?
Reply all
Reply to author
Forward
0 new messages