bleskodev / rubyripper

Fork of the original rubyripper from code.google.com/p/rubyripper + some bugs fixes
125 stars 21 forks source link

Error - undefined method status #632

Closed mgchristensen closed 3 years ago

mgchristensen commented 3 years ago

Attempting to run both cli and gui, I get this output: [michael@comp20000 ~]$ rrip_cli -v Verbose output specified. Rubyripper version 0.8.0rc2

Traceback (most recent call last): 9: from /usr/bin/rrip_cli:187:in <main>' 8: from /usr/bin/rrip_cli:52:instart' 7: from /usr/bin/rrip_cli:85:in prepare' 6: from /usr/lib/rubyripper/cli/cliDisc.rb:42:inshow' 5: from /usr/lib/rubyripper/cli/cliDisc.rb:61:in refreshDisc' 4: from /usr/lib/rubyripper/disc/disc.rb:40:inscan' 3: from /usr/lib/rubyripper/disc/disc.rb:108:in setMetadata' 2: from /usr/lib/rubyripper/metadata/main.rb:35:inget' 1: from /usr/lib/rubyripper/metadata/main.rb:35:in each' /usr/lib/rubyripper/metadata/main.rb:37:inblock in get': undefined method `status' for nil:NilClass (NoMethodError) [michael@comp20000 ~]$ rrip_gui -v

<Thread:0x00005575b0fee608 /usr/lib/rubyripper/gtk3/gtkDisc.rb:79 run> terminated with exception (report_on_exception is true):

Traceback (most recent call last): 5: from /usr/lib/rubyripper/gtk3/gtkDisc.rb:80:in block in refreshDisc' 4: from /usr/lib/rubyripper/disc/disc.rb:40:inscan' 3: from /usr/lib/rubyripper/disc/disc.rb:108:in setMetadata' 2: from /usr/lib/rubyripper/metadata/main.rb:35:inget' 1: from /usr/lib/rubyripper/metadata/main.rb:35:in each' /usr/lib/rubyripper/metadata/main.rb:37:inblock in get': undefined method status' for nil:NilClass (NoMethodError) Traceback (most recent call last): 5: from /usr/lib/rubyripper/gtk3/gtkDisc.rb:80:inblock in refreshDisc' 4: from /usr/lib/rubyripper/disc/disc.rb:40:in scan' 3: from /usr/lib/rubyripper/disc/disc.rb:108:insetMetadata' 2: from /usr/lib/rubyripper/metadata/main.rb:35:in get' 1: from /usr/lib/rubyripper/metadata/main.rb:35:ineach' /usr/lib/rubyripper/metadata/main.rb:37:in block in get': undefined methodstatus' for nil:NilClass (NoMethodError)

line 37 reads: break if provider == 'none' || @provider.status == 'ok' || @provider.status == 'multipleRecords'

It seems that the error triggers because one of the providers does not define a "status" method. But each of the three providers includes the line "attr_reader :status" in the class definition.

A little bit of quick and dirty debug code inserted into /usr/lib/rubyripper/metadata/main.rb after line 36 " startup(provider) " and the error is triggered by the debug code (borrowed from the file musicbrainz.rb at line 42): # debug 20210516MGC puts "Look at the providers here!" puts "DEBUG: status after the disc query: #{@providers.status}"

and the output of rrip_cli is now:

[michael@comp20000 rubyripper]$ rrip_cli Rubyripper version 0.8.0rc2

Look at the providers here! Traceback (most recent call last): 9: from /usr/bin/rrip_cli:187:in <main>' 8: from /usr/bin/rrip_cli:52:instart' 7: from /usr/bin/rrip_cli:85:in prepare' 6: from /usr/lib/rubyripper/cli/cliDisc.rb:42:inshow' 5: from /usr/lib/rubyripper/cli/cliDisc.rb:61:in refreshDisc' 4: from /usr/lib/rubyripper/disc/disc.rb:40:inscan' 3: from /usr/lib/rubyripper/disc/disc.rb:108:in setMetadata' 2: from /usr/lib/rubyripper/metadata/main.rb:35:inget' 1: from /usr/lib/rubyripper/metadata/main.rb:35:in each' /usr/lib/rubyripper/metadata/main.rb:39:inblock in get': undefined method `status' for ["freedb", "musicbrainz", "gnudb", "none"]:Array (NoMethodError)

But should not the provider array have only three elements to the providers array and not four? I can't really say I know ruby; I will appreciate anyone who wants to point me further down the road. Thanks!

mgchristensen commented 3 years ago

I apologize for the poor formatting. I do not know how I managed that!

bleskodev commented 3 years ago

Hi, thanks for reporting and debugging this! What I find surprising is that you still have 'freedb' provider in the list. FreeDB servers had been shut down some time ago and have been replaced by 'gnudb'. I have replaced freedb provider with gnudb and tried to make migration seamless (unsuccessfully it seems); there is a reference to the currently selected provider in settings file. I didn't have time to look at it more deeply, I'll try to find some time this weekend.
Maybe you can post your settings file here; this could help discovering what is happening. Thanks!

mgchristensen commented 3 years ago

File at ~/.config/rubyripper/settings:

cdrom=/dev/sr0 offset=6 padMissingSamples=true rippersettings= reqMatchesAll=2 reqMatchesErrors=3 maxTries=7 eject=true noLog=false createCue=true image=false ripHiddenAudio=true minLengthHiddenTrack=2 preGaps=append preEmphasis=cue flac=true settingsFlac=--best -V vorbis=false settingsVorbis=-q 4 mp3=false settingsMp3=-V 3 --id3v2-only nero=false settingsNero=-q 0.5 fraunhofer=false settingsFraunhofer=-p 2 -m 5 -a 1 wavpack=false settingsWavpack= opus=false settingsOpus=--bitrate 160 wav=false other=false settingsOther=flac %i %o.flac playlist=true maxThreads=2 noSpaces=true noCapitals=false normalizer=none gain=album metadataProvider=musicbrainz firstHit=false site=http://freedb.freedb.org/~cddb/cddb.cgi username=anonymous hostname=my_secret.com preferMusicBrainzCountries=US,UK,XW,XE,JP preferMusicBrainzDate=earlier useEarliestDate=true basedir=~/CD_Rips namingNormal=%f/%a (%y) %b/%n - %t namingVarious=%f/%va (%y) %b/%n - %a - %t namingImage=%f/%a (%y) %b/%a - %b (%y) editor=emacs filemanager=krusader -caption "%c" %i browser=firefox verbose=true debug=false testdisc=false

I can see one problem! I have the wrong URL for the setting "site="

bleskodev commented 3 years ago

I have improved the settings migration from freedb to gnudb. I hope this should solve your problems. If you can, get the latest and test. Thanks!

mgchristensen commented 3 years ago

Works! Thank you. I think I do not understand how the line attr_reader :status works and why the undefined method error triggered. Will have to do some more digging. Off topic: was able to rip Tosca (2 CD set).

bleskodev commented 3 years ago

Cool! Closing the bug. In case of new problems, do not hesitate...cheers!