clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
673 stars 176 forks source link

nzbToSickBeard failing to run #1971

Closed josurr closed 1 year ago

josurr commented 1 year ago

Describe the bug The automated & manual running of the nzbToSickBeard.py script in the latest official sabnzbd docker container fails to run

Technical Specs

  1. Running on (Windows, Linux, NAS Model etc)

unRAID - Docker container: sabnzbd

  1. Python version

3.11.3

  1. Download Client (NZBget, SABnbzd, Transmission)

SABnzbd

  1. Intended Media Management (SickChill, CouchPotoato, Radarr, Sonarr)

SickChill

Expected behavior Script processes the downloaded file (renaming & moving it to the correct location) and deletes the downloaded folder

Log root@973bb9d8e0d5:/downloads/_zTV# python3 /nzbToMedia/nzbToSickBeard.py Deadliest.Catch.S19E07.1080p.HEVC.x265-MeGusta/ Changing to directory: /nzbToMedia

-- Cleaning bytecode -- b'Removing pycache/\n' b'Removing pycache/\n'

-- Cleaning folders: ['libs', 'core'] -- No folders to clean

Returning to directory: /downloads/_zTV

-- Cleanup finished --

Traceback (most recent call last): File "/nzbToMedia/nzbToSickBeard.py", line 275, in import nzbToMedia File "/nzbToMedia/nzbToMedia.py", line 734, in import core File "/nzbToMedia/core/init.py", line 52, in from core import logger, main_db, version_check, databases, transcoder File "/nzbToMedia/core/main_db.py", line 20, in from core import permissions ImportError: cannot import name 'permissions' from partially initialized module 'core' (most likely due to a circular import) (/nzbToMedia/core/init.py)

josurr commented 1 year ago

This is occurring when using a freshly cloned nzbToMedia file & folder structure

clinton-hall commented 1 year ago

Sorry for the late response.

you say this is freshly cloned. Have you completely deleted it and re-cloned? The reason I ask is that I have not been able to re-create the issue.

The other thing to test, if you are able, is to try editing the file /nzbToMedia/core/init.py line 52 https://github.com/clinton-hall/nzbToMedia/blob/master/core/__init__.py#LL52C1-L52C71 from from core import logger, main_db, version_check, databases, transcoder to from core import logger, permissions, main_db, version_check, databases, transcoder this will try and import permissions BEFORE importing main_db (which tries to import permissions directly).

josurr commented 1 year ago

No worries!

By freshly cloned, I mean I copied the existing structure into a separate directory and then deleted the original location. After the deletion task completed, I ran the git clone command to clone the repository.

I just performed the previous steps again this morning and the issue is no longer present.

Thanks for all your hard work with this! I would have given up on using SickBeard/SickChill long ago if I had to manually rename & move the media files after they were downloaded...