Comments (7)
@nessshon still throws an exception. After about 1-2 hours of work.
from pytonapi.
One of the accounts: UQD0g_SvxCFDL6siKlAbCGuunZY8R7L6imTN0mIaxIGWGVQf
Errors occurred with a frequency ranging from every half an hour to 5 hours.
After transitioning to version 0.2.4b1, this error has been resolved.
But now I'm getting a different error:
Traceback (most recent call last):
File "/root/WhaleWatch/main.py", line 115, in main
await tonapi.sse.subscribe_to_transactions(
File "/root/WhaleWatch/venv/lib/python3.10/site-packages/pytonapi/async_tonapi/methods/sse.py", line 25, in subscribe_to_transactions
async for data in self._subscribe(method=method, params=params):
File "/root/WhaleWatch/venv/lib/python3.10/site-packages/pytonapi/async_tonapi/client.py", line 122, in _subscribe
await self.__process_response(response)
File "/root/WhaleWatch/venv/lib/python3.10/site-packages/pytonapi/async_tonapi/client.py", line 97, in __process_response
error = content.get("error", content)
AttributeError: 'str' object has no attribute 'get'
I'm guessing it's because of these lines at async_tonapi/client.py:69
except httpx.ResponseNotRead:
content = response.text
My python is 3.10.12
and freeze:
annotated-types==0.6.0
anyio==4.3.0
certifi==2024.2.2
exceptiongroup==1.2.1
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
pydantic==2.7.0
pydantic_core==2.18.1
python-dotenv==1.0.1
python-telegram-bot==21.1.1
pytonapi==0.2.4b1
sniffio==1.3.1
typing_extensions==4.11.0
websockets==12.0
from pytonapi.
@AveZorgen, thanks for the detailed tips!
Try installing it pytonapi==0.2.4b2
and see if the error occurs again..
from pytonapi.
@nessshon Hello, I have similar exception:
Traceback (most recent call last):
File "/root/TON_Taxi/ton/api/tonapi.py", line 28, in listen
await self.api.sse.subscribe_to_transactions(accounts=[self.debug, self.team_address], handler=self.on_new_transaction, args=(self.api,))
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/pytonapi/async_tonapi/methods/sse.py", line 25, in subscribe_to_transactions
async for data in self._subscribe(method=method, params=params):
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/pytonapi/async_tonapi/client.py", line 126, in _subscribe
async for line in response.aiter_lines():
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_models.py", line 963, in aiter_lines
async for text in self.aiter_text():
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_models.py", line 950, in aiter_text
async for byte_content in self.aiter_bytes():
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_models.py", line 929, in aiter_bytes
async for raw_bytes in self.aiter_raw():
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_models.py", line 987, in aiter_raw
async for raw_stream_bytes in self.stream:
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_client.py", line 149, in __aiter__
async for chunk in self._stream:
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 253, in __aiter__
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/root/TON_Taxi/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadError
Now I’ll install the version you specified and check it. I'll let you know tomorrow morning, was there an exception again or is everything stable
from pytonapi.
@nessshon There were errors, but now I catch them and try to reconnect
from pytonapi.
@AveZorgen, hello!
I just ran the tests and didn't find any errors. Could you send me a list of ACCOUNTS? Tell me, how often does this error occur?
I have implemented the solution you found in version 0.2.4b1. Try installing it (pip install pytonapi==0.2.4b1
) and see if the error occurs again. If this doesn't happen, I will implement the solution in the next update.
from pytonapi.
@Asidert, @AveZorgen, Have you encountered any more errors lately? If so, I'm considering implementing a strategy to ignore all 5xx errors so that the SSE method continues to function regardless. What are your thoughts on this approach?
from pytonapi.
Related Issues (20)
- pydantic.v1.error_wrappers.ValidationError HOT 3
- Wrong received `int` type in `liteserver.get_account_state` HOT 1
- TypeError: 'type' object is not subscriptable HOT 3
- About pending transaction HOT 2
- Missing method to "Get Jetton balance by owner address"
- tonapi.blockchain.send_message(data) Always Returns False HOT 1
- Write me on telegram @zakhar_petukhov, thanks
- pytonapi.exceptions.TONAPINotFoundError: entity not found HOT 1
- Missing support for v2/sse/blocks HOT 2
- [JettonInfo] object admin missing HOT 1
- Graylist - one of the token verification statuses.
- KeyError: 'logger' when calling a method consecutively HOT 1
- Update schema HOT 1
- lack of raw_body property in Message schema HOT 1
- Sending TON HOT 1
- Wrong error format
- JSONDecodeError on client.blockchain.send_message method HOT 5
- tx hash in send message HOT 2
- SSE with multiple accounts looks suspicious HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytonapi.