[GH-ISSUE #350] Crash while unfollowing users #757

Closed
opened 2026-03-13 22:32:15 +03:00 by kerem · 9 comments
Owner

Originally created by @Jannik098 on GitHub (Jun 21, 2021).
Original GitHub issue: https://github.com/alexal1/Insomniac/issues/350

Kind of every third users the bot is trying to unfollow I get the crash as you can see in the screenshot. After this the bot restarts Instagram and most of the time can successfully unfollow some users and then gets the same crash again.
image

Originally created by @Jannik098 on GitHub (Jun 21, 2021). Original GitHub issue: https://github.com/alexal1/Insomniac/issues/350 Kind of every third users the bot is trying to unfollow I get the crash as you can see in the screenshot. After this the bot restarts Instagram and most of the time can successfully unfollow some users and then gets the same crash again. ![image](https://user-images.githubusercontent.com/58641072/122782805-4eeaff00-d2b1-11eb-9aa4-3fd9a3dbdefe.png)
kerem closed this issue 2026-03-13 22:32:20 +03:00
Author
Owner

@Jannik098 commented on GitHub (Jun 21, 2021):

Here is the crash zip file
Crash-2021-06-21-16-48-38.zip

<!-- gh-comment-id:865104607 --> @Jannik098 commented on GitHub (Jun 21, 2021): Here is the crash zip file [Crash-2021-06-21-16-48-38.zip](https://github.com/alexal1/Insomniac/files/6687583/Crash-2021-06-21-16-48-38.zip)
Author
Owner

@alexal1 commented on GitHub (Jun 21, 2021):

Hey @Jannik098, did you notice what happens on the screen at this moment?
I see that there's "Back to the followings list" message in logs, but according to screenshot it didn't go there. Maybe some dialog was opened?

Note that you can make the script to record a video for you:

pip3 install -U "uiautomator2[image]" -i https://pypi.doubanio.com/simple

Run Insomniac with --debug:
python start.py ... --debug
<!-- gh-comment-id:865193298 --> @alexal1 commented on GitHub (Jun 21, 2021): Hey @Jannik098, did you notice what happens on the screen at this moment? I see that there's "Back to the followings list" message in logs, but according to screenshot it didn't go there. Maybe some dialog was opened? Note that you can make the script to record a video for you: ``` pip3 install -U "uiautomator2[image]" -i https://pypi.doubanio.com/simple Run Insomniac with --debug: python start.py ... --debug ```
Author
Owner

@novyapp commented on GitHub (Jun 22, 2021):

Same issue happen to me. Script after unfollowing command didn't come back to list with them.

[06/21 15:04:01] Unfollowing @mashry.me...
[06/21 15:04:01] Sleep for 1.96 seconds
[06/21 15:04:11] Back to the followings list.
[06/21 15:04:12] Unfollowed @mashry.me
[06/21 15:04:12] Session progress: 1 unfollowed for the entire session
[06/21 15:04:12] Sleep for 1.12 seconds
[06/21 15:04:15] Next item not found: probably reached end of the screen.
[06/21 15:04:15] Need to scroll now
[06/21 15:04:26] Error - -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd
Traceback (most recent call last):
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 518, in scroll
    self.viewV2.scroll.toEnd(max_swipes=1)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\_selector.py", line 574, in __call__
    return jsonrpc.scrollToEnd(selector, self.vertical,
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 452, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
  File "C:\Users\micno\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 459, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 531, in _jsonrpc_call
    raise err
uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\safely_runner.py", line 19, in wrapper
    func(*args, **kwargs)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\__init__.py", line 78, in job
    unfollow(device=device_wrapper.get(),
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\action_unfollow.py", line 91, in unfollow
    iterate_over_my_followings(device, iteration_callback, iteration_callback_pre_conditions)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 668, in iterate_over_my_followings
    _iterate_over_my_followers_or_followings(device,
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 718, in _iterate_over_my_followers_or_followings
    list_view.scroll(DeviceFacade.Direction.BOTTOM)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 520, in scroll
    raise DeviceFacade.JsonRpcError(e)
insomniac.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd


Error - -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd
Traceback (most recent call last):
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 518, in scroll
    self.viewV2.scroll.toEnd(max_swipes=1)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\_selector.py", line 574, in __call__
    return jsonrpc.scrollToEnd(selector, self.vertical,
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 452, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 459, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 531, in _jsonrpc_call
    raise err
uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\safely_runner.py", line 19, in wrapper
    func(*args, **kwargs)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\__init__.py", line 78, in job
    unfollow(device=device_wrapper.get(),
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\action_unfollow.py", line 91, in unfollow
    iterate_over_my_followings(device, iteration_callback, iteration_callback_pre_conditions)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 668, in iterate_over_my_followings
    _iterate_over_my_followers_or_followings(device,
  File "C:\Users\mxxAppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 718, in _iterate_over_my_followers_or_followings
    list_view.scroll(DeviceFacade.Direction.BOTTOM)
  File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 520, in scroll
    raise DeviceFacade.JsonRpcError(e)
insomniac.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd

<!-- gh-comment-id:865829132 --> @novyapp commented on GitHub (Jun 22, 2021): Same issue happen to me. Script after unfollowing command didn't come back to list with them. ``` [06/21 15:04:01] Unfollowing @mashry.me... [06/21 15:04:01] Sleep for 1.96 seconds [06/21 15:04:11] Back to the followings list. [06/21 15:04:12] Unfollowed @mashry.me [06/21 15:04:12] Session progress: 1 unfollowed for the entire session [06/21 15:04:12] Sleep for 1.12 seconds [06/21 15:04:15] Next item not found: probably reached end of the screen. [06/21 15:04:15] Need to scroll now [06/21 15:04:26] Error - -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd Traceback (most recent call last): File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 518, in scroll self.viewV2.scroll.toEnd(max_swipes=1) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\_selector.py", line 574, in __call__ return jsonrpc.scrollToEnd(selector, self.vertical, File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 452, in __call__ return self.server._jsonrpc_retry_call(self.method, params, File "C:\Users\micno\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 459, in _jsonrpc_retry_call return self._jsonrpc_call(*args, **kwargs) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 531, in _jsonrpc_call raise err uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\safely_runner.py", line 19, in wrapper func(*args, **kwargs) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\__init__.py", line 78, in job unfollow(device=device_wrapper.get(), File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\action_unfollow.py", line 91, in unfollow iterate_over_my_followings(device, iteration_callback, iteration_callback_pre_conditions) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 668, in iterate_over_my_followings _iterate_over_my_followers_or_followings(device, File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 718, in _iterate_over_my_followers_or_followings list_view.scroll(DeviceFacade.Direction.BOTTOM) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 520, in scroll raise DeviceFacade.JsonRpcError(e) insomniac.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd Error - -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd Traceback (most recent call last): File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 518, in scroll self.viewV2.scroll.toEnd(max_swipes=1) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\_selector.py", line 574, in __call__ return jsonrpc.scrollToEnd(selector, self.vertical, File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 452, in __call__ return self.server._jsonrpc_retry_call(self.method, params, File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 459, in _jsonrpc_retry_call return self._jsonrpc_call(*args, **kwargs) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\uiautomator2\__init__.py", line 531, in _jsonrpc_call raise err uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\safely_runner.py", line 19, in wrapper func(*args, **kwargs) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\__init__.py", line 78, in job unfollow(device=device_wrapper.get(), File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\action_runners\unfollow\action_unfollow.py", line 91, in unfollow iterate_over_my_followings(device, iteration_callback, iteration_callback_pre_conditions) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 668, in iterate_over_my_followings _iterate_over_my_followers_or_followings(device, File "C:\Users\mxxAppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\actions_impl.py", line 718, in _iterate_over_my_followers_or_followings list_view.scroll(DeviceFacade.Direction.BOTTOM) File "C:\Users\mxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\insomniac\device_facade.py", line 520, in scroll raise DeviceFacade.JsonRpcError(e) insomniac.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <androidx.test.uiautomator.UiObjectNotFoundException> data: UiSelector[CLASS=android.widget.ListView, RESOURCE_ID=android:id/list], method: scrollToEnd ```
Author
Owner

@alexal1 commented on GitHub (Jun 22, 2021):

@noovy so what exactly happened?

[06/21 15:04:11] Back to the followings list.

Back press just didn't work or it closed something another?

<!-- gh-comment-id:865832141 --> @alexal1 commented on GitHub (Jun 22, 2021): @noovy so what exactly happened? > [06/21 15:04:11] Back to the followings list. Back press just didn't work or it closed something another?
Author
Owner

@novyapp commented on GitHub (Jun 22, 2021):

Just back press, there was no popup from instagram.

<!-- gh-comment-id:865833623 --> @novyapp commented on GitHub (Jun 22, 2021): Just back press, there was no popup from instagram.
Author
Owner

@alexal1 commented on GitHub (Jun 22, 2021):

@noovy can you record a video please? Right now I don't understand how to fix this.

<!-- gh-comment-id:865835591 --> @alexal1 commented on GitHub (Jun 22, 2021): @noovy can you record a video please? Right now I don't understand how to fix this.
Author
Owner

@novyapp commented on GitHub (Jun 22, 2021):

@alexal1 Here is clip of what happen.

https://gofile.io/d/84nKkw

<!-- gh-comment-id:865869991 --> @novyapp commented on GitHub (Jun 22, 2021): @alexal1 Here is clip of what happen. https://gofile.io/d/84nKkw
Author
Owner

@Jannik098 commented on GitHub (Jun 22, 2021):

I was not able to make the debug screen record work. But for me it's same as @noovy video, it crashes and goes to my phones homescreen and then tries the same process again (going into Instagram, following tab, ...).

<!-- gh-comment-id:865874157 --> @Jannik098 commented on GitHub (Jun 22, 2021): I was not able to make the debug screen record work. But for me it's same as @noovy video, it crashes and goes to my phones homescreen and then tries the same process again (going into Instagram, following tab, ...).
Author
Owner

@alexal1 commented on GitHub (Jul 6, 2021):

Fixed in v3.7.18

<!-- gh-comment-id:874737977 --> @alexal1 commented on GitHub (Jul 6, 2021): Fixed in `v3.7.18`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Insomniac#757
No description provided.