Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: 'Message' object has no attribute 'destination' #32

Closed
Nyaran opened this issue Nov 30, 2023 · 10 comments · Fixed by #33
Closed

Error: 'Message' object has no attribute 'destination' #32

Nyaran opened this issue Nov 30, 2023 · 10 comments · Fixed by #33
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Nyaran
Copy link
Owner

Nyaran commented Nov 30, 2023

Originally posted by @shahram7 in #30 (comment)

Hi Luis, i have used this compose file here:

version: '3.5'

services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    environment:
      - VPN_SERVICE_PROVIDER=nordvpn
      - OPENVPN_USER=xxxxxxxxxxxxxxxxxx
      - OPENVPN_PASSWORD=xxxxxxxxxxxxxxxxxxxxx
      - SERVER_REGIONS=Netherlands
    restart: unless-stopped
  tdd:
#    image: alfem/telegram-download-daemon:latest
#    image: nyaran/telegram-download-daemon-ng:main
    image: nyaran/telegram-download-daemon-ng:1.0.0-beta.6
    container_name: telegram-download
    network_mode: service:gluetun
    depends_on:
      - gluetun
    read_only: true
    environment:
      - TELEGRAM_DAEMON_API_ID=xxxxxxxxxxxxxxx
      - TELEGRAM_DAEMON_API_HASH=xxxxxxxxxxxx
      - TELEGRAM_DAEMON_CHANNEL=-xxxxxxxxxxxxx
      - TELEGRAM_DAEMON_DEST=/downloads
      - TELEGRAM_DAEMON_SESSION_PATH=/session
      - TELEGRAM_DAEMON_DUPLICATES=rename
      - TELEGRAM_DAEMON_BOT=xxxxxxxxxxxxxxx
#      - TELEGRAM_DAEMON_WORKERS=4
    volumes:
      - downloads:/downloads
      - sessions:/session
    restart: unless-stopped
    labels:
      - io.portainer.accesscontrol.public
    logging:
      options:
        max-size: 1m
volumes:
    sessions:
    downloads:

thank you very Much for your time and effort. it seems that it works. in the logs i can see just this line

WARNING/2023-11-29 09:51:14,578]telethon.network.mtprotosender:Attempt 1 at connecting failed: TimeoutError:

but when i send a file to my channel i get this message: Error: 'Message' object has no attribute 'destination'

@Nyaran Nyaran added the question Further information is requested label Nov 30, 2023
@Nyaran Nyaran self-assigned this Nov 30, 2023
@Nyaran
Copy link
Owner Author

Nyaran commented Nov 30, 2023

@shahram7 what method are you using to send file to the channel? message link? group link? resend? I tried all methods, and I'm unable to reproduce that error. Can you provide me a step-by-step list to help you to solve the issue? The telegram channel where you are downloading from could be helpful (if is not a private channel, of course)

@shahram7
Copy link

shahram7 commented Dec 1, 2023

HI Luis, I've always tested the daemon with sending a picture from gallery. I use a private channel for the downloader daemon.
Screen_Recording_20231201_092946_Telegram.zip

@Nyaran
Copy link
Owner Author

Nyaran commented Dec 1, 2023

Oh, I see...

Working on it, thanks for the report!

@Nyaran Nyaran added the bug Something isn't working label Dec 1, 2023
Nyaran added a commit that referenced this issue Dec 1, 2023
@Nyaran Nyaran closed this as completed in #33 Dec 1, 2023
@Nyaran
Copy link
Owner Author

Nyaran commented Dec 1, 2023

Please try with 1.0.0-beta.7

docker pull nyaran/telegram-download-daemon-ng:1.0.0-beta.7

@shahram7
Copy link

shahram7 commented Dec 2, 2023

Please try with 1.0.0-beta.7

docker pull nyaran/telegram-download-daemon-ng:1.0.0-beta.7

it works but i managed to download just jpeg files so far!
after sending larger files to the channel nothing is happend!

