Giter Site home page Giter Site logo

Comments (11)

Lonami avatar Lonami commented on July 16, 2024

Did you try commenting out the line I told you?

Edit: Also, I'll revert this change if the suggested fix doesn't work.

from telethon.

chabanovsky avatar chabanovsky commented on July 16, 2024

@Lonami Could you please point me to the line that I should change? Sorry, I could forget to change it.

from telethon.

Lonami avatar Lonami commented on July 16, 2024

Heh this is the third time 😄

The line is the 235 on mtproto_sender.py, under telethon/network, that is, this one :)

from telethon.

chabanovsky avatar chabanovsky commented on July 16, 2024

Oops. I rewrote it during the last pull. Now I commented it out. Testing...

from telethon.

chabanovsky avatar chabanovsky commented on July 16, 2024

Got the following error


WARNING:root:Message ack confirmed a request
WARNING:root:Read RPC error: (RPCError(...), 'A wait of 16 seconds is required.')
Should wait 16s. Sleeping until then.
Exception in thread Updates thread:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 408, in updates_thread_method
    self.send_ping()
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 84, in send_ping
    self.receive(request)
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 138, in receive
    request)
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 221, in process_msg
    return self.handle_container(msg_id, sequence, reader, request)
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 281, in handle_container
    if not self.process_msg(inner_msg_id, sequence, reader, request):
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 243, in process_msg
    return self.handle_update(msg_id, sequence, reader)
  File "/development/Telethon/telethon/network/mtproto_sender.py", line 256, in handle_update
    handler(tlobject)
  File "/development/rudevs/chats/telegram/telegram.py", line 70, in <lambda>
    self.add_update_handler(lambda x: self.update_handler(x, self))
  File "/development/rudevs/chats/telegram/telegram.py", line 175, in update_handler
    lisntener.on_new_message(user, message, channel)
  File "/development/rudevs/chats/telegram/telegram.py", line 157, in on_new_message
    self.sync_telegram()
  File "/development/rudevs/chats/telegram/telegram.py", line 100, in sync_telegram
    self.get_content(channels, self.telegram_on_message_callback)
  File "/development/rudevs/chats/telegram/telegram.py", line 62, in get_content
    entity, limit=self.message_count, min_id=entity.min_id)
  File "/development/Telethon/telethon/telegram_client.py", line 363, in get_message_history
    add_offset=add_offset))
  File "/development/Telethon/telethon/telegram_client.py", line 181, in invoke
    return self.invoke(request, timeout, throw_invalid_dc, tries - 1, expect_result)
  File "/development/Telethon/telethon/telegram_client.py", line 181, in invoke
    return self.invoke(request, timeout, throw_invalid_dc, tries - 1, expect_result)
  File "/development/Telethon/telethon/telegram_client.py", line 181, in invoke
    return self.invoke(request, timeout, throw_invalid_dc, tries - 1, expect_result)
  File "/development/Telethon/telethon/telegram_client.py", line 179, in invoke
    raise ValueError('The result of the invoked request is always None')
ValueError: The result of the invoked request is always None

from telethon.

Lonami avatar Lonami commented on July 16, 2024

This time the error is clear, the main thread did go to sleep after "A wait of 16 seconds is required." was received, but the updates thread did not, I assume the server refused to reply to the ping request or replying a message update? I will add the sleep on the updates thread, revert the last change of retries and ignore the acks…

Edit: By the way @chabanovsky it would be really helpful if you managed to get --telethon-log=DEBUG working. Can you try it with the try_telethon.py? It's strange it's not getting passed to your program, since I use sys.argv to manually check all the arguments passed:
photo_2017-04-11_10-01-45

from telethon.

chabanovsky avatar chabanovsky commented on July 16, 2024

After the last update --telethon-log=DEBUG works for my app too. In the app I do not send anything the server. The app just listens a few channels (I'm going perform some ML/NLP tasks).

from telethon.

Lonami avatar Lonami commented on July 16, 2024

Did this solve after fixing #47?

from telethon.

chabanovsky avatar chabanovsky commented on July 16, 2024

@Lonami I have not seen this error anymore after I updated to upstream and changed code according your recommendations. It seems it was fixed.

from telethon.

Lonami avatar Lonami commented on July 16, 2024

It seems it was fixed.

Alright then, if you don't mind I will close this issue. Feel free to open it again if the bug reappears, or open a new issue if I introduced new bugs :P thanks for the help!

from telethon.

chabanovsky avatar chabanovsky commented on July 16, 2024

Thank you for the library and the help!

from telethon.

Related Issues (20)

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.