TrimVis / butlarr

Telegram bot to interact with various arr services. Created with extensibility in mind.
MIT License
74 stars 3 forks source link

Issue after interactive setup #14

Open kafisatz opened 1 week ago

kafisatz commented 1 week ago

See image I cannot quite tell what the issue is. but I cannot find any config.yaml, so it seems no files were created.

I note that I ran this command: bernhard@dockervm:~/docker/butlarr$ docker run -it -e BUTLARR_INTERACTIVE_SETUP=true trimforce/butlarr:latest

@TrimVis it is actually not clear to me how I can easiest re-pull the image and restart the service using docker without the need to enter all the details (API keys, passwords) again. Is there a docker run command where I could point to my own config.yaml?

image

TrimVis commented 1 week ago

Hmm, this seems like a python issue... Apparently I used a feature thats not yet available in the docker Image, I will be more careful about that from now on.

And yes you can map your own configuration file, take a look at the docker compose file to see the path (I think its /app/config.yml inside the docker, but you should Double check that)

TrimVis commented 1 week ago

In case you weren't aware you do not need to run the interactive setup everytime, instead you only need to run it once: docker run -it -e BUTLARR_INTERACTIVE_SETUP=true trimforce/butlarr:latest

After that simply leave out the variable or set it to false to not run the setup again. (Also no need for -it as we do not need the interactive session) docker run -e BUTLARR_INTERACTIVE_SETUP=false trimforce/butlarr:latest docker run trimforce/butlarr:latest

To map your config use the docker -v flag: docker run -v ./config.yaml:/app/config.yaml trimforce/butlarr:latest

kafisatz commented 1 week ago

Perfect. That very last line may be worth adding to the README. Personally I run tons of services via docker (and for many others this may be the default too).

TrimVis commented 1 week ago

Hmm, this seems like a python issue... Apparently I used a feature thats not yet available in the docker Image, I will be more careful about that from now on.

I just released a hotfix, running docker pull trimforce/butlarr:latest and restarting your container it should work again :)

kafisatz commented 1 week ago

Thanks. Looks better; although another issue with message.photo is shown.

Digest: sha256:42d7124f0b531e3d1028dfde30d55d86f2c9b85f125b3e4e502a6da5eb4ff104
Status: Downloaded newer image for trimforce/butlarr:latest
docker.io/trimforce/butlarr:latest
bernhard@dockervm:~/docker/butlarr$ docker compose up
[+] Running 1/1
 ✔ Container butlarr  Recreated                                                                                                       0.9s