Received:  NewMessage.Event(original_update=UpdateNewChannelMessage(message=Message(id=1233, peer_id=PeerChannel(channel_id=1000000002), date=datetime.datetime(2023, 12, 2, 11, 54, 26, tzinfo=datetime.timezone.utc), message='queue', out=False, mentioned=False, media_unread=False, silent=True, post=True, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, invert_media=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=None, entities=[], views=1, forwards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None), pts=10829, pts_count=1), pattern_match=None, message=Message(id=1233, peer_id=PeerChannel(channel_id=1000000002), date=datetime.datetime(2023, 12, 2, 11, 54, 26, tzinfo=datetime.timezone.utc), message='queue', out=False, mentioned=False, media_unread=False, silent=True, post=True, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, invert_media=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=None, entities=[], views=1, forwards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None))
Send message link to download or use available commands: list, status, clean.
Received:  NewMessage.Event(original_update=UpdateNewChannelMessage(message=Message(id=1234, peer_id=PeerChannel(channel_id=1000000002), date=datetime.datetime(2023, 12, 2, 11, 54, 43, tzinfo=datetime.timezone.utc), message='status', out=False, mentioned=False, media_unread=False, silent=True, post=True, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, invert_media=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=None, entities=[], views=1, forwards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None), pts=10831, pts_count=1), pattern_match=None, message=Message(id=1234, peer_id=PeerChannel(channel_id=1000000002), date=datetime.datetime(2023, 12, 2, 11, 54, 43, tzinfo=datetime.timezone.utc), message='status', out=False, mentioned=False, media_unread=False, silent=True, post=True, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, invert_media=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=None, entities=[], views=1, forwards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None))
No active downloads
�
d:  NewMessage.Event(original_update=UpdateNewChannelMessage(message=Message(id=1235, peer_id=PeerChannel(channel_id=1000000002), date=datetime.datetime(2023, 12, 2, 11, 55, 11, tzinfo=datetime.timezone.utc), message='', out=False, mentioned=False, media_unread=False, silent=True, post=True, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, invert_media=False, from_id=None, fwd_from=MessageFwdHeader(date=datetime.datetime(2023, 12, 2, 10, 9, 47, tzinfo=datetime.timezone.utc), imported=False, from_id=None, from_name='Max Mustermann', channel_post=None, post_author=None, saved_from_peer=None, saved_from_msg_id=None, psa_type=None), via_bot_id=None, reply_to=None, media=MessageMediaDocument(nopremium=False, spoiler=False, document=Document(id=6000000000000000004, access_hash=-7000000000000000006, file_reference=b'\x02r$,\xd0\x00\x00\x04\xd3ek\x1b\x1f\\Ko\xd5\x05\xdb+\xb0\xe1\xbbd\x96\xe7\x95\x11\xca', date=datetime.datetime(2023, 12, 2, 10, 8, 13, tzinfo=datetime.timezone.utc), mime_type='video/mp4', size=300783035, dc_id=4, attributes=[DocumentAttributeFilename(file_name='20231201_215422.mp4')], thumbs=[], video_thumbs=[]), alt_document=None, ttl_seconds=None), reply_markup=None, entities=[], views=1, forwards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None), pts=10832, pts_count=1), pattern_match=None, message=Message(id=1235, peer_id=PeerChannel(channel_id=1000000002), date=datetime.datetime(2023, 12, 2, 11, 55, 11, tzinfo=datetime.timezone.utc), message='', out=False, mentioned=False, media_unread=False, silent=True, post=True, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, invert_media=False, from_id=None, fwd_from=MessageFwdHeader(date=datetime.datetime(2023, 12, 2, 10, 9, 47, tzinfo=datetime.timezone.utc), imported=False, from_id=None, from_name='Max Mustermann', channel_post=None, post_author=None, saved_from_peer=None, saved_from_msg_id=None, psa_type=None), via_bot_id=None, reply_to=None, media=MessageMediaDocument(nopremium=False, spoiler=False, document=Document(id=6000000000000000004, access_hash=-7161437800881781016, file_reference=b'\x02r$,\xd0\x00\x00\x04\xd3ek\x1b\x1f\\Ko\xd5\x05\xdb+\xb0\xe1\xbbd\x96\xe7\x95\x11\xca', date=datetime.datetime(2023, 12, 2, 10, 8, 13, tzinfo=datetime.timezone.utc), mime_type='video/mp4', size=300783035, dc_id=4, attributes=[DocumentAttributeFilename(file_name='20231201_215422.mp4')], thumbs=[], video_thumbs=[]), alt_document=None, ttl_seconds=None), reply_markup=None, entities=[], views=1, forwards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None))
Events handler error:  'NoneType' object has no attribute 'id'

