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

Crash on comicvine parsing during library import: ValueError invalid literal #161

Closed
abartov opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@abartov
Copy link

abartov commented May 3, 2024

Description of the bug

Attempting to import a small library, Kapowarr silently crashes (the browser hangs). The logs show this stack, which I interpret to mean a parsing bug on the Comicvine output:

[2024-05-03 23:30:31][waitress-1][INFO] Loading library import
[2024-05-03 23:30:44][waitress-1][ERROR] Exception on /api/libraryimport [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/app/frontend/api.py", line 64, in wrapper
    return method(*args, **kwargs)
  File "/app/frontend/api.py", line 207, in wrapper
    result = method(*args, **kwargs)
  File "/app/frontend/api.py", line 398, in api_library_import
    result = propose_library_import(limit, only_english)
  File "/app/backend/library_import.py", line 174, in propose_library_import
    search_results = run(__search_matches(
  File "/usr/local/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/app/backend/library_import.py", line 37, in __search_matches
    responses = await gather(*tasks)
  File "/app/backend/comicvine.py", line 600, in search_volumes_async
    return self.__process_search_results(query, results)
  File "/app/backend/comicvine.py", line 486, in __process_search_results
    results = [self.__format_volume_output(r) for r in results]
  File "/app/backend/comicvine.py", line 486, in <listcomp>
    results = [self.__format_volume_output(r) for r in results]
  File "/app/backend/comicvine.py", line 296, in __format_volume_output
    result['year'] = int(
**ValueError: invalid literal for int() with base 10: '1980>'**

Expected behaviour

Import should succeed. If there's an error, it should report it clearly to the user (not everyone is technical enough to view and understand the stacktrace), and continue with the next file.

Version info

Kapowarr version v1.0.0-beta-4
Python version 3.8.17.final.0
Database version 14

On Docker.

@abartov abartov added the bug Something isn't working label May 3, 2024
@Casvt
Copy link
Owner

Casvt commented May 4, 2024

Fixed in 363304e

@Casvt Casvt closed this as completed May 4, 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
None yet
Development

No branches or pull requests

2 participants