dmytroyaskov / bankeer-bot Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Sometimes bot requests are not processed.
Additional request attempts may help to resolve this issue.
Error log:
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-254225' coro=<BankeerBot._processing() done, defined at //./main.py:94> exception=TimedOut('Timed out')>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 133, in _call_sslobject_method
result = func(*args)
File "/usr/local/lib/python3.10/ssl.py", line 917, in read
v = self._sslobj.read(len)
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:2578)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/anyio/_core/_tasks.py", line 115, in fail_after
yield cancel_scope
File "/usr/local/lib/python3.10/site-packages/httpcore/_backends/anyio.py", line 34, in read
return await self._stream.receive(max_bytes=max_bytes)
File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 198, in receive
data = await self._call_sslobject_method(self._ssl_object.read, max_bytes)
File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 140, in _call_sslobject_method
data = await self.transport_stream.receive()
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1103, in receive
await self._protocol.read_event.wait()
File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f933ce67010
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/usr/local/lib/python3.10/site-packages/httpcore/_backends/anyio.py", line 32, in read
with anyio.fail_after(timeout):
File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/site-packages/anyio/_core/_tasks.py", line 118, in fail_after
raise TimeoutError
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 262, in handle_async_request
raise exc
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 245, in handle_async_request
response = await connection.handle_async_request(request)
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 96, in handle_async_request
return await self._connection.handle_async_request(request)
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 121, in handle_async_request
raise exc
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 99, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 164, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 200, in _receive_event
data = await self._network_stream.read(
File "/usr/local/lib/python3.10/site-packages/httpcore/_backends/anyio.py", line 31, in read
with map_exceptions(exc_map):
File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/telegram/request/_httpxrequest.py", line 219, in do_request
res = await self._client.request(
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1530, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1617, in send
response = await self._send_handling_auth(
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
response = await self._send_handling_redirects(
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
response = await self._send_single_request(request)
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1719, in _send_single_request
response = await transport.handle_async_request(request)
File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "//./main.py", line 106, in _processing
await self.chat_API.bot.send_message(
File "/usr/local/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 2613, in send_message
return await super().send_message(
File "/usr/local/lib/python3.10/site-packages/telegram/_bot.py", line 394, in decorator
result = await func(self, *args, **kwargs) # skipcq: PYL-E1102
File "/usr/local/lib/python3.10/site-packages/telegram/_bot.py", line 820, in send_message
return await self._send_message(
File "/usr/local/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 517, in _send_message
result = await super()._send_message(
File "/usr/local/lib/python3.10/site-packages/telegram/_bot.py", line 572, in _send_message
result = await self._post(
File "/usr/local/lib/python3.10/site-packages/telegram/_bot.py", line 482, in _post
return await self._do_post(
File "/usr/local/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 335, in _do_post
return await super()._do_post(
File "/usr/local/lib/python3.10/site-packages/telegram/_bot.py", line 510, in _do_post
return await request.post(
File "/usr/local/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 168, in post
result = await self._request_wrapper(
File "/usr/local/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 288, in _request_wrapper
raise exc
File "/usr/local/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 278, in _request_wrapper
code, payload = await self.do_request(
File "/usr/local/lib/python3.10/site-packages/telegram/request/_httpxrequest.py", line 236, in do_request
raise TimedOut from err
telegram.error.TimedOut: Timed out
The issue at hand is that Monobank's service is currently unable to access the bot's webhook server due to the lack of an SSL certificate. While the Ngrok proxy works seamlessly with the server due to its default SSL certificate, attempting to run the bot on a VPS results in no webhook registration requests from Monobank. Therefore, in order to resolve this issue, it is necessary to add SSL certificate support to the serve HTTPS service.
Add middleware process which validates the IP address sending data to the application, by checking the route portion of it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.