@yk_vova

Почему не работает функция на Heroku?

Я хочу залить бота на сервис Хероку, но при повторной отправке запроса в виде номера упражнения (в разделе физика) возникает данная ошибка
Тоесть в 1 ответ он отправляет, но на следующий запрос уже не отвечает
Не работает функция fiz()
Билдпаки для работы селениума добавлял , при первом запросе работает, потом падает
spoiler

2020-12-08T15:47:26.750743+00:00 app[worker.1]:

2020-12-08T15:47:26.750744+00:00 app[worker.1]: During handling of the above exception, another exception occurred:

2020-12-08T15:47:26.750744+00:00 app[worker.1]:

2020-12-08T15:47:26.750745+00:00 app[worker.1]: Traceback (most recent call last):

2020-12-08T15:47:26.750771+00:00 app[worker.1]: File "bot.py", line 683, in

2020-12-08T15:47:26.751245+00:00 app[worker.1]: bot.polling(none_stop=True)

2020-12-08T15:47:26.751250+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telebot/__init__.py", line 427, in polling

2020-12-08T15:47:26.751488+00:00 app[worker.1]: self.__threaded_polling(none_stop, interval, timeout)

2020-12-08T15:47:26.751492+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telebot/__init__.py", line 451, in __threaded_polling

2020-12-08T15:47:26.751727+00:00 app[worker.1]: self.worker_pool.raise_exceptions()

2020-12-08T15:47:26.751730+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telebot/util.py", line 111, in raise_exceptions

2020-12-08T15:47:26.751875+00:00 app[worker.1]: six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])

2020-12-08T15:47:26.751879+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/six.py", line 703, in reraise

2020-12-08T15:47:26.752201+00:00 app[worker.1]: raise value

2020-12-08T15:47:26.752206+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telebot/util.py", line 62, in run

2020-12-08T15:47:26.752344+00:00 app[worker.1]: task(*args, **kwargs)

2020-12-08T15:47:26.752350+00:00 app[worker.1]: File "bot.py", line 178, in fiz

2020-12-08T15:47:26.752626+00:00 app[worker.1]: driver.get(f'https://vip.gdz.ru/class-7/fizika/sbornik-zadach-p...')

2020-12-08T15:47:26.752627+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get

2020-12-08T15:47:26.752855+00:00 app[worker.1]: self.execute(Command.GET, {'url': url})

2020-12-08T15:47:26.752856+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 319, in execute

2020-12-08T15:47:26.753070+00:00 app[worker.1]: response = self.command_executor.execute(driver_command, params)

2020-12-08T15:47:26.753074+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py", line 374, in execute

2020-12-08T15:47:26.753382+00:00 app[worker.1]: return self._request(command_info[0], url, body=data)

2020-12-08T15:47:26.753383+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py", line 397, in _request

2020-12-08T15:47:26.753607+00:00 app[worker.1]: resp = self._conn.request(method, url, body=body, headers=headers)

2020-12-08T15:47:26.753608+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/request.py", line 80, in request

2020-12-08T15:47:26.753733+00:00 app[worker.1]: method, url, fields=fields, headers=headers, **urlopen_kw

2020-12-08T15:47:26.753737+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/request.py", line 171, in request_encode_body

2020-12-08T15:47:26.753900+00:00 app[worker.1]: return self.urlopen(method, url, **extra_kw)

2020-12-08T15:47:26.753903+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/poolmanager.py", line 336, in urlopen

2020-12-08T15:47:26.754118+00:00 app[worker.1]: response = conn.urlopen(method, u.request_uri, **kw)

2020-12-08T15:47:26.754118+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen

2020-12-08T15:47:26.754521+00:00 app[worker.1]: **response_kw

2020-12-08T15:47:26.754541+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen

2020-12-08T15:47:26.754852+00:00 app[worker.1]: **response_kw

2020-12-08T15:47:26.754855+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen

2020-12-08T15:47:26.755227+00:00 app[worker.1]: **response_kw

2020-12-08T15:47:26.755230+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen

2020-12-08T15:47:26.755533+00:00 app[worker.1]: method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

2020-12-08T15:47:26.755538+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment

2020-12-08T15:47:26.755760+00:00 app[worker.1]: raise MaxRetryError(_pool, url, error or ResponseError(cause))

2020-12-08T15:47:26.755770+00:00 app[worker.1]: urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=60534): Max retries exceeded with url: /session/aec33c802fd298cdd7eee57ae173ca17/url (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',))

Код бота:
  • Вопрос задан
  • 70 просмотров
Пригласить эксперта
Ваш ответ на вопрос

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

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