Задать вопрос
vladislavignatyev
@vladislavignatyev
Frontend & backend, WEB-dev, WEB master

Есть телеграмм бот, не могу запустить из-за SQLAlchemy ( лог ошибки прикреплен )?

У меня имеется телеграмм бот, хотел его запустить и проверить, но выдает ошибку.
Сервер локальный OpenServer, база создана, постгресс порты стоят, не пойму что не так.
Подскажите пожалуйста.

Лог ошибки

D:\OpenServer\OpenServer\domains\TestBot>python bot.py
Traceback (most recent call last):
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 1122, in _do_get
return self._pool.get(wait, self._timeout)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\queue.py", line 145, in get
raise Empty
sqlalchemy.util.queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 2147, in _w
rap_pool_connect
return fn()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 387, in connect
return _ConnectionFairy._checkout(self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 766, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 516, in checkout
rec = pool._do_get()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 1138, in _do_get
self._dec_overflow()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\langhelpers.py", line 66, in
__exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\compat.py", line 187, in rer
aise
raise value
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 1135, in _do_get
return self._create_connection()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 333, in _create_co
nnection
return _ConnectionRecord(self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 461, in __init__
self.__connect(first_connect_check=True)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 651, in __connect
connection = pool._invoke_creator(self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\strategies.py", line 105,
in connect
return dialect.connect(*cargs, **cparams)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\default.py", line 393, in
connect
return self.dbapi.connect(*cargs, **cparams)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\psycopg2\__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused (0x00
00274D/10061)
Is the server running on host "localhost" (127.0.0.1) 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 "bot.py", line 68, in
Base.metadata.create_all(engine)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\sql\schema.py", line 3949, in cre
ate_all
tables=tables)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 1928, in _r
un_visitor
with self._optional_conn_ctx_manager(connection) as conn:
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\contextlib.p
y", line 81, in __enter__
return next(self.gen)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 1921, in _o
ptional_conn_ctx_manager
with self.contextual_connect() as conn:
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 2112, in co
ntextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 2151, in _w
rap_pool_connect
e, dialect, self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 1465, in _h
andle_dbapi_exception_noconnection
exc_info
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\compat.py", line 203, in rai
se_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\compat.py", line 186, in rer
aise
raise value.with_traceback(tb)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\base.py", line 2147, in _w
rap_pool_connect
return fn()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 387, in connect
return _ConnectionFairy._checkout(self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 766, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 516, in checkout
rec = pool._do_get()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 1138, in _do_get
self._dec_overflow()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\langhelpers.py", line 66, in
__exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\util\compat.py", line 187, in rer
aise
raise value
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 1135, in _do_get
return self._create_connection()
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 333, in _create_co
nnection
return _ConnectionRecord(self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 461, in __init__
self.__connect(first_connect_check=True)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\pool.py", line 651, in __connect
connection = pool._invoke_creator(self)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\strategies.py", line 105,
in connect
return dialect.connect(*cargs, **cparams)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy-1.1.14-py3.6-win32.egg\sqlalchemy\engine\default.py", line 393, in
connect
return self.dbapi.connect(*cargs, **cparams)
File "C:\Users\VlaD\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\psycopg2\__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect t
o server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
  • Вопрос задан
  • 298 просмотров
Подписаться 2 Простой 6 комментариев
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы