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
456 stars 17 forks source link

Changing Port/Base URL on TrueNAS fails on Startup #179

Closed zehro closed 1 month ago

zehro commented 1 month ago

Description of the bug

On the TrueNAS Scale app catalog, Kapowarr can be installed and runs out of the box. However, changing the port/base URL for reverse proxy reasons results in a failed startup probe. The app stays in "Deploying" status and the user has to manually edit the values in the Kapowarr.db to reset the settings.

To Reproduce

  1. Change port from default '5656' and/or base URL from default ''
  2. Restart Kapowarr
  3. View logs
    2024-09-13 02:32:03.611285-04:00[2024-09-13 06:32:03][MainThread][INFO] Starting up Kapowarr
    2024-09-13 02:32:03.679094-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Inserting task intervals: {'update_all': 3600, 'search_all': 86400}
    2024-09-13 02:32:03.681257-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Inserting blocklist reasons: {1: 'Link broken', 2: 'Source not supported', 3: 'No supported or working links', 4: 'Added by user'}
    2024-09-13 02:32:03.681345-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Inserting credentials sources: ('mega',)
    2024-09-13 02:32:03.681391-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Inserting service preferences: [('mega', 1), ('mediafire', 2), ('getcomics', 3), ('getcomics (torrent)', 4)]
    2024-09-13 02:32:03.682021-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Closing connection <DBConnection; MainThread; 139973363885728>
    2024-09-13 02:32:03.683355-04:00[2024-09-13 06:32:03][Download Importer][DEBUG] Creating connection <DBConnection; Download Importer; 139973352067952>
    2024-09-13 02:32:03.683699-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Creating connection <DBConnection; MainThread; 139973352068224>
    2024-09-13 02:32:03.685508-04:00[2024-09-13 06:32:03][Download Importer][DEBUG] Closing connection <DBConnection; Download Importer; 139973352067952>
    2024-09-13 02:32:03.686478-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Closing connection <DBConnection; MainThread; 139973352068224>
    2024-09-13 02:32:03.686979-04:00[2024-09-13 06:32:03][MainThread][DEBUG] Next interval task is in 471 seconds
    2024-09-13 02:32:03.692395-04:00[2024-09-13 06:32:03][MainThread][INFO] Kapowarr running on http://0.0.0.0:5656/kapowarr/
    2024-09-13 02:37:08.367417-04:00[2024-09-13 06:37:08][MainThread][INFO] Shutting down Kapowarr...
    2024-09-13 02:37:08.369312-04:00[2024-09-13 06:37:08][MainThread][DEBUG] Creating connection <DBConnection; MainThread; 139973363885728>
    2024-09-13 02:37:08.370327-04:00[2024-09-13 06:37:08][MainThread][DEBUG] Closing connection <DBConnection; MainThread; 139973363885728>
    2024-09-13 02:37:08.370906-04:00[2024-09-13 06:37:08][MainThread][DEBUG] Stopping download thread
    2024-09-13 02:37:08.370938-04:00[2024-09-13 06:37:08][MainThread][DEBUG] Stopping task thread

Expected behaviour

Kapowarr should start up normally.

Expected logs (running on default settings):

2024-09-13 02:48:11.211024-04:00[2024-09-13 06:48:11][MainThread][INFO] Starting up Kapowarr
2024-09-13 02:48:11.280587-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Inserting task intervals: {'update_all': 3600, 'search_all': 86400}
2024-09-13 02:48:11.280792-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Inserting blocklist reasons: {1: 'Link broken', 2: 'Source not supported', 3: 'No supported or working links', 4: 'Added by user'}
2024-09-13 02:48:11.280930-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Inserting credentials sources: ('mega',)
2024-09-13 02:48:11.281112-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Inserting service preferences: [('mega', 1), ('mediafire', 2), ('getcomics', 3), ('getcomics (torrent)', 4)]
2024-09-13 02:48:11.283653-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Closing connection <DBConnection; MainThread; 140202274051744>
2024-09-13 02:48:11.285371-04:00[2024-09-13 06:48:11][Download Importer][DEBUG] Creating connection <DBConnection; Download Importer; 140202262233968>
2024-09-13 02:48:11.285608-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Creating connection <DBConnection; MainThread; 140202262234240>
2024-09-13 02:48:11.288338-04:00[2024-09-13 06:48:11][Download Importer][DEBUG] Closing connection <DBConnection; Download Importer; 140202262233968>
2024-09-13 02:48:11.289393-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Closing connection <DBConnection; MainThread; 140202262234240>
2024-09-13 02:48:11.289476-04:00[2024-09-13 06:48:11][MainThread][DEBUG] Next interval task is in 1544 seconds
2024-09-13 02:48:11.300616-04:00[2024-09-13 06:48:11][MainThread][INFO] Kapowarr running on http://0.0.0.0:5656/
2024-09-13 02:50:28.021356-04:00[2024-09-13 06:50:28][waitress-9][DEBUG] GET /api/volumes
2024-09-13 02:50:28.042546-04:00[2024-09-13 06:50:28][waitress-2][DEBUG] GET /api/volumes/stats
2024-09-13 02:50:28.052815-04:00[2024-09-13 06:50:28][waitress-9][DEBUG] Creating connection <DBConnection; waitress-9; 140202274051744>
2024-09-13 02:50:28.052956-04:00[2024-09-13 06:50:28][waitress-2][DEBUG] Creating connection <DBConnection; waitress-2; 140202262234784>
2024-09-13 02:50:28.155095-04:00[2024-09-13 06:50:28][waitress-0][DEBUG] Creating connection <DBConnection; waitress-0; 140202262235056>

... and so on.

Screenshots

N/A

Version info

Kapowarr version    v1.0.0-beta-4
Python version  3.8.17.final.0
Database version    14
Database location   /app/db/Kapowarr.db
Data folder     /app

Running this as an app on TrueNAS SCALE (Dragonfish-24.04.1.1). Not really docker; more kubernetes until Electric Eel release.

Additional context

Related Kubernetes Events

2024-09-13 02:32:13
Startup probe failed: HTTP probe failed with statuscode: 404
2024-09-13 02:32:02
Created container kapowarr
Casvt commented 1 month ago

It might be because, similar to with Docker containers, the mapping of the "container" should be changed instead of the settings in Kapowarr.

P.S. the app should be updated to use version v1.0.0 instead of the older v1.0.0-beta-4

zehro commented 1 month ago

@Casvt I see. The chart listing is outdated (https://github.com/truenas/charts/blob/master/library/ix-dev/community/kapowarr/values.yaml)

I will attempt to install a custom docker image from https://hub.docker.com/r/mrcas/kapowarr, as it says it was updated 10 days ago. I will report back after seeing how it goes!

Edit: If you can also answer this question, what environment variable should I provide for a new base URL?

Casvt commented 1 month ago

You don't set the base URL using an environment variable. You set it using the settings in the web-UI.

Berserkir-Wolf commented 1 month ago

Right - there are two things that are a little difficult there.

Changing the port a containerised application is reachable via should be done via the 'app' in Truenas (similar to a port forward - think of the host as the router, and the container as the device).

The baseurl is done via the app itself, as it changes how it generates, listens to and replies to addresses for a proxy.

URL related - application. Port related - host.