psylopunk / pytonlib

Simple python client for The Open Network
https://pydocs.xton.me/
MIT License
93 stars 19 forks source link

AttributeError: 'TLObject' object has no attribute 'config_info' #13

Closed jemeraldo closed 2 years ago

jemeraldo commented 2 years ago

I faced with strange exception, which appears with call get_transactions method of the account object:

account = await self._client.find_account(inv_address)
txs = await account.get_transactions(limit=1000)

In my log:

2022-07-24 21:10:58 - ERROR - Task exception was never retrieved
future: <Task finished name='Task-15' coro=<TonlibMethods.reconnect() done, defined at d:\projects\python\giveme_vpn\env\lib\site-packages\ton\client\tonlib_methods.py:124> exception=AttributeError("'TLObject' object has no attribute 'config_info'")>
Traceback (most recent call last):
  File "d:\projects\python\giveme_vpn\env\lib\site-packages\ton\client\tonlib_methods.py", line 135, in reconnect
    await self.init_tonlib()
  File "d:\projects\python\giveme_vpn\env\lib\site-packages\ton\client\tonlib_methods.py", line 122, in init_tonlib
    self.config_info = r.config_info
AttributeError: 'TLObject' object has no attribute 'config_info'

The strangeness in that the exception appears sometimes, not with every method call.

I don't know if it's my fault in my code or not. I will be appreciate any thoughts about that.

psylopunk commented 2 years ago

https://github.com/psylopunk/pytonlib/issues/4#issuecomment-1136290854

I haven't come up with an elegant solution for this yet. You need to figure out why this is happening and to do this, try what is said on the link. In addition, there is a page where it is described in more detail about ways to solve problems: https://github.com/psylopunk/pytonlib/blob/main/troubleshooting.md

If this does not always happen again, maybe it's just the glitches of the liteserver that you are using. You need to assign ls_index to another one in TonlibClient.

In the future, if you fail to solve the problem, attach the output from the extended log. AKA verbosity_level :)