Casvt / Kapowarr

Kapowarr is a software to build and manage a comic book library, fitting in the *arr suite of software.
https://casvt.github.io/Kapowarr/
GNU General Public License v3.0
405 stars 15 forks source link

Download queue is frozen #168

Closed RealHeadshoTT closed 1 day ago

RealHeadshoTT commented 1 month ago

I’m running Kapowarr in widows and the download queue appears to be frozen. It says “Downloading” on the first comic but not doing anything and when I try to delete it, it says “Canceled” but then the next one still just says “Queued” and won’t download. Restarting doesn’t fix the issue either.

Is there anyway to clear the queue?

IMG_0017 IMG_0016

Casvt commented 1 month ago

Is there an error in the logs?

twistedanarky commented 1 month ago

Hey man! Just picked up Kapowarr and it's AWESOME! Had this issue earlier, so figured I'd throw in some help. Looks like they're frozen at 0%, but mine froze at 100%, so could be a different issue. Attempted removing the stuck one and logged the request to delete from queue, but didn't take action. Restarted the app and it recovered fine.

Looks like a db locking issue (at least it was for me):

Exception in thread Download Handler: Traceback (most recent call last): File "C:\Users\ricks\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "C:\Users\ricks\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "C:\kapowarr\backend\download_queue.py", line 110, in __run_download PostProcesser.success(download) File "C:\kapowarr\backend\post_processing.py", line 240, in success cls._run_actions(cls.actions_success, download) File "C:\kapowarr\backend\post_processing.py", line 234, in _run_actions action(download) File "C:\kapowarr\backend\post_processing.py", line 29, in remove_from_queue get_db().execute( sqlite3.OperationalError: database is locked

Casvt commented 1 month ago

The issue is most likely already fixed. It probably locked because some other task (like "Update All") was running while importing.

elblanco5 commented 1 month ago

I had a similar problem and noticed the following things:

1) I got a few errors during container startup mostly "Unable to extract download links from source; fail_reason="No links found that match to volume and are not blocklisted""

and then a "An error occured while trying to run a task:" with a Traceback (I'll put it at the bottom of this).

2) The download queue showed a bunch of things to download, all at 0% and nothing moving.

What's seemed to have made some resolution? I clicked "update all" on the volumes tab, which seems to have kickstarted the downloads again.

Here's the entire startup log dump after the errors start:

