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

Stuck on importing, "no such table: volumes" sqlite error #219

Open
SeanOMik opened this issue Dec 13, 2024 · 4 comments
Open

Stuck on importing, "no such table: volumes" sqlite error #219

SeanOMik opened this issue Dec 13, 2024 · 4 comments
Labels
bug Report of something not working as expected waiting for response Stuck because waiting on OP to respond to questions

Comments

@SeanOMik
Copy link

Description of the bug

Recently, some comics I've tried to download get stuck on the "Importing" status at 100%. I checked logs and saw this:

[22:50:06][ERROR] An error occured while trying to run a task:
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ~~~~^^^^^^^^^^^^^^^
  File "/app/backend/helpers.py", line 488, in pool_map_func
    return func(value)
  File "/app/backend/volumes.py", line 1171, in map_scan_files
    return scan_files(*a)
  File "/app/backend/volumes.py", line 1005, in scan_files
    volume_data = volume.get_keys((
        'id', 'volume_number', 'year',
        'folder', 'root_folder',
        'special_version'
    ))
  File "/app/backend/volumes.py", line 809, in get_keys
    data = self._get_keys(keys)
  File "/app/backend/volumes.py", line 403, in _get_keys
    get_db(dict).execute(
    ~~~~~~~~~~~~~~~~~~~~^
        f"SELECT {','.join(keys)} FROM volumes WHERE id = ? LIMIT 1;",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        (self.id,)
        ^^^^^^^^^^
    ).fetchone()
    ^
sqlite3.OperationalError: no such table: volumes
"""

If I restart kapowarr, the comic issue gets imported, but there's a high chance that the next issue in that series gets stuck as well. The comic series I know that is causing this issue is Radiant Black 2021, but I've had it happen with other series. When the single issue gets stuck, the entire queue gets stuck.

To Reproduce

Enable downloading from GetComics and try to import Radiant Black 2021. Wait for it to finish downloading, see that it gets stuck at 100% and importing. Check logs for the sqlite error.

Expected behavior

I expect for the issue to import.

Version info

Version: v1.0.0
Python version: 3.13.0
Database version: 27

@SeanOMik SeanOMik added the bug Report of something not working as expected label Dec 13, 2024
@Casvt
Copy link
Owner

Casvt commented Dec 15, 2024

If possible, could you try running Kapowarr with a lower version of Python? Something like 3.10 or 3.8. If it then works, then we now where the problem lies.

@SeanOMik
Copy link
Author

Sorry, got busy with end of year things and forgot to respond here! Changing python to 3.10 fixed the issue, thanks!

@SeanOMik
Copy link
Author

Actually, its still happening. This time when trying to download and import "Wolverine: Origins"

@SeanOMik SeanOMik reopened this Dec 29, 2024
@Casvt
Copy link
Owner

Casvt commented Jan 15, 2025

Can you do something for me? Go to the file backend/server.py, and at the bottom you'll find the setup_process function. Please alter the order of the lines so that it goes from this (indentation done with 4 spaces):

def setup_process(log_level: int) -> Callable[[], AppContext]:
    set_db_location()
    setup_logging(do_rollover=False)
    set_log_level(log_level)

    app = Flask(__name__)
    app.teardown_appcontext(close_db)
    return app.app_context

To this:

def setup_process(log_level: int) -> Callable[[], AppContext]:
    setup_logging(do_rollover=False)
    set_log_level(log_level)
    set_db_location()

    app = Flask(__name__)
    app.teardown_appcontext(close_db)
    return app.app_context

Save the changes. Don't restart the container, if you're using Docker. In the web-UI, go to System -> Status -> Power, and click "Restart". After the application has restarted, set the log level to DEBUG at Settings -> General -> Logging -> Log Level. Then let the error happen. Once it has happened, go to Settings -> General -> Logging, and click "Download Logs". Please share the log file that was downloaded.

@Casvt Casvt moved this to In Progress in Kapowarr plans Jan 16, 2025
@Casvt Casvt added stuck waiting for response Stuck because waiting on OP to respond to questions and removed stuck labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of something not working as expected waiting for response Stuck because waiting on OP to respond to questions
Projects
Status: In Progress
Development

No branches or pull requests

2 participants