Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couldn't connet to server when create superuser #1236

Closed
jiangjun001 opened this issue Mar 5, 2020 · 1 comment
Closed

couldn't connet to server when create superuser #1236

jiangjun001 opened this issue Mar 5, 2020 · 1 comment

Comments

@jiangjun001
Copy link

$ winpty docker exec -it cvat bash -ic 'python3 ~/manage.py createsuperuser'
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 217, in ensure_connection
self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/postgresql/bas
e.py", line 178, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.5/dist-packages/psycopg2/init.py", line 130,
in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "cvat_db" (220.250.64.26) and accepting
TCP/IP connections on port 5432?

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

Traceback (most recent call last):
File "/home/django/manage.py", line 21, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/init.p
y", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/init.p
y", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py",
line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-packages/django/contrib/auth/management/co
mmands/createsuperuser.py", line 61, in execute
return super().execute(*args, **options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py",
line 363, in execute
self.check_migrations()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py",
line 453, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/executor.py"
, line 18, in init
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py",
line 49, in init
self.build_graph()
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py",
line 212, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/recorder.py"
, line 73, in applied_migrations
if self.has_table():
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/recorder.py"
, line 56, in has_table
return self.Migration.meta.db_table in self.connection.introspection.table
names(self.connection.cursor())
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 256, in cursor
return self._cursor()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 233, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 217, in ensure_connection
self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/utils.py", line 89, in
exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 217, in ensure_connection
self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py",
line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/postgresql/bas
e.py", line 178, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.5/dist-packages/psycopg2/init.py", line 130,
in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refuse
d
Is the server running on host "cvat_db" (220.250.64.26) and accepting
TCP/IP connections on port 5432?

@mozheng
Copy link

mozheng commented Feb 4, 2021

same question.你怎能没解决的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants