GramAddict / bot

Completely free and open-source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any Android device 5.0+ that can run Instagram - real or emulated.
https://docs.gramaddict.org
MIT License
1.16k stars 185 forks source link

A lot of crashes in a short period #305

Open kalilfagundes opened 1 year ago

kalilfagundes commented 1 year ago

Bot is crashing constantly in a short period of time, usually when liking someone pictures.

Environment:

Relevant Logs:

[04/27 09:45:24]    DEBUG | Press back button. (device_facade.py:131)
[04/27 09:45:24]    DEBUG | 2.66s sleep (utils.py:442)
[04/27 09:45:27]     INFO | Going to the next post. (handle_sources.py:436)
[04/27 09:45:27]     INFO | Scroll down to see next post. (views.py:486)
[04/27 09:45:27]    DEBUG | Can't find the gap obj, scroll down a little more. (views.py:493)
[04/27 09:45:28]    DEBUG | Swipe from: (332,913) to (355,452). (device_facade.py:303)
[04/27 09:45:29]    DEBUG | 0.89s sleep (utils.py:442)
[04/27 09:45:30]    DEBUG | Can't find the gap obj, scroll down a little more. (views.py:493)
[04/27 09:45:31]    DEBUG | Swipe from: (315,459) to (377,234). (device_facade.py:303)
[04/27 09:45:32]    DEBUG | 0.3s sleep (utils.py:442)
[04/27 09:45:33]    DEBUG | Can't find the gap obj, scroll down a little more. (views.py:493)
[04/27 09:45:33]    DEBUG | Swipe from: (389,246) to (383,126). (device_facade.py:303)
[04/27 09:45:34]    DEBUG | 0.77s sleep (utils.py:442)
[04/27 09:45:36]    ERROR | Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\GramAddict\core\device_facade.py", line 617, in get_bounds
    return self.viewV2.info["bounds"]
           ^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\retry\api.py", line 73, in retry_decorator
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\retry\api.py", line 33, in __retry_internal
    return f()
           ^^^
  File "C:\Python311\Lib\site-packages\uiautomator2\_selector.py", line 130, in info
    return self.jsonrpc.objInfo(self.selector)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\uiautomator2\__init__.py", line 480, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\uiautomator2\__init__.py", line 487, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\uiautomator2\__init__.py", line 556, in _jsonrpc_call
    raise err
uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[RESOURCE_ID_REGEX=com.instagram.android:id/gap_view|com.instagram.android:id/footer_space], method: objInfo

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\GramAddict\core\decorators.py", line 31, in wrapper
    func(*args, **kwargs)
  File "C:\Python311\Lib\site-packages\GramAddict\plugins\interact_hashtag_likers.py", line 109, in job
    self.handle_hashtag(
  File "C:\Python311\Lib\site-packages\GramAddict\plugins\interact_hashtag_likers.py", line 187, in handle_hashtag
    handle_likers(
  File "C:\Python311\Lib\site-packages\GramAddict\core\handle_sources.py", line 437, in handle_likers
    PostsViewList(device).swipe_to_fit_posts(SwipeTo.NEXT_POST)
  File "C:\Python311\Lib\site-packages\GramAddict\core\views.py", line 524, in swipe_to_fit_posts
    obj1 = gap_view_obj.get_bounds()["bottom"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\GramAddict\core\device_facade.py", line 619, in get_bounds
    raise DeviceFacade.JsonRpcError(e)
GramAddict.core.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[RESOURCE_ID_REGEX=com.instagram.android:id/gap_view|com.instagram.android:id/footer_space], method: objInfo
 (decorators.py:116)
HairyDuck commented 1 year ago

Ditto!

[04/28 10:46:15]     INFO | This post has 12 like(s).
[04/28 10:46:16]     INFO | Post already liked, SKIP.
[04/28 10:46:19]     INFO | Scroll down to see next post.
[04/28 10:46:29]    ERROR | Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\core\device_facade.py", line 617, in get_bounds
    return self.viewV2.info["bounds"]
           ^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\retry\api.py", line 73, in retry_decorator
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\retry\api.py", line 33, in __retry_internal
    return f()
           ^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\uiautomator2\_selector.py", line 130, in info
    return self.jsonrpc.objInfo(self.selector)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\uiautomator2\__init__.py", line 480, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\uiautomator2\__init__.py", line 487, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\uiautomator2\__init__.py", line 556, in _jsonrpc_call
    raise err
uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[RESOURCE_ID_REGEX=com.instagram.android:id/gap_view|com.instagram.android:id/footer_space], method: objInfo

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\core\decorators.py", line 31, in wrapper
    func(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\plugins\interact_hashtag_posts.py", line 110, in job
    self.handle_hashtag(
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\plugins\interact_hashtag_posts.py", line 179, in handle_hashtag
    handle_posts(
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\core\handle_sources.py", line 657, in handle_posts
    post_view_list.swipe_to_fit_posts(SwipeTo.NEXT_POST)
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\core\views.py", line 524, in swipe_to_fit_posts
    obj1 = gap_view_obj.get_bounds()["bottom"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\GramAddict\core\device_facade.py", line 619, in get_bounds
    raise DeviceFacade.JsonRpcError(e)
GramAddict.core.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[RESOURCE_ID_REGEX=com.instagram.android:id/gap_view|com.instagram.android:id/footer_space], method: objInfo

[04/28 10:46:30]     INFO | Crash saved as crashes\3.2.4_2023-04-28-10-46-29.zip
[04/28 10:46:30]     INFO | If you want to report this crash, please upload the dump file via a ticket in the #lobby channel on discord
[04/28 10:46:30]     INFO | https://discord.gg/66zWWCDM7x
gzepr commented 1 year ago

same here ! instagram app version 282.0.0.22.119 android 9 I was working great yesterday, and not today, in exactly the same conditions (same hardware, emulator, software versions...)

mastrolube commented 1 year ago

Sorry guys but... It's written everywhere that you have to use the suggested version. 282 is the last one. Hierarchy keep changing, can't spend my life upgrading the views and resources. I'll upgrade the bot a little bit with a newer version bot not the last one. Making it working for both old version and new is hard and probably not needed. When you start the bot, it says what is the suggested version to use. Should I force the bot to not start if the version is not the suggested? 🤔 Also even with the same version some of us has different views. It depends on account, dpi, and so on.

Please try that.

Also the recursion is something that happens for that reason (my code is a little bit a shit tbh). I have an updated version that should fix it.