Attaching to butlarr
butlarr  | 2024-06-19 08:40:03.452 | INFO     | __main__:main:17 - Initializing database...
butlarr  | 2024-06-19 08:40:03.453 | DEBUG    | butlarr.database:_get_con_cur:31 - Database connection established [/app/data/db.sqlite].
butlarr  | 2024-06-19 08:40:03.453 | DEBUG    | butlarr.database:_init_db:56 - Executing query: [CREATE TABLE IF NOT EXISTS users (
butlarr  |                 id integer primary key,
butlarr  |                 username text not null,
butlarr  |                 auth_level integer
butlarr  |             );] with no args...
butlarr  | 2024-06-19 08:40:03.477 | INFO     | __main__:main:20 - Creating bot...
butlarr  | 2024-06-19 08:40:03.524 | INFO     | __main__:main:23 - Registering auth command...
butlarr  | 2024-06-19 08:40:03.525 | INFO     | __main__:main:26 - Registering help commands...
butlarr  | 2024-06-19 08:40:03.525 | INFO     | __main__:main:29 - Registering services..
butlarr  | 2024-06-19 08:40:03.525 | INFO     | __main__:main:33 - Registering callback handler...
butlarr  | 2024-06-19 08:40:03.525 | INFO     | __main__:main:36 - Start polling for messages..
butlarr  | 2024-06-19 08:40:03.654 | INFO     | butlarr.tg_handler:handle_command:168 - Received command: ['/series', 'queue']
butlarr  | 2024-06-19 08:40:03.654 | DEBUG    | butlarr.tg_handler:handle_command:173 - Subcommand - Executing queue (cmd_queue)
butlarr  | 2024-06-19 08:40:03.655 | DEBUG    | butlarr.database:_get_con_cur:31 - Database connection established [/app/data/db.sqlite].
butlarr  | 2024-06-19 08:40:03.655 | DEBUG    | butlarr.database:_execute_query:69 - Executing query: [SELECT * FROM users WHERE id=?;] with args: [(7488221386,)]
butlarr  | 2024-06-19 08:40:03.655 | DEBUG    | butlarr.database:get_auth_level:122 - Query result for user lookup: None
butlarr  | 2024-06-19 08:40:03.655 | DEBUG    | butlarr.database:get_auth_level:127 - Did not find user [7488221386] in the database.
butlarr  | No error handlers are registered, logging exception.
butlarr  | Traceback (most recent call last):
butlarr  |   File "/usr/local/lib/python3.11/site-packages/telegram/ext/_application.py", line 1325, in process_update
butlarr  |     await coroutine
butlarr  |   File "/usr/local/lib/python3.11/site-packages/telegram/ext/_handlers/basehandler.py", line 157, in handle_update
butlarr  |     return await self.callback(update, context)
butlarr  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
butlarr  |   File "/app/butlarr/tg_handler/__init__.py", line 174, in handle_command
butlarr  |     await c(self, update, context, args[1:])
butlarr  |   File "/app/butlarr/tg_handler/message.py", line 57, in wrapped_func
butlarr  |     if not message.photo:
butlarr  |            ^^^^^^^^^^^^^
butlarr  | AttributeError: 'NoneType' object has no attribute 'photo'
butlarr  | 2024-06-19 08:40:03.707 | INFO     | butlarr.tg_handler:handle_command:168 - Received command: ['/series', 'queue']
butlarr  | 2024-06-19 08:40:03.707 | DEBUG    | butlarr.tg_handler:handle_command:173 - Subcommand - Executing queue (cmd_queue)
butlarr  | 2024-06-19 08:40:03.707 | DEBUG    | butlarr.database:_get_con_cur:31 - Database connection established [/app/data/db.sqlite].
butlarr  | 2024-06-19 08:40:03.707 | DEBUG    | butlarr.database:_execute_query:69 - Executing query: [SELECT * FROM users WHERE id=?;] with args: [(7488221386,)]
butlarr  | 2024-06-19 08:40:03.708 | DEBUG    | butlarr.database:get_auth_level:122 - Query result for user lookup: None
butlarr  | 2024-06-19 08:40:03.708 | DEBUG    | butlarr.database:get_auth_level:127 - Did not find user [7488221386] in the database.
butlarr  | No error handlers are registered, logging exception.
butlarr  | Traceback (most recent call last):
butlarr  |   File "/usr/local/lib/python3.11/site-packages/telegram/ext/_application.py", line 1325, in process_update
butlarr  |     await coroutine
butlarr  |   File "/usr/local/lib/python3.11/site-packages/telegram/ext/_handlers/basehandler.py", line 157, in handle_update
butlarr  |     return await self.callback(update, context)
butlarr  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
butlarr  |   File "/app/butlarr/tg_handler/__init__.py", line 174, in handle_command
butlarr  |     await c(self, update, context, args[1:])
butlarr  |   File "/app/butlarr/tg_handler/message.py", line 57, in wrapped_func
butlarr  |     if not message.photo:
butlarr  |            ^^^^^^^^^^^^^
butlarr  | AttributeError: 'NoneType' object has no attribute 'photo'
butlarr  | 2024-06-19 08:40:03.758 | INFO     | butlarr.tg_handler:handle_command:168 - Received command: ['/series', 'alias']
butlarr  | 2024-06-19 08:40:03.758 | DEBUG    | butlarr.tg_handler:handle_command:177 - No matching subcommand registered. Trying fallback
butlarr  | 2024-06-19 08:40:03.759 | DEBUG    | butlarr.database:_get_con_cur:31 - Database connection established [/app/data/db.sqlite].
butlarr  | 2024-06-19 08:40:03.759 | DEBUG    | butlarr.database:_execute_query:69 - Executing query: [SELECT * FROM users WHERE id=?;] with args: [(7488221386,)]
butlarr  | 2024-06-19 08:40:03.759 | DEBUG    | butlarr.database:get_auth_level:122 - Query result for user lookup: None
butlarr  | 2024-06-19 08:40:03.759 | DEBUG    | butlarr.database:get_auth_level:127 - Did not find user [7488221386] in the database.
butlarr  | No error handlers are registered, logging exception.
butlarr  | Traceback (most recent call last):
butlarr  |   File "/usr/local/lib/python3.11/site-packages/telegram/ext/_application.py", line 1325, in process_update
butlarr  |     await coroutine
butlarr  |   File "/usr/local/lib/python3.11/site-packages/telegram/ext/_handlers/basehandler.py", line 157, in handle_update
butlarr  |     return await self.callback(update, context)
butlarr  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
butlarr  |   File "/app/butlarr/tg_handler/__init__.py", line 179, in handle_command
butlarr  |     await self.default_command(update, context, args[1:])
butlarr  |   File "/app/butlarr/tg_handler/message.py", line 57, in wrapped_func
butlarr  |     if not message.photo:
butlarr  |            ^^^^^^^^^^^^^
butlarr  | AttributeError: 'NoneType' object has no attribute 'photo'
TrimVis commented 1 week ago

That error can be ignored, as it is not the thing that's causing the issue :) (I will still push a fix)

To me it looks like your session db has been wiped, this is likely due to your switch to docker compose (correct me if I'm wrong). You will simply need to reauthorize yourself with the auth command :)