rembo10 / headphones

Automatic music downloader for SABnzbd
GNU General Public License v3.0
3.35k stars 603 forks source link

Error scanning library - new install. OS: Ubuntu 20.04.3 LTS x86_64 #3288

Closed opbillbobaggins closed 2 years ago

opbillbobaggins commented 2 years ago
  | ERROR | Uncaught exception: Traceback (most recent call last): File "/opt/headphones/headphones/logger.py", line 215, in new_run old_run(*args, **kwargs) File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/opt/headphones/headphones/librarysync.py", line 211, in libraryScan sorted_dbtracks = helpers.multikeysort(dbtracks, ['ArtistName', 'AlbumTitle']) File "/opt/headphones/headphones/helpers.py", line 70, in multikeysort return sorted(items, key=functools.cmp_to_key(comparer)) File "/opt/headphones/headphones/helpers.py", line 64, in comparer result = cmp(fn(left), fn(right)) File "/opt/headphones/headphones/helpers.py", line 55, in cmp return (x > y) - (x < y)TypeError: '>' not supported between instances of 'NoneType' and 'NoneType' -- | -- | --
tebrown commented 2 years ago

Downgraded to b319960, from 517d0eb and it scanned correctly.

rembo10 commented 2 years ago

Thanks for the reports. Would it be possible to try it on python 3.9? I'm trying to track down where the actual problem might be coming from (i.e. how the NoneType is being passed to that function). I've just tried the library sync on 3.9.9 and it seems to work fine so I'm having a hard time debugging

opbillbobaggins commented 2 years ago
I spun up a new container running Ubuntu 20.04. It's the easiest way to make sure the environment is clean. Mapped the shares. Then did an apt update && apt upgrade. Installed python3.9, cherrypy, and git-core. Cloned repository and copied over my config.ini. The python it installed is 3.9.5 not 3.9.9 not sure how much of an impact that has the error produced is similar to the one with 3.8. I'm happy to help in anyway I can just let me know what I can do. If 3.9.9 is for sure needed I will have to research a manual install as apt did not offer it up. Is it possible it could be something in my library triggering the issue? I spun up another container with python2.7 and reverted to the earlier version of headphones as suggested in https://github.com/rembo10/headphones/issues/3288#issuecomment-1030684325 by tebrown to see what happens. Here is the error with python3.9.5: ERROR | Uncaught exception: Traceback (most recent call last): File "/opt/headphones/headphones/logger.py", line 215, in new_run old_run(*args, **kwargs) File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/opt/headphones/headphones/librarysync.py", line 211, in libraryScan sorted_dbtracks = helpers.multikeysort(dbtracks, ['ArtistName', 'AlbumTitle']) File "/opt/headphones/headphones/helpers.py", line 70, in multikeysort return sorted(items, key=functools.cmp_to_key(comparer)) File "/opt/headphones/headphones/helpers.py", line 64, in comparer result = cmp(fn(left), fn(right)) File "/opt/headphones/headphones/helpers.py", line 55, in cmp return (x > y) - (x < y)TypeError: '>' not supported between instances of 'NoneType' and 'NoneType' -- | --
rembo10 commented 2 years ago

Hey thanks so much for the report. I'm still trying to figure out where the problem is coming from. Do you see any mediafile errors before this one? I don't know if it's having trouble reading the tags or if it's something else. Or maybe do you know if some of your music files don't have artist/album tags?

Anyway I added a fix that will catch this into the develop branch...

opbillbobaggins commented 2 years ago

The old version made it through the library scan. The old version had information about what it was scanning ie. : [/mnt/Music] Now scanning subdirectory /Artist_name/Album_name . The new version dose not. It has a entry INFO Scanning music directory: /mnt/Music then info 78206 new/modified tracks found and added to the database then : INFO Found 78206 new/modified tracks in /mnt/Music then : INFO Matching tracks to the appropriate releases.... then triggers error.

rembo10 commented 2 years ago

The same error?? Even on the develop branch?

rembo10 commented 2 years ago

So i suspect the problem is at a lower level, not necessarily with that comparison function.

opbillbobaggins commented 2 years ago

I Have not tried develop branch. I can try that tonight. Headphones v0.5.20 python 2.7 did not encounter the same error, completed library scan, and populated the library tab. So not sure what’s triggering error in master branch. I found if I give it a smaller library to scan it completes scan so size of library possibly?

opbillbobaggins commented 2 years ago

I'm not a 100% sure I got it switched to develop branch. I followed these directions : Manual update

Use the following commands to reset your repository. Backup your configuration and database files, just in case.

cd /path/to/headphones
git branch should list eith/er master or develop. *note* showed master
git remote show origin should exist and point to https://github.com/rembo10/headphones
git reset --hard — this WILL overwrite all local changes! It will spare your config and database.
git remote update
git pull origin develop
Then I did a git branch and it still showed master. so Meh?

I still have a lot to learn. I've never switched branches before. I did google it but the directions I came across seemed to pertain to creating a branch so a bit confused on that.

I then blew out the database file so it would crate a new one. Then I ran it from command line and started a scan. I obtained a different result. I am going to do some investigating but it did add some Artists to the Library before it error-ed and I have : INFO | [Brobdingnagian Bards] Packaging Marked By Great Size releases into hybrid title just prior to the error.

ERROR | Uncaught exception: Traceback (most recent call last): File "/opt/headphones/headphones/logger.py", line 215, in new_run old_run(*args, **kwargs) File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/opt/headphones/headphones/librarysync.py", line 415, in libraryScan importer.artistlist_to_mbids(new_artist_list) File "/opt/headphones/headphones/importer.py", line 89, in artistlist_to_mbids addArtisttoDB(artistid) File "/opt/headphones/headphones/importer.py", line 453, in addArtisttoDB elif album['ReleaseDate'] > today and headphones.CONFIG.AUTOWANT_UPCOMING:TypeError: '>' not supported between instances of 'NoneType' and 'str' -- | --
opbillbobaggins commented 2 years ago

Hit scan button again for entertainment and instantly got

ERROR Uncaught exception: Traceback (most recent call last): File "/opt/headphones/headphones/logger.py", line 215, in new_run old_run(*args, *kwargs) File "/usr/lib/python3.9/threading.py", line 892, in run self._target(self._args, **self._kwargs) File "/opt/headphones/headphones/librarysync.py", line 80, in libraryScan myDB.action('DELETE FROM have WHERE Location=?', [Track['Location']])NameError: name 'Track' is not defined

I have one song by Brobdingnagian Bards. I checked the file name and it had a + in the file name. I fixed the file name and then started a [Force Re-scan Library [Comprehensive]. So waiting to see what happens.

rembo10 commented 2 years ago

Oh yeah ok, I can reproduce the error TypeError: '>' not supported between instances of 'NoneType' and 'str' I am still debugging

opbillbobaggins commented 2 years ago

Hit it again with a , in file name

rembo10 commented 2 years ago

NameError: name 'Track' is not defined

Ok, I have a fix for this in develop, still working on the main thing

rembo10 commented 2 years ago

Ok I think it was actually a pretty straightfoward fix. It's in the develop branch. You can just run git checkout develop to try it. And then git checkout master to switch back to the master branch EDIT: It's in master

opbillbobaggins commented 2 years ago

Ok. I want to make sure that I do my part and test it properly. Would you like me to spin up a fresh instance? What version of python would you like me to test with? Is it in the master or development branch? In your last comment there is an edit at end saying “it’s in master”

rembo10 commented 2 years ago

I think that it shouldn't matter. It was just a problem with albums without release dates, which in Python 2 returned False, if it was compared with anything, but in Python 3 it throws an error. So it's just checking to make sure that there is a valid release date before it does the comparison (for marking new albums as wanted).

So yeah, it shouldn't matter the state of your db/config/branch (since it's in both develop and master branches)

hlubach commented 2 years ago

Clean install Scan Library ,One Artist and then this

  ERROR Uncaught exception: Traceback (most recent call last):
File "/home/han/headphones/headphones/logger.py", line 215, in new_run old_run(*args, *kwargs)
File "/usr/lib/python3.8/threading.py", line 870, in run self._target(
self._args, **self._kwargs)
File "/home/han/headphones/headphones/librarysync.py", line 415, in libraryScan importer.artistlist_to_mbids(new_artist_list) File "/home/han/headphones/headphones/importer.py", line 89, in artistlist_to_mbids addArtisttoDB(artistid)
File "/home/han/headphones/headphones/importer.py", line 454, in addArtisttoDB if helpers.is_valid_date(album['ReleaseDate']) and helpers.age(album['ReleaseDate']) < 21:
File "/home/han/headphones/headphones/helpers.py", line 178, in age delta = date.today() - date.fromisoformat(d)NameError: name 'date' is not defined
2022-02-08 19:02:04 INFO [Dusty Springfield] Packaging Brand New Me releases into hybrid title
2022-02-08 19:02:04 INFO [Dusty Springfield] New release A Brand New Me: The Complete Philadelphia Sessions (24bb4c3c-4f19-4b22-97d3-e7a1ecfe0a3e) added
2022-02-08 19:02:04 INFO [Dusty Springfield] New release A Brand New Me (dcebceee-4a00-4fdd-b190-9e42d277ceed) added
2022-02-08 19:02:04 INFO [Dusty Springfield] New release From Dusty....With Love (d1980136-90be-45cd-993f-28a6efac6a76) added
2022-02-08 19:02:04 INFO [Dusty Springfield] New release From Dusty....With Love (b3a8c763-04fd-4149-bfee-5de9325e9196) added
2022-02-08 19:02:04 INFO [Dusty Springfield] New release Brand New Me (7828a6aa-29c2-4dfc-a5bd-b3e986f31b2e) added
2022-02-08 19:02:04 INFO [Dusty Springfield] Now adding: Brand New Me (New Release Group)
rembo10 commented 2 years ago

