alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.45k stars 209 forks source link

🐛 [Unpackerr] does not respect unpackerr.conf settings #1144

Closed norbertjoni closed 8 months ago

norbertjoni commented 8 months ago

Description

I have set up the conf file under /config folder but it does not reconise my settings: What am I missing?

Reproduction steps

[[folder]]
  url = "http://192.168.20.3:8989"
  api_key = "42fa56e8c2d44435849dde4492b73f79"
## File system path where downloaded Sonarr items are located.
  paths = ['/share/tv']
## Defaultprotocols is torrent. Alternative: "torrent,usenet"
# protocols = "torrent"
## How long to wait for a reply from the backend.
# timeout = "10s"
## How long to wait after import before deleting the extracted items.
  delete_delay = "15m"
## If you use this app with NZB you may wish to delete archives after extraction.
## General recommendation is: do not enable this for torrent use.
## Setting this to true deletes the entire original download folder after import.
# delete_orig = false
## If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
# syncthing = false

Addon Logs

[INFO] 2023/12/22 23:24:32 Unpackerr v0.12.0 Starting! PID: 340, UID: 1000, GID: 1000, Now: 2023-12-22 23:24:33 +0100 CET [INFO] 2023/12/22 23:24:32 ==> GoLift Discord: https://golift.io/discord <== [INFO] 2023/12/22 23:24:32 ==> Startup Settings <== [INFO] 2023/12/22 23:24:32  => Sonarr Config: 0 servers [INFO] 2023/12/22 23:24:32  => Radarr Config: 0 servers [INFO] 2023/12/22 23:24:32  => Lidarr Config: 0 servers [INFO] 2023/12/22 23:24:32  => Readarr Config: 0 servers

Architecture

No response

OS

HAos

davidnewhall commented 8 months ago

Folders do not have URLs or API keys. It appears to be respecting your settings correctly based on the [invalid] settings you've provided/shown here.

norbertjoni commented 8 months ago

This was in the unpackerr.conf in the /config folder.. But even if I change the folder to [[sonarr]] or radar nothing is changed.

[INFO] 2023/12/23 17:30:56 => Sonarr Config: 0 servers [INFO] 2023/12/23 17:30:56 => Radarr Config: 0 servers

davidnewhall commented 8 months ago

Instead of include only a few lines from the log, can you attach the log file?

norbertjoni commented 8 months ago

sure, this is the log. my config is up there log.txt

davidnewhall commented 8 months ago

I suspect this add-on is doing weird stuff and you've run into a bug. This output in your log indicated "something weird"

[INFO] 2023/12/23 17:39:37  => Folder Config: 11 paths, event buffer: 20000 
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path: /share/downloads_unpacked, extract to: /share/downloads_packed (delete after:20m, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path: /share/downloads_unpacked (delete after:20m, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
[INFO] 2023/12/23 17:39:37  =>    Path:  (delete after:0s, delete orig:false, log file: true, move back:false, isos:false)
...
[INFO] 2023/12/23 17:39:37 [Folder] Watching (fsnotify): /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /share/downloads_unpacked, /share/downloads_unpacked, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr
[INFO] 2023/12/23 17:39:37 [Folder] Polling @ 1s: /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /share/downloads_unpacked, /share/downloads_unpacked, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr, /run/s6-rc:s6-rc-init:bjBkHI/servicedirs/service-unpackerr

I do not know what is happening here and I'm not sure how to fix it. Hopefully a dev on this add-on can chime in.

norbertjoni commented 8 months ago

What I have noticed is if I change the unpackerr.conf file under the conf folder the changed code is reversing back to the original examples sometimes.

alexbelgium commented 8 months ago

Hi, actually the addon is pretty straightforward, it is just a shell around the "hotio" upackerr image (https://github.com/hotio/unpackerr)

The addon contains a single script, that makes the several elements :

Therefore if there is a revert, either 1) you were not using the addon options for watch & extraction path ; 2) there is a bug in the hotio upstream container ; or 3) the config file has changed and the code I was using to automatically set those 2 folders is messing with other things.

Could you please check if you were setting the options in the addon and confirm ? Thanks !

davidnewhall commented 8 months ago

I can confirm that 2) and 3) are not the case. I do not know what 1) means. I suspect the bug is in the script and it's producing an invalid configuration file or environment variables. The snippet I pasted in my previous message is the clear indication of the problem. This is not the first unpackerr user to report this problem to me (the unpackerr author). Let me know if I can help debug.

alexbelgium commented 8 months ago

Thanks for your input and your proposition to help.

I've pushed a new version that touches in no way the hotio/unpackerr upstream image. The main thing it does is add an an S6_STAGE2_HOOK to execute custom scripts allowing an HA-customized log as well as mounting local or smb drives. It also contains a configuration file to allow the container running in HomeAssistant.

In the current (problematic version), a script was modifying the unpackerr.conf file to allow definition of the watch & extraction folders through the addon options. I realize that it is actually counterproductive as can mess with the config file and has little benefit given that anyway the user must access the file to modify the rest of the options.

I would recommend to users to delete the configuration file to allow the default one to be recreated.

davidnewhall commented 8 months ago

Sweet. That sounds like it'll resolve this issue. Thank you for addressing it!

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.