Git Product home page Git Product logo

Comments (7)

Asidert avatar Asidert commented on July 30, 2024 2

@nessshon still throws an exception. After about 1-2 hours of work.

image

from pytonapi.

AveZorgen avatar AveZorgen commented on July 30, 2024 1

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.

nessshon avatar nessshon commented on July 30, 2024 1

@AveZorgen, thanks for the detailed tips!

Try installing it pytonapi==0.2.4b2 and see if the error occurs again..

from pytonapi.

Asidert avatar Asidert commented on July 30, 2024 1

@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.

Asidert avatar Asidert commented on July 30, 2024 1

@nessshon There were errors, but now I catch them and try to reconnect

image

from pytonapi.

nessshon avatar nessshon commented on July 30, 2024

@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.

nessshon avatar nessshon commented on July 30, 2024

@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 (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.