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

Bug: Crashes the queue processing thread when a post from the queue no longer exists in the content sources #67

Closed
1 task done
obervinov opened this issue Jun 9, 2024 · 0 comments · Fixed by #74
Closed
1 task done
Assignees
Labels
bug Something isn't working
Milestone

Comments

@obervinov
Copy link
Owner

obervinov commented Jun 9, 2024

Describe the bug
Crashes the queue processing thread when a post from the queue no longer exists in the content sources
Error message:

Exception in thread Thread-queue-handler:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pyinstabot-downloader/app/src/bot.py", line 553, in queue_handler_thread
    download_metadata = downloader.get_post_content(shortcode=post_id)
  File "/home/pyinstabot-downloader/app/src/modules/downloader.py", line 160, in get_post_content
    post = instaloader.Post.from_shortcode(self.instaloader.context, shortcode)
  File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/instaloader/structures.py", line 207, in from_shortcode
    post._node = post._full_metadata
  File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/instaloader/structures.py", line 324, in _full_metadata
    self._obtain_metadata()
  File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/instaloader/structures.py", line 317, in _obtain_metadata
    raise BadResponseException("Fetching Post metadata failed.")
instaloader.exceptions.BadResponseException: Fetching Post metadata failed.

Additional context
Information about where the bug is happening:
None

Possible correction
If you have a possible solution to the bug, please describe it.
Intercept the error with the response "Fetching Post metadata failed" and remove such a post from the queue (mark it as "processed" and move it to the appropriate table), but in the statuses of the processing process reflect the error with a separate state (it is important not to lose the history, but at the same time do not try to download).

Screenshots
None

Check list after fixing the bug

  • This exception is handled correctly and does not cause the queue processing thread to crash
@obervinov obervinov added the bug Something isn't working label Jun 9, 2024
@obervinov obervinov self-assigned this Jun 9, 2024
@obervinov obervinov added this to the v2.1.6 milestone Jun 17, 2024
@obervinov obervinov linked a pull request Jun 17, 2024 that will close this issue
obervinov pushed a commit that referenced this issue Jun 17, 2024
@obervinov obervinov linked a pull request Jun 18, 2024 that will close this issue
obervinov pushed a commit that referenced this issue Jun 22, 2024
## v2.1.6 - 2024-06-22
### What's Changed
**Full Changelog**: v2.1.5...v2.1.6 by @obervinov in #70
#### 💥 Breaking Changes
* remove unused database `environment` attribute permanent path in the Vault: `configurations/database`
* remove unused environment variable `PROJECT_ENVIRONMENT`
* the automatic queue verification mechanism has been removed. Instead of this method, added functionality to update the queue processing time via a message to the bot
* change the structure of the table `messages`: add a new column `state` and `updated_at`, rename column `timestamp` to `created_at`
#### 🐛 Bug Fixes
* #69
* #62
* #67
* #64
* #65
* Removed duplicates in rights checking
* Small refactoring code
#### 🚀 Features
* Bump dependency versions for modules and workflows
* Add button for rescheduling the queue
@obervinov obervinov modified the milestones: v2.1.6, v2.1.7 Jul 14, 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
Projects
1 participant