Ay yaa... Sorry about that, fixed in master

hlubach commented 2 years ago

It is working

See that several album are not show , but when i choose Compilations then i got them , while strange enough those already had a tag (Picard)

How to see if dowlnoader and indexer are working 

"rembo10" @. @*.**@*.***>)> schreef op 8 februari 2022 22:21: Ay yaa... Sorry about that, fixed in master

Reply to this email directly, view it on GitHub (https://github.com/rembo10/headphones/issues/3288#issuecomment-1033073804), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AB344IFVH4O6GRTEYAQ3F2TU2GCOVANCNFSM5NUDAFEQ). Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub). You are receiving this because you commented.Message ID: @.***>

rembo10 commented 2 years ago

Hi sorry, I'm not sure I understand, but it seems like a new issue not related to this one

opbillbobaggins commented 2 years ago

Just an update. With the latest master build with python 3.9.5 the issue appears to be resolved. The scan is still ongoing but has not encountered any errors. One oddity is some of the artists show a track count greater then available ie. 33/13 for have and clicking on any artist shows all albums as green [retry][new] even the ones with status none. So I may have a new issue to report but will wait for scan completion to make new ticket and close this one.

rembo10 commented 2 years ago

Oh that's weird. It seems to be ok on my end. Let me know.

Thanks a lot for testing all this out for me

opbillbobaggins commented 2 years ago

It stopped processing on this error. May be solely the fault of my media. Please take a look when you have time. Thanks for all your hard work on this project 😁

ERROR Uncaught exception: Traceback (most recent call last):File "/opt/headphones/headphones/logger.py", line 215, in new_runold_run(*args, *kwargs)File "/usr/lib/python3.9/threading.py", line 892, in runself._target(self._args, **self._kwargs)File "/opt/headphones/headphones/librarysync.py", line 415, in libraryScanimporter.artistlist_to_mbids(new_artist_list)File "/opt/headphones/headphones/importer.py", line 89, in artistlist_to_mbidsaddArtisttoDB(artistid)File "/opt/headphones/headphones/importer.py", line 282, in addArtisttoDBif helpers.age(release_date) < ignore_age:File "/opt/headphones/headphones/helpers.py", line 176, in agedelta = date.today() - date.fromisoformat(d)ValueError: day is out of range for month
rembo10 commented 2 years ago

No, it was more stupid code that I wrote :sweat_smile: Fixed in develop, i'll get it into master in a few hours

opbillbobaggins commented 2 years ago

I’m on latest develop branch. I hit this error during my last scan attempt.

ERROR Uncaught exception: Traceback (most recent call last):File "/opt/headphones/headphones/mb.py", line 92, in findArtistartistResults = musicbrainzngs.search_artists(limit=limit, criteria)['artist-list']File "/opt/headphones/lib/musicbrainzngs/musicbrainz.py", line 967, in search_artistsreturn _do_mb_search('artist', query, fields, limit, offset, strict)File "/opt/headphones/lib/musicbrainzngs/musicbrainz.py", line 805, in _do_mb_searchraise ValueError('at least one query term is required')ValueError: at least one query term is requiredDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "/opt/headphones/headphones/logger.py", line 215, in new_runold_run(*args, *kwargs)File "/usr/lib/python3.9/threading.py", line 892, in runself._target(self._args, self._kwargs)File "/opt/headphones/headphones/librarysync.py", line 415, in libraryScanimporter.artistlist_to_mbids(new_artist_list)File "/opt/headphones/headphones/importer.py", line 63, in artistlist_to_mbidsresults = mb.findArtist(artist, limit=1)File "/opt/headphones/headphones/mb.py", line 94, in findArtistif "at least one query term is required" in e.message:AttributeError: 'ValueError' object has no attribute 'message
rembo10 commented 2 years ago

ValueError.message was removed in python3. Fixed in develop

rembo10 commented 2 years ago

Thanks for testing and reporting all this stuff btw... I really appreciate it

opbillbobaggins commented 2 years ago

Your very welcome. I really like the features this project has. Thank you for keeping it alive and all the hard work you do. :-)

opbillbobaggins commented 2 years ago

:-)

INFO | Library scan complete

I was updating then clicking save library/scan button after each error fix you implemented. I will blow out the database and have it start again from scratch to verify no issues when I get home.

opbillbobaggins commented 2 years ago

good to go :-)