@Nyaran Nyaran reopened this Dec 2, 2023
@Nyaran
Copy link
Owner Author

Nyaran commented Dec 2, 2023

Sorry, but unable to reproduce, I send many kind of files (mp4, mkv, iso, zip) with different size (6MB, 360MB, 450MB, 600MB and 1,5GB), and the videos tried as normal file and as media file and everything works

The file is uploaded to Telegram properly? Remember that first it will be uploaded to Telegram servers before the message is ready to be read by the bot.

If you can provide more info about the kind of file you are using, I could be able to reproduce the error

  • Type
  • Size
  • Name (replace sensitive information)

@shahram7
Copy link

shahram7 commented Dec 3, 2023

Sorry, but unable to reproduce, I send many kind of files (mp4, mkv, iso, zip) with different size (6MB, 360MB, 450MB, 600MB and 1,5GB), and the videos tried as normal file and as media file and everything works

The file is uploaded to Telegram properly? Remember that first it will be uploaded to Telegram servers before the message is ready to be read by the bot.

If you can provide more info about the kind of file you are using, I could be able to reproduce the error

  • Type
  • Size
  • Name (replace sensitive information)

I have currently problems with my VPN container as well and I am not able to test the daemon downloader properly. Thank you very much for your time and effort.

@shahram7
Copy link

shahram7 commented Dec 20, 2023

Hi Luis, I'm back again. I had to rebuild a VM for my Docker Engine and so on.
I see this message a lot in my log, is it ok?

[WARNING/2023-12-20 08:56:22,742]telethon.network.connection.connection:Server closed the connection: 0 bytes read on a total of 8 expected bytes
[WARNING/2023-12-20 08:58:22,814]telethon.network.connection.connection:Server closed the connection: 0 bytes read on a total of 8 expected bytes
[WARNING/2023-12-20 08:59:22,881]telethon.network.connection.connection:Server closed the connection: 0 bytes read on a total of 8 expected bytes

and when i forward a file lets say a movie or a book from a Bot to my downloader channel i see following in my log:

  File "/usr/src/telegram-download-daemon-ng/src/telegram_download_daemon_ng/__init__.py", line 132, in handler
    channel=channel_msg.chat.id,

but if I send a file from my phone, like a picture, it works.

I think it's another problem. Should I create a new Issue?
Best regards, Shahram

@Nyaran
Copy link
Owner Author

Nyaran commented Jan 6, 2024

Hi! Sorry for my late response.

About the first messages, is about Telegram closing the connection, I'll try to check if we are making too many connections, anyway, is a warning message, so, if you are not having problems, you can ignore it.

About the second message, that is just the stacktrace, pointing the place in code when the error occurs, but not the error itself, There are line around that could be related, can you paste that lines too?

Lastly, to understand better your use case. You are in a channel, where a bot sends files, and you want to download that files? Be sure that you, or the account or bot you are setting up for the daemon, are joined to the group

@Nyaran
Copy link
Owner Author

Nyaran commented Nov 11, 2024

Hi,

that last error seems the same that #55, closing this issue, as the original issue was resolved

@Nyaran Nyaran closed this as completed Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants