[GH-ISSUE #63] Inconsistent Instagram Network Warnings #48

Closed
opened 2026-02-27 20:05:09 +03:00 by kerem · 5 comments
Owner

Originally created by @tomballgithub on GitHub (Feb 7, 2026).
Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/63

Is it purposeful that not all instagram account errors generate alerts? Sometimes I get emails and webhooks, sometimes I don't.

Here's an example, none of this alerted me. I'd prefer to be able to alert on a configurable # of failures that looks like an instagram account issue (locked, challenge, 429, etc):

[DEBUG 23:26:59] [XXX] BeHuman #1 error: explore peek failed (JSON Query to graphql/query: Giving up after multiple 429/checkpoint)
[DEBUG 23:50:39] [XXX] BeHuman #2 error: cannot view own profile: JSON Query to graphql/query: Giving up after multiple 429/checkpoint
[DEBUG 23:50:45] [XXX] BeHuman #3 error: cannot browse #elon: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/tags/web_info/?__a=1&__d=dis&tag_name=elon

Or this, which I've seen a few times (@ startup [Jan 20]):

* Followings number changed by user YYY from 4393 to 4396 (+3)
* Error while getting followings: QueryReturnedNotFoundException: JSON Query to graphql/query: Giving up after multiple 429/checkpoint

Or this:
* Error, retrying in 1 hour, 1 minute: ConnectionException: JSON Query to api/v1/users/web_profile_info/?username=YYY: 429 Too Many Requests when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=YYY

These did send alerts:

[DEBUG 04:22:23] [YYY] Fetching profile data from Instagram API...
[DEBUG 04:22:31] [YYY] Formatting error message for AbortDownloadException: Redirected to login page. You've been logged out, please wait some time, recreate the session and try again
* Error, retrying in 1 hour, 11 minutes: AbortDownloadException: Redirected to login page. You've been logged out, please wait some time, recreate the session and try again
[DEBUG 04:22:31] [YYY] Full exception: AbortDownloadException: Redirected to login page. You've been logged out, please wait some time, recreate the session and try again
* Session might not be valid anymore!
* Sending email notification to XXX

* Downloading Followers: 56%|███████████████░░░░░░░░░░░░░| 108/191 [8.1 names/req, reqs=12, mins=1.4, remain=1.1]
[DEBUG 03:10:04] [YYY] Formatting error message for ConnectionException: JSON Query to graphql/query: 401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." when accessing https://www.instagram.com/graphql/query?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%2227129100349%22%2C%22first%22%3A12%2C%22after%22%3A%22QVFCaWV3OV9OX0M5eDJuUVNDOXp3VzF6X2lIR0NfX01nb2IyNDJpNXBadEwzYUlBbG02MnBMaUlUS2l0NHJPbTdrRXIzNGxtclZUcVhMNHVlUWRubVI1bQ%3D%3D%22%7D
* Error while processing followers: ConnectionException: JSON Query to graphql/query: 401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." when accessing https://www.instagram.com/graphql/query?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%2227129100349%22%2C%22first%22%3A12%2C%22after%22%3A%22QVFCaWV3OV9OX0M5eDJuUVNDOXp3VzF6X2lIR0NfX01nb2IyNDJpNXBadEwzYUlBbG02MnBMaUlUS2l0NHJPbTdrRXIzNGxtclZUcVhMNHVlUWRubVI1bQ%3D%3D%22%7D
* Sending email notification to XXX
* Error, retrying in 1 hour, 32 minutes: AbortDownloadException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=YYY
* Session might not be valid anymore!
* Sending email notification to XXX
Originally created by @tomballgithub on GitHub (Feb 7, 2026). Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/63 Is it purposeful that not all instagram account errors generate alerts? Sometimes I get emails and webhooks, sometimes I don't. Here's an example, none of this alerted me. I'd prefer to be able to alert on a configurable # of failures that looks like an instagram account issue (locked, challenge, 429, etc): ``` [DEBUG 23:26:59] [XXX] BeHuman #1 error: explore peek failed (JSON Query to graphql/query: Giving up after multiple 429/checkpoint) [DEBUG 23:50:39] [XXX] BeHuman #2 error: cannot view own profile: JSON Query to graphql/query: Giving up after multiple 429/checkpoint [DEBUG 23:50:45] [XXX] BeHuman #3 error: cannot browse #elon: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/tags/web_info/?__a=1&__d=dis&tag_name=elon ``` Or this, which I've seen a few times (@ startup [Jan 20]): ``` * Followings number changed by user YYY from 4393 to 4396 (+3) * Error while getting followings: QueryReturnedNotFoundException: JSON Query to graphql/query: Giving up after multiple 429/checkpoint ``` Or this: `* Error, retrying in 1 hour, 1 minute: ConnectionException: JSON Query to api/v1/users/web_profile_info/?username=YYY: 429 Too Many Requests when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=YYY` These did send alerts: ``` [DEBUG 04:22:23] [YYY] Fetching profile data from Instagram API... [DEBUG 04:22:31] [YYY] Formatting error message for AbortDownloadException: Redirected to login page. You've been logged out, please wait some time, recreate the session and try again * Error, retrying in 1 hour, 11 minutes: AbortDownloadException: Redirected to login page. You've been logged out, please wait some time, recreate the session and try again [DEBUG 04:22:31] [YYY] Full exception: AbortDownloadException: Redirected to login page. You've been logged out, please wait some time, recreate the session and try again * Session might not be valid anymore! * Sending email notification to XXX ``` ``` * Downloading Followers: 56%|███████████████░░░░░░░░░░░░░| 108/191 [8.1 names/req, reqs=12, mins=1.4, remain=1.1] [DEBUG 03:10:04] [YYY] Formatting error message for ConnectionException: JSON Query to graphql/query: 401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." when accessing https://www.instagram.com/graphql/query?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%2227129100349%22%2C%22first%22%3A12%2C%22after%22%3A%22QVFCaWV3OV9OX0M5eDJuUVNDOXp3VzF6X2lIR0NfX01nb2IyNDJpNXBadEwzYUlBbG02MnBMaUlUS2l0NHJPbTdrRXIzNGxtclZUcVhMNHVlUWRubVI1bQ%3D%3D%22%7D * Error while processing followers: ConnectionException: JSON Query to graphql/query: 401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." when accessing https://www.instagram.com/graphql/query?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%2227129100349%22%2C%22first%22%3A12%2C%22after%22%3A%22QVFCaWV3OV9OX0M5eDJuUVNDOXp3VzF6X2lIR0NfX01nb2IyNDJpNXBadEwzYUlBbG02MnBMaUlUS2l0NHJPbTdrRXIzNGxtclZUcVhMNHVlUWRubVI1bQ%3D%3D%22%7D * Sending email notification to XXX ``` ``` * Error, retrying in 1 hour, 32 minutes: AbortDownloadException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=YYY * Session might not be valid anymore! * Sending email notification to XXX ```
kerem 2026-02-27 20:05:09 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tomballgithub commented on GitHub (Feb 8, 2026):

I did not receive an alert for this:

[DEBUG 09:26:37] XXX] Fetching profile data from Instagram API...
[DEBUG 09:26:41] XXX] * Back-off 82s after 400
[DEBUG 09:28:04] XXX] * Back-off 133s after 400
[DEBUG 09:30:19] XXX] * Back-off 259s after 400
JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [retrying; skip with ^C]
[DEBUG 09:34:42] XXX] * Back-off 70s after 400
[DEBUG 09:35:54] XXX] * Back-off 130s after 400
[DEBUG 09:38:08] XXX] * Back-off 245s after 400
JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [retrying; skip with ^C]
[DEBUG 09:42:18] XXX] * Back-off 68s after 400
[DEBUG 09:43:29] XXX] * Back-off 145s after 400
[DEBUG 09:45:57] XXX] * Back-off 247s after 400
[DEBUG 09:50:08] XXX] Formatting error message for QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint
* Error, retrying in 1 hour, 17 minutes: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint
[DEBUG 09:50:08] XXX] Full exception: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint
[DEBUG 09:50:08] XXX] UI Data Update: check_count=1

Timestamp:                              Sun 08 Feb 2026, 09:50:08
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
<!-- gh-comment-id:3867470018 --> @tomballgithub commented on GitHub (Feb 8, 2026): I did not receive an alert for this: ``` [DEBUG 09:26:37] XXX] Fetching profile data from Instagram API... [DEBUG 09:26:41] XXX] * Back-off 82s after 400 [DEBUG 09:28:04] XXX] * Back-off 133s after 400 [DEBUG 09:30:19] XXX] * Back-off 259s after 400 JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [retrying; skip with ^C] [DEBUG 09:34:42] XXX] * Back-off 70s after 400 [DEBUG 09:35:54] XXX] * Back-off 130s after 400 [DEBUG 09:38:08] XXX] * Back-off 245s after 400 JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [retrying; skip with ^C] [DEBUG 09:42:18] XXX] * Back-off 68s after 400 [DEBUG 09:43:29] XXX] * Back-off 145s after 400 [DEBUG 09:45:57] XXX] * Back-off 247s after 400 [DEBUG 09:50:08] XXX] Formatting error message for QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint * Error, retrying in 1 hour, 17 minutes: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [DEBUG 09:50:08] XXX] Full exception: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [DEBUG 09:50:08] XXX] UI Data Update: check_count=1 Timestamp: Sun 08 Feb 2026, 09:50:08 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── ```
Author
Owner

@misiektoja commented on GitHub (Feb 11, 2026):

Yes, these areas were not addressed in the code, I fixed it (23661f4b4c). I also introduced new ERROR_FAILURE_THRESHOLD config option which defines the number of consecutive errors required before triggering an alert to avoid spamming on transient network glitches.

<!-- gh-comment-id:3886533547 --> @misiektoja commented on GitHub (Feb 11, 2026): Yes, these areas were not addressed in the code, I fixed it (23661f4b4c3950a). I also introduced new `ERROR_FAILURE_THRESHOLD` config option which defines the number of consecutive errors required before triggering an alert to avoid spamming on transient network glitches.
Author
Owner

@tomballgithub commented on GitHub (Feb 13, 2026):

Seems to be working. I presume that retries with back-offs do not count as multiple failures, despite all the retries over 20 minutes.

The following did not trigger an error with the threshold set to 2. It DID trigger 10 hours later when attempting to "Fetching profile data from Instagram API..."

[DEBUG 10:51:10] [XXX] Check #2 completed
[DEBUG 10:51:10] [XXX] Probability Calculation: 3.688888888888889
[DEBUG 10:51:10] [XXX] BeHuman: simulation start with probability 1.0 for sleep_seconds of 5312
[DEBUG 10:51:19] [XXX] BeHuman #1: explore feed peek OK
[DEBUG 10:51:28] [XXX] * Back-off 84s after 400
[DEBUG 10:52:54] [XXX] * Back-off 134s after 400
[DEBUG 10:55:09] [XXX] * Back-off 251s after 400
[DEBUG 10:59:30] [XXX] * Back-off 76s after 400
[DEBUG 11:00:49] [XXX] * Back-off 135s after 400
[DEBUG 11:03:06] [XXX] * Back-off 247s after 400
[DEBUG 11:07:21] [XXX] * Back-off 89s after 400
[DEBUG 11:08:53] [XXX] * Back-off 132s after 400
[DEBUG 11:11:08] [XXX] * Back-off 266s after 400
* Warning: It is not easy to be a human, our simulation failed: JSON Query to graphql/query: Giving up after multiple 429/checkpoint****
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[DEBUG 21:44:31] [XXX] Fetching profile data from Instagram API...
[DEBUG 21:44:35] [XXX] * Back-off 71s after 400
[DEBUG 21:45:48] [XXX] * Back-off 132s after 400
[DEBUG 21:48:04] [XXX] * Back-off 253s after 400
[DEBUG 21:52:24] [XXX] * Back-off 82s after 400
[DEBUG 21:53:49] [XXX] * Back-off 124s after 400
[DEBUG 21:55:55] [XXX] * Back-off 255s after 400
[DEBUG 22:00:16] [XXX] * Back-off 81s after 400
[DEBUG 22:01:40] [XXX] * Back-off 128s after 400
[DEBUG 22:03:51] [XXX] * Back-off 267s after 400
[DEBUG 22:08:21] [XXX] Formatting error message for QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint
* Error, retrying in 1 hour, 24 minutes: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint
[DEBUG 22:08:21] [XXX] Full exception: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint
* Sending error notification to YYY (failure 2/2)
<!-- gh-comment-id:3898615505 --> @tomballgithub commented on GitHub (Feb 13, 2026): Seems to be working. I presume that retries with back-offs do not count as multiple failures, despite all the retries over 20 minutes. The following did not trigger an error with the threshold set to 2. It DID trigger 10 hours later when attempting to "Fetching profile data from Instagram API..." ``` [DEBUG 10:51:10] [XXX] Check #2 completed [DEBUG 10:51:10] [XXX] Probability Calculation: 3.688888888888889 [DEBUG 10:51:10] [XXX] BeHuman: simulation start with probability 1.0 for sleep_seconds of 5312 [DEBUG 10:51:19] [XXX] BeHuman #1: explore feed peek OK [DEBUG 10:51:28] [XXX] * Back-off 84s after 400 [DEBUG 10:52:54] [XXX] * Back-off 134s after 400 [DEBUG 10:55:09] [XXX] * Back-off 251s after 400 [DEBUG 10:59:30] [XXX] * Back-off 76s after 400 [DEBUG 11:00:49] [XXX] * Back-off 135s after 400 [DEBUG 11:03:06] [XXX] * Back-off 247s after 400 [DEBUG 11:07:21] [XXX] * Back-off 89s after 400 [DEBUG 11:08:53] [XXX] * Back-off 132s after 400 [DEBUG 11:11:08] [XXX] * Back-off 266s after 400 * Warning: It is not easy to be a human, our simulation failed: JSON Query to graphql/query: Giving up after multiple 429/checkpoint**** ``` ``` ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── [DEBUG 21:44:31] [XXX] Fetching profile data from Instagram API... [DEBUG 21:44:35] [XXX] * Back-off 71s after 400 [DEBUG 21:45:48] [XXX] * Back-off 132s after 400 [DEBUG 21:48:04] [XXX] * Back-off 253s after 400 [DEBUG 21:52:24] [XXX] * Back-off 82s after 400 [DEBUG 21:53:49] [XXX] * Back-off 124s after 400 [DEBUG 21:55:55] [XXX] * Back-off 255s after 400 [DEBUG 22:00:16] [XXX] * Back-off 81s after 400 [DEBUG 22:01:40] [XXX] * Back-off 128s after 400 [DEBUG 22:03:51] [XXX] * Back-off 267s after 400 [DEBUG 22:08:21] [XXX] Formatting error message for QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint * Error, retrying in 1 hour, 24 minutes: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint [DEBUG 22:08:21] [XXX] Full exception: QueryReturnedNotFoundException: JSON Query to web/search/topsearch/: Giving up after multiple 429/checkpoint * Sending error notification to YYY (failure 2/2) ```
Author
Owner

@misiektoja commented on GitHub (Feb 14, 2026):

Yes, back-offs are not reported as errors by Instaloader. It is just retrying and eventually it returns the error that we can catch and report.

I redesigned the ERROR_FAILURE_THRESHOLD logic a little bit and implemented separate error counters for BeHuman simulation and main monitoring (48b18b847c).

<!-- gh-comment-id:3901974615 --> @misiektoja commented on GitHub (Feb 14, 2026): Yes, back-offs are not reported as errors by Instaloader. It is just retrying and eventually it returns the error that we can catch and report. I redesigned the ERROR_FAILURE_THRESHOLD logic a little bit and implemented separate error counters for BeHuman simulation and main monitoring (48b18b847c21a9bcc).
Author
Owner

@tomballgithub commented on GitHub (Feb 21, 2026):

Looks good.

<!-- gh-comment-id:3938235074 --> @tomballgithub commented on GitHub (Feb 21, 2026): Looks good.
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/instagram_monitor#48
No description provided.