Closed renanfilipe closed 6 years ago
This error seems to be different from the one you get when you're disconnected from the network:
Traceback (most recent call last):
File "/home/lonami/Documents/Projects/Python/PyCharm/Telethon/example.py", line 26, in <module>
assert client.connect()
File "/home/lonami/Documents/Projects/Python/PyCharm/Telethon/telethon/telegram_bare_client.py", line 192, in connect
self._sender.connect()
File "/home/lonami/Documents/Projects/Python/PyCharm/Telethon/telethon/network/mtproto_sender.py", line 60, in connect
self.connection.connect(self.session.server_address, self.session.port)
File "/home/lonami/Documents/Projects/Python/PyCharm/Telethon/telethon/network/connection.py", line 100, in connect
self.conn.connect(ip, port)
File "/home/lonami/Documents/Projects/Python/PyCharm/Telethon/telethon/extensions/tcp_client.py", line 70, in connect
self._socket.connect(address)
OSError: [Errno 101] Network is unreachable
But I have never found OSError: [Errno 113] No route to host
and I'm not sure what it means. Neither I know what it can mean by the following:
partial = self._socket.recv(bytes_left)
OSError: [Errno 22] Invalid argument
I had some memory run issues that I think were fixed by adding the save_entities=False on the constructor.
That's strange and shouldn't at all cause the error you described. If you're using recent versions, entities will be saved into a disk-based SQLite database so memory shouldn't be an issue at all. I ran with save_entities=False
and I didn't get such error.
May I ask why did you close?
sure, my boss was running the script in a very old laptop and according to him the wifi driver was outdated and he also had problems with the quality of the wifi signal. so I tested the script in other computers and now it is working fine. thanks for your patience in helping me
Haha nice story. Alright glad it works :)
I have same problem, but inside a docker container. recreating container fixed it. not sure what was the actual problem.
Hey @Bersam, I am also facing the same issues, how did you solved in production environment?, in my case, I have to recreate the session (I am using telemongo, https://pypi.org/project/telemongo/) to save the session. So everytime I need to recreate this session if I face this issue. I am using docker & Sanic to host my application endpoints. @Lonami can you please look into this?
hello, I am trying to build a code which must runs 24/7 and it will redirect all messages from specific channels to one of my channels, here is the code:
I had some memory run issues that I think were fixed by adding the save_entities=False on the constructor. Now I got the following error:
I have no idea of what caused it so I appreciate if you can tell me what may happened and how I can handle it.