: Getting error while starting the server

From: VENKTESH GUTTEDAR <venkteshguttedar(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: : Getting error while starting the server
Date: 2015-02-23 07:02:55
Message-ID: CA+iwz4=YHwx7K6QY5fptmS-3g+YZi=AGe00EL_ZTSQTV2R9cpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

i have Postgresql 9.3.5 installed and django 1.7 and till now it was
working fine.

But now i am getting the following error while starting the server to
run my app :

Unhandled exception in thread started by <function
check_errors.<locals>.wrapper at 0xb2da8074>
Traceback (most recent call last):
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 133, in ensure_connection
self.connect()
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 122, in connect
self.connection = self.get_new_connection(conn_params)
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/postgresql_psycopg2/base.py",
line 134, in get_new_connection
return Database.connect(**conn_params)
File "/usr/local/lib/python3.4/dist-packages/psycopg2/__init__.py", line
164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: could not translate host name "localhost" to
address: Name or service not known

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

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/django/utils/autoreload.py",
line 222, in wrapper
fn(*args, **kwargs)
File
"/usr/local/lib/python3.4/dist-packages/django/core/management/commands/runserver.py",
line 107, in inner_run
self.check_migrations()
File
"/usr/local/lib/python3.4/dist-packages/django/core/management/commands/runserver.py",
line 159, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File
"/usr/local/lib/python3.4/dist-packages/django/db/migrations/executor.py",
line 17, in __init__
self.loader = MigrationLoader(self.connection)
File
"/usr/local/lib/python3.4/dist-packages/django/db/migrations/loader.py",
line 48, in __init__
self.build_graph()
File
"/usr/local/lib/python3.4/dist-packages/django/db/migrations/loader.py",
line 183, in build_graph
self.applied_migrations = recorder.applied_migrations()
File
"/usr/local/lib/python3.4/dist-packages/django/db/migrations/recorder.py",
line 59, in applied_migrations
self.ensure_schema()
File
"/usr/local/lib/python3.4/dist-packages/django/db/migrations/recorder.py",
line 49, in ensure_schema
if self.Migration._meta.db_table in
self.connection.introspection.get_table_list(self.connection.cursor()):
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 165, in cursor
cursor = self.make_debug_cursor(self._cursor())
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 138, in _cursor
self.ensure_connection()
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 133, in ensure_connection
self.connect()
File "/usr/local/lib/python3.4/dist-packages/django/db/utils.py", line
94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.4/dist-packages/django/utils/six.py", line
658, in reraise
raise value.with_traceback(tb)
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 133, in ensure_connection
self.connect()
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/__init__.py",
line 122, in connect
self.connection = self.get_new_connection(conn_params)
File
"/usr/local/lib/python3.4/dist-packages/django/db/backends/postgresql_psycopg2/base.py",
line 134, in get_new_connection
return Database.connect(**conn_params)
File "/usr/local/lib/python3.4/dist-packages/psycopg2/__init__.py", line
164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: could not translate host name "localhost"
to address: Name or service not known

can anyone tell me what is the reason for this error.?

--
Regards :
Venktesh Guttedar.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2015-02-23 07:23:18 Re: Postgres architecture for multiple instances
Previous Message Novák 2015-02-23 05:14:25 Re: Postgres architecture for multiple instances