Y
Y
yk_vova2020-12-08 18:51:37
Python
yk_vova, 2020-12-08 18:51:37

Why doesn't the feature work on Heroku?

I want to upload the bot to the Heroku service, but when I resend the request as an exercise number (in the physics section), this error occurs
, that is, it sends 1 response, but the next request no longer responds
The fiz () function does not work
Buildpacks for selenium added , works on the first request, then crashes

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',))

Bot code:
spoiler

https://github.com/N0N3M3/pictures/blob/master/bot.py

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question