2024-08-05 19:30:01 kapowarr  | [23:30:01][INFO] Adding download for volume 65: https://getcomics.org/marvel/uncanny-x-men-the-variant-covers-1-2020/
2024-08-05 19:30:02 kapowarr  | [23:30:02][WARNING] Unable to extract download links from source; fail_reason="No links found that match to volume and are not blocklisted"
2024-08-05 19:30:02 kapowarr  | [23:30:02][INFO] Adding download for volume 74: https://getcomics.org/marvel/new-mutants-21-2021/
2024-08-05 19:30:04 kapowarr  | [23:30:04][WARNING] Unable to extract download links from source; fail_reason="No links found that match to volume and are not blocklisted"
2024-08-05 19:30:04 kapowarr  | [23:30:04][INFO] Adding download for volume 180: https://getcomics.org/marvel/x-men-archives-featuring-captain-britain-1-7-1995-1996/
2024-08-05 19:30:04 kapowarr  | [23:30:04][INFO] Download already in queue
2024-08-05 19:30:04 kapowarr  | [23:30:04][INFO] Adding download for volume 290: https://getcomics.org/marvel/x-men-alpha-flight-vol-2-1-2-1988/
2024-08-05 19:30:04 kapowarr  | [23:30:04][INFO] Download already in queue
2024-08-05 19:30:04 kapowarr  | [23:30:04][INFO] Adding download for volume 385: https://getcomics.org/marvel/deadpool-1-2019/
2024-08-05 19:30:05 kapowarr  | [23:30:05][WARNING] Unable to extract download links from source; fail_reason="No links found that match to volume and are not blocklisted"
2024-08-05 19:30:05 kapowarr  | [23:30:05][INFO] Adding download for volume 396: https://getcomics.org/marvel/deadpool-verse-deadpool-corps-tpb-2024/
2024-08-05 19:30:05 kapowarr  | [23:30:05][INFO] Download already in queue
2024-08-05 19:30:05 kapowarr  | [23:30:05][INFO] Adding download for volume 449: https://getcomics.org/other-comics/groo-wanderer-vol-1-1-8-1982-1984/
2024-08-05 19:30:05 kapowarr  | [23:30:05][INFO] Download already in queue
2024-08-05 19:30:05 kapowarr  | [23:30:05][INFO] Adding download for volume 483: https://getcomics.org/other-comics/hellboy-and-the-b-p-r-d-1-5-tpb-2014-2015/
2024-08-05 19:30:08 kapowarr  | [23:30:08][WARNING] Issue with given ID not found
2024-08-05 19:30:08 kapowarr  | [23:30:08][ERROR] An error occured while trying to run a task: 
2024-08-05 19:30:08 kapowarr  | Traceback (most recent call last):
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/tasks.py", line 463, in __run_task
2024-08-05 19:30:08 kapowarr  |     self.download_handler.add(*download)
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/download_queue.py", line 405, in add
2024-08-05 19:30:08 kapowarr  |     GC_downloads, fail_reason = extract_GC_download_links(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/getcomics.py", line 665, in extract_GC_download_links
2024-08-05 19:30:08 kapowarr  |     result = _test_paths(link_paths, volume_id)
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/getcomics.py", line 566, in _test_paths
2024-08-05 19:30:08 kapowarr  |     name = _generate_name(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/getcomics.py", line 536, in _generate_name
2024-08-05 19:30:08 kapowarr  |     return generate_issue_name(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/naming.py", line 335, in generate_issue_name
2024-08-05 19:30:08 kapowarr  |     issue = Issue.from_volume_and_calc_number(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/volumes.py", line 162, in from_volume_and_calc_number
2024-08-05 19:30:08 kapowarr  |     raise IssueNotFound
2024-08-05 19:30:08 kapowarr  | backend.custom_exceptions.IssueNotFound: None
2024-08-05 19:34:54 kapowarr  | [23:34:54][INFO] Added task: Update All (1)
2024-08-05 19:34:57 kapowarr  | [23:34:57][INFO] Finished task Update All
2024-08-05 20:32:38 kapowarr  | [00:32:38][INFO] Starting up Kapowarr
2024-08-05 20:32:40 kapowarr  | [00:32:40][INFO] Kapowarr running on http://0.0.0.0:5656
Casvt commented 1 month ago

I don't know what version you're running, but since beta-4, I've been improving the download queue and it's problems; haven't had problems with it since. So you'll probably just have to wait it out until the next release.

In the mean time, if the queue gets stuck and you want to clear and reset it, you can do the following (assuming you're using Docker):

  1. Have the container running
  2. Run the following commands:
docker exec -it kapowarr /bin/bash

python3 -c "import sqlite3; sqlite3.connect('db/Kapowarr.db').cursor().execute('DELETE FROM download_queue').connection.commit()"

exit

That's three commands.

  1. Restart the container.
Casvt commented 1 week ago

@elblanco5 the following traceback suggests a file naming format that isn't supported.

Traceback (most recent call last):
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/tasks.py", line 463, in __run_task
2024-08-05 19:30:08 kapowarr  |     self.download_handler.add(*download)
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/download_queue.py", line 405, in add
2024-08-05 19:30:08 kapowarr  |     GC_downloads, fail_reason = extract_GC_download_links(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/getcomics.py", line 665, in extract_GC_download_links
2024-08-05 19:30:08 kapowarr  |     result = _test_paths(link_paths, volume_id)
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/getcomics.py", line 566, in _test_paths
2024-08-05 19:30:08 kapowarr  |     name = _generate_name(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/getcomics.py", line 536, in _generate_name
2024-08-05 19:30:08 kapowarr  |     return generate_issue_name(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/naming.py", line 335, in generate_issue_name
2024-08-05 19:30:08 kapowarr  |     issue = Issue.from_volume_and_calc_number(
2024-08-05 19:30:08 kapowarr  |   File "/app/backend/volumes.py", line 162, in from_volume_and_calc_number
2024-08-05 19:30:08 kapowarr  |     raise IssueNotFound
2024-08-05 19:30:08 kapowarr  | backend.custom_exceptions.IssueNotFound: None

What is the format for the file naming that you're using (see Settings -> Media Management -> Naming)?

Casvt commented 1 day ago

Closing because the main topic of this issue has been fixed in V1.0.0 and the unrelated topic (possibly unsupported file format) is not getting a response

elblanco5 commented 23 hours ago

@Casvt ack! Apologies for being slow :(

I'm using this

{series_name} ({year}) Volume {volume_number} Issue {issue_number}

It looks like this issue is fixed/closed anyways, just putting in for posterity.