Menu

#100 [bug] The instagram chat is broken 'MessageReactions' object is not subscriptable and 1 validation error for ReplyMessage`

closed
nobody
bug (44)
2025-08-14
2025-08-03
Anonymous
No

Originally created by: VerdantEli

Describe the bug
Causes an error when I try to access my chats

To Reproduce
Steps to reproduce the behavior:

  • Enter instagram chat search -u '#username'

Output:

> instagram chat search -u leoindreamland
An error occurred when running the app: 'MessageReactions' object is not subscriptable`
  • Enter instagram chat start

Output:

> instagram chat start
An error occurred when running the app: 1 validation error for ReplyMessage
visual_media.expiring_media_action_summary.timestamp
  Input should be a valid datetime, dates after 9999 are not supported as unix timestamps [type=datetime_parsing, input_value=1751378558000000, input_type=int]
    For further information visit https://errors.pydantic.dev/2.11/v/datetime_parsing

Desktop

  • OS: Arch Linux (hyprland)

Related

Tickets: #107

Discussion

  • Anonymous

    Anonymous - 2025-08-03

    Originally posted by: supreme-gg-gg

    This seems related to [#94], Instagram does not have official API so this is a instagrapi bug, we plan to implement some error handling for these cases soon!

     

    Related

    Tickets: #94

  • Anonymous

    Anonymous - 2025-08-03

    Ticket changed by: supreme-gg-gg

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2025-08-03

    Ticket changed by: supreme-gg-gg

    • status: closed --> open
     
  • Anonymous

    Anonymous - 2025-08-03

    Originally posted by: supreme-gg-gg

    This field on ReplyMessage seems to be added on the new version (2.2.1), since I've reverted instagrapi to the previous version (2.1.3.) let me know if this happens again

     
  • Anonymous

    Anonymous - 2025-08-03

    Originally posted by: VerdantEli

    The instagram chat search -u '#username' works now so thanks for that!!

    Though the instagram chat start is the only one broken and now shows a new error.

    Error: 'NoneType' object has no attribute 'get'
    ==================================================
    Traceback (most recent call last):
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagram/chat.py", line 57, in start_chat
        curses.wrapper(init_chat)
        ~~~~~~~~~~~~~~^^^^^^^^^^^
      File "/usr/lib/python3.13/curses/__init__.py", line 94, in wrapper
        return func(stdscr, *args, **kwds)
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagram/chat.py", line 54, in init_chat
        return main_loop(screen, client, username, search_filter)
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagram/chat.py", line 96, in main_loop
        with_loading_screen(
        ~~~~~~~~~~~~~~~~~~~^
            screen,
            ^^^^^^^
        ...<3 lines>...
            text="Loading chat data",
            ^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagram/utils/loading.py", line 36, in with_loading_screen
        result = func(*args, **kwargs)
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagram/api/direct_messages.py", line 75, in fetch_chat_data
        res, self.chats_cursor = direct_threads_chunk(
                                 ~~~~~~~~~~~~~~~~~~~~^
            self.client.insta_client,
            ^^^^^^^^^^^^^^^^^^^^^^^^^
            amount=num_chats,
            ^^^^^^^^^^^^^^^^^
            thread_message_limit=num_message_limit,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagram/api/utils.py", line 214, in direct_threads_chunk
        threads_chunk, cursor = self.direct_threads_chunk(
                                ~~~~~~~~~~~~~~~~~~~~~~~~~^
            selected_filter, box, thread_message_limit, cursor
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagrapi/mixins/direct.py", line 153, in direct_threads_chunk
        threads.append(extract_direct_thread(thread))
                       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagrapi/extractors.py", line 288, in extract_direct_thread
        data["inviter"] = extract_user_short(data["inviter"])
                          ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/home/verdanteli/.local/share/pipx/venvs/instagram-cli/lib/python3.13/site-packages/instagrapi/extractors.py", line 195, in extract_user_short
        data["pk"] = data.get("id", data.get("pk", None))
                     ^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'get'```
    
     
  • Anonymous

    Anonymous - 2025-08-03

    Originally posted by: supreme-gg-gg

    Instagrapi already fixed this on 2.1.5 (https://github.com/subzeroid/instagrapi/pull/2159) but I didn't see this version since it's not listed on the releases page 💀. For now you can fix this by upgrading instagrapi: pip install instagrapi==2.1.5 and this error should be gone or I will make a new release soon.

    It might show this but it's fine since the CLI's version is still pinned to 2.1.3:

    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    instagram-cli 1.3.6 requires instagrapi==2.1.3, but you have instagrapi 2.1.5 which is incompatible.
    instagram-cli 1.3.6 requires pydantic==2.10.1, but you have pydantic 2.11.5 which is incompatible.
    

    Sorry for my oversight!

     
  • Anonymous

    Anonymous - 2025-08-04

    Originally posted by: VerdantEli

    Hmmmm I'm not too sure if it didn't install properly (I probably didn't) but doing pipx install instagrapi==2.1.5 doesn't fix the issue. I think ill just wait for your next release since the chatting by username works anyways. Thank you so much for your efforts!!

     
  • Anonymous

    Anonymous - 2025-08-06

    Originally posted by: supreme-gg-gg

    Did you upgrade instagrapi in the same venv / conda environment where instagram-cli is installed? Try which pipx or which instagram-cli. Upgrading should have fixed the NoneType error based on what I saw in the code. I cannot reproduce this error (it depends on the chat content sometimes) so unfortunately there's no way I can validate, let me know if it doesn't work and I'll try to dig up a solution

     
  • Anonymous

    Anonymous - 2025-08-07

    Originally posted by: VerdantEli

    Hello! sorry i've been unavailable. I tried executing what you said and I am not sure if i'm doing it right but here

    doing which pipx shows:
    /usr/bin/pipx

    doing which instagram-cli shows:
    which: no instagram-cli in (/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/verdanteli/.local/bin:/home/verdanteli/.local/bin)

    Though when I try to install instagrapi and instagram-cli again, this is what I get:

    pipx install instagrapi==2.1.5
    'instagrapi' already seems to be installed. Not modifying existing installation in
    '/home/verdanteli/.local/share/pipx/venvs/instagrapi'. Pass '--force' to force installation.
    
    pipx install instagram-cli
    'instagram-cli' already seems to be installed. Not modifying existing installation in
    '/home/verdanteli/.local/share/pipx/venvs/instagram-cli'. Pass '--force' to force installation.
    

    I'm not really sure with what this could all of mean. Could it be that instagrapi and instagram-cli are working independently and the upgrade didn't work? i dont know hehehe

     
  • Anonymous

    Anonymous - 2025-08-07

    Originally posted by: supreme-gg-gg

    You're right I just wanted to see if they're installed at two separate venv, which <command> basically shows where it is installed. For Instagram-cli it says not found because the command is called instagram so you need to do which instagram.

    But it seems like it's installed properly, I'll check again and make a new release. Sorry for the delay since I was trying to see if the latest instagrapi is stable or not.

     
  • Anonymous

    Anonymous - 2025-08-14

    Ticket changed by: supreme-gg-gg

    • status: open --> closed
     

Log in to post a comment.

Auth0 Logo