Closed comverser closed 1 year ago
I'm trying to reproduce.
sudo sh run_locally.sh
I jump this because it's not necessary run as root.
First run, returns me the migrations issue. Second run, was success.
Your first run shows that something happened with the database docker image, because the issue is that the transaction-service can't access to database at default port.
I get exactly the same issue than you here, I guess that is only once because the script is running createsuperuser
without wait for migrations ready.
No error because the migrations are ready and createsuperuser
can be executed without issues.
I'm going to work on this, to fix the first run issue.
Questions
First installation with the automated way is always unsuccessful. When I attempt to reinstall, the installation process completes without errors, which leaves me wondering why this is happening. If there is a problem, how can I solve it?
Console messages on my MacBook and EC2 instance in AWS.
MacBook Pro (M1)
First
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/app/src/manage.py", line 22, in
main()
File "/app/src/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/python-deps/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, cmd_options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute
return super().execute(*args, *options)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 447, in execute
self.check_migrations()
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 564, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in init
self.loader = MigrationLoader(self.connection)
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in init
self.build_graph()
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
File "/python-deps/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(args, kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 281, in ensure_connection
with self.wrap_database_errors:
File "/python-deps/lib/python3.10/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, *kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/python-deps/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(args, kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(conn_params)
File "/python-deps/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "cfg-db" (172.18.0.5) and accepting
TCP/IP connections on port 5432?
(base)
Third
Ubuntu 20.04 (AWS EC2, t2.xlarge)
First run
You have 64 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, chains, contenttypes, safe_apps, sessions. Run 'python manage.py migrate' to apply them. Traceback (most recent call last): File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation "auth_user" does not exist LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user... ^
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/app/src/manage.py", line 22, in
main()
File "/app/src/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/python-deps/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, cmd_options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute
return super().execute(*args, *options)
File "/python-deps/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(args, options)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 109, in handle
default_username = get_default_username(database=database)
File "/python-deps/lib/python3.10/site-packages/django/contrib/auth/management/init.py", line 163, in get_default_username
auth_app.User._default_manager.db_manager(database).get(
File "/python-deps/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 646, in get
num = len(clone)
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 376, in len
self._fetch_all()
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 1867, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/python-deps/lib/python3.10/site-packages/django/db/models/query.py", line 87, in iter
results = compiler.execute_sql(
File "/python-deps/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
cursor.execute(sql, params)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/python-deps/lib/python3.10/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/python-deps/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
Reproduce
Edit the .env and set RPC_NODE_URL to the chain you want the services running against. (cf. Please note that this URL has not been added to safe-contracts through request pull and merge process.)
First run
Second and third run