rfsbraz / deleterr

Deleterr is a Python script designed to help you manage available disk space in your Plex media server.
MIT License
118 stars 6 forks source link

Add verbose mode - dry run produces no logs #33

Closed jamo89 closed 7 months ago

jamo89 commented 9 months ago

first time user setup my confutation file have dry run still enabled when I run this is all that I get:

2023-09-14 20:03:45 - INFO :: config.py :: deleterr : Running in dry-run mode, no changes will be made. 2023-09-14 20:03:45 - INFO :: deleterr.py :: deleterr : Processing sonarr instance: 'Sonarr' 2023-09-14 20:03:46 - INFO :: deleterr.py :: deleterr : Processing radarr instance: 'Radarr'

I was assuming that media to be deleted would be found in this same log file. Is that accurate? Thanks

rfsbraz commented 9 months ago

That's probably because none of your media matched your conditions, otherwise they would have been printed. Try running it with the environment variable LOG_LEVEL set to DEBUG, that will print the reason why your media was not deleted for each entry.

If you're using docker compose this is how you do it:

version: "3.9"
services:
    deleterr:
        image: ghcr.io/rfsbraz/deleterr:master
        container_name: deleterr
        environment:
            LOG_LEVEL: DEBUG
jamo89 commented 9 months ago

thank you! I will try that

jamo89 commented 9 months ago

Still no luck. Here is the log output. Thank you 2023-09-15 17:12:10 - INFO :: config.py :: deleterr : Running in dry-run mode, no changes will be made. 2023-09-15 17:12:10 - INFO :: deleterr.py :: deleterr : Processing sonarr instance: 'Sonarr' 2023-09-15 17:12:11 - INFO :: deleterr.py :: deleterr : Processing radarr instance: 'Radarr'

rfsbraz commented 9 months ago

This really seems like it isn't take the LOG_LEVEL into account. Can you share your docker compose or docker command? Sorry for the long delay in answering, rough week.

jamo89 commented 9 months ago

No stress, thanks for looking, Here is my docker-compose,yml PS D:\docker\deleterr> more docker-compose.yml version: "3.9" services: deleterr: image: ghcr.io/rfsbraz/deleterr:master container_name: deleterr environment: LOG_LEVEL: DEBUG volumes:

and I run it via WSL 2.0 and Powershell PS D:\docker\deleterr> docker-compose -up d

rfsbraz commented 7 months ago

Added a log to print the log level on every run, it should be the first line.

Make sure to run it and pull the latest version, with:

docker-compose up --pull always
fastrack20 commented 7 months ago

I running into the same issue with dryrun. I am just running this directly since I am on Unraid but I am getting the same as @jamo89

Here is my docker run command docker run -d --name='Deleterr' -e 'LOG_LEVEL'='DEBUG' -l net.unraid.docker.managed=dockerman -v '/mnt/user/appdata/deleterr':'/config':'rw' 'ghcr.io/rfsbraz/deleterr'

All I am seeing in the logs is:

2023-11-24 15:00:16 - INFO :: deleterr.py :: deleterr : Log level set to DEBUG 2023-11-24 15:00:16 - DEBUG :: config.py :: deleterr : Loading configuration from /config/settings.yaml

rfsbraz commented 7 months ago

Hi @fastrack20! Could you share your settings if you have the chance? I'm doubting that they are being picked up correctly because there is a log for when the dry_run mode is detected.

if self.settings.get("dry_run"):
    logger.info("Running in dry-run mode, no changes will be made.")

Meanwhile I'll keep looking for paths where config can fail to load without a proper log.

fastrack20 commented 7 months ago

I figured it out. I had commented out the Sonarr section of my config as I didnt want the script to touch TV shows. Turns out that the script exits early if it doesnt have valid Sonarr configuration. Now that I have filled in the Sonarr section, the script now runs 👍

rfsbraz commented 7 months ago

Ok cheers. That at least helped me adding a little extra validations to make sure config is well formatted.

@jamo89 can you retest using the latest version to see if its still happening?