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

could not connect to server: No route to host #69

Open
Gaspardetlisa opened this issue Aug 3, 2021 · 1 comment
Open

could not connect to server: No route to host #69

Gaspardetlisa opened this issue Aug 3, 2021 · 1 comment

Comments

@Gaspardetlisa
Copy link

Hi, when I tried to First time set-up, this error came up everytime. What should I do to fix this problem?


root@ubuntu00:/home/belle/Documents/metadome/metadome# docker-compose run app python install.py
Starting metadome_db_1 ... done
Starting metadome_redis_1 ... done
Starting metadome_rabbitmq_1 ... done
Starting metadome_celery_1 ... done
Creating metadome_app_run ... done
2021-08-03 08:51:14,163 - WARNING - MAILSERVER is not set in default_settings.py
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 354, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 751, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 483, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/impl.py", line 138, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 68, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/impl.py", line 135, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 299, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 428, in init
self.__connect(first_connect_check=True)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 630, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 453, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.5/site-packages/psycopg2/init.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: No route to host
Is the server running on host "metadome_db_1" (172.18.0.5) 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 "install.py", line 6, in
from metadome.application import app
File "/usr/src/app/metadome/application.py", line 3, in
app = create_app()
File "/usr/src/app/metadome/factory.py", line 72, in create_app
db.create_all()
File "/usr/local/lib/python3.5/site-packages/flask_sqlalchemy/init.py", line 963, in create_all
self._execute_for_all_tables(app, bind, 'create_all')
File "/usr/local/lib/python3.5/site-packages/flask_sqlalchemy/init.py", line 955, in _execute_for_all_tables
op(bind=self.get_engine(app, bind), **extra)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/sql/schema.py", line 4287, in create_all
ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2032, in _run_visitor
with self._optional_conn_ctx_manager(connection) as conn:
File "/usr/local/lib/python3.5/contextlib.py", line 59, in enter
return next(self.gen)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2024, in _optional_conn_ctx_manager
with self._contextual_connect() as conn:
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2226, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect
e, dialect, self
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 354, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 751, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 483, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/impl.py", line 138, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 68, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/impl.py", line 135, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 299, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 428, in init
self.__connect(first_connect_check=True)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/pool/base.py", line 630, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 453, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.5/site-packages/psycopg2/init.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: No route to host
Is the server running on host "metadome_db_1" (172.18.0.5) and accepting
TCP/IP connections on port 5432?

(Background on this error at: http://sqlalche.me/e/e3q8)
ERROR: 1

@laurensvdwiel
Copy link
Member

Hi Gaspardetlisa,

Apologies for not responding sooner, I just transitioned to a new job + location.

I have succesfully recreated this error and am working on this the coming few weeks.
I assume it has to do with the first time server setup of the db instance of the docker-compose file.

Will update when I know more.

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