whipper icon indicating copy to clipboard operation
whipper copied to clipboard

KeyError when processing cue file

Open bluggy opened this issue 5 years ago • 17 comments

It appears for some reason that the name of the 1st track is not accurately written to the que file and instead "../../data.wav" is put in there instead. Thus when processing the cue file it is not able to locate this file and will end up generating a KeyError exception.

Traceback (most recent call last):
  File "/usr/local/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.9.1.dev77+gb3aae5f', 'console_scripts', 'whipper')()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/command/main.py", line 56, in main
    ret = cmd.do()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/command/basecommand.py", line 141, in do
    return self.cmd.do()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/command/basecommand.py", line 141, in do
    return self.cmd.do()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/command/cd.py", line 191, in do
    self.doCommand()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/command/cd.py", line 538, in doCommand
    self.program.verifyImage(self.runner, self.itable)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/common/program.py", line 643, in verifyImage
    verifytask = image.ImageVerifyTask(cueImage)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/image/image.py", line 150, in __init__
    path = image.getRealPath(index.path)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/image/image.py", line 70, in getRealPath
    return self.cue.getRealPath(path)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/image/cue.py", line 188, in getRealPath
    return common.getRealPath(self._path, path)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev77+gb3aae5f-py3.7-linux-x86_64.egg/whipper/common/common.py", line 252, in getRealPath
    raise KeyError("Cannot find file for %r" % filePath)
KeyError: "Cannot find file for '../../data.wav'"

whipper.log.gz

bluggy avatar Sep 18 '20 01:09 bluggy

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

github-actions[bot] avatar Sep 18 '20 01:09 github-actions[bot]

Hi, could you also attach the toc file and the cue sheet?

JoeLametta avatar Sep 18 '20 07:09 JoeLametta

Hi, could you also attach the toc file and the cue sheet?

No problem. Both are now attached.

whipper.cue.gz whipper.toc.gz

bluggy avatar Sep 18 '20 12:09 bluggy

Thanks, and what's the command line you run whipper with?

JoeLametta avatar Sep 18 '20 13:09 JoeLametta

I used the Docker dev image. My Docker whipper alias is as follows:

docker run -ti --rm --device=/dev/sr0 --device=/dev/sr1 --device=/dev/sr2 --mount type=bind,source=${HOME}/.config/whipper,target=/home/worker/.config/whipper --mount type=bind,source=${HOME}/Music,target=/output --env WHIPPER_DEBUG=DEBUG --env WHIPPER_LOGFILE=whipper.log whipperteam/whipper:dev

And the whipper command was:

whipper cd --device /dev/sr1 rip

bluggy avatar Sep 18 '20 13:09 bluggy

This bug is caused by a regression introduced in commit 3acc3ffed67b83cc9e1f1b6ae42283840c92a488. I already have a fix ready which I'll probably commit tomorrow.

JoeLametta avatar Sep 19 '20 20:09 JoeLametta

The regression has been fixed with commit b754b2b0bf30a72304d1103e64d17e94ec3b36a4.

JoeLametta avatar Sep 20 '20 13:09 JoeLametta

Hi @JoeLametta, I just grabbed the latest dev Docker image which appeared to have b754b2b in it (according to the version information), but it is still exhibiting the same behavior.

Traceback (most recent call last):
  File "/usr/local/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.9.1.dev85+gb754b2b', 'console_scripts', 'whipper')()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/command/main.py", line 56, in main
    ret = cmd.do()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/command/basecommand.py", line 141, in do
    return self.cmd.do()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/command/basecommand.py", line 141, in do
    return self.cmd.do()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/command/cd.py", line 191, in do
    self.doCommand()
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/command/cd.py", line 536, in doCommand
    self.program.verifyImage(self.runner, self.itable)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/common/program.py", line 617, in verifyImage
    verifytask = image.ImageVerifyTask(cueImage)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/image/image.py", line 150, in __init__
    path = image.getRealPath(index.path)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/image/image.py", line 70, in getRealPath
    return self.cue.getRealPath(path)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/image/cue.py", line 188, in getRealPath
    return common.getRealPath(self._path, path)
  File "/usr/local/lib/python3.7/dist-packages/whipper-0.9.1.dev85+gb754b2b-py3.7-linux-x86_64.egg/whipper/common/common.py", line 252, in getRealPath
    raise KeyError("Cannot find file for %r" % filePath)
KeyError: "Cannot find file for '../../data.wav'"

I've attached the cue sheet and toc file for this attempt. Let me know if you also need me to capture the debug log again.

whipper.cue.gz whipper.toc.gz

bluggy avatar Sep 20 '20 15:09 bluggy

JoeLametta:

This bug is caused by a regression introduced in commit 3acc3ff. I already have a fix ready which I'll probably commit tomorrow. [...] The regression has been fixed with commit b754b2b.

bluggy:

Hi @JoeLametta, I just grabbed the latest dev Docker image which appeared to have b754b2b in it (according to the version information), but it is still exhibiting the same behavior.

Sorry, my bad: I got confused and marked the solution to another issue as relevant to this one. The fix mentioned in the quoted messages is related to the issue reported below:

https://github.com/whipper-team/whipper/issues/145#issuecomment-695016228 https://github.com/whipper-team/whipper/issues/145#issuecomment-695017861

@bluggy First of all I'm reopening this issue, unfortunately I still need to understand the underlying bug which is causing it...

JoeLametta avatar Sep 22 '20 16:09 JoeLametta

No problem, just got excited. :smile:

bluggy avatar Sep 22 '20 21:09 bluggy

Funnily enough, I ran into the same issue with the same CD :rofl:

Is there any news on this?

The problem seems to be caused by the path written for Track 1 which is preceded by a hidden track. Here the output from the rip:

INFO:whipper.command.cd:ripping track 0 of 12: 00. Various Artists - Hidden Track One Audio.flac
INFO:whipper.program.cdparanoia:checksums match, 3d7d2ab2
INFO:whipper.command.cd:CRCs match for track 0
Peak level: 0.000000
Rip quality: 100.00%
INFO:whipper.command.cd:HTOA discarded, contains digital silence
INFO:whipper.command.cd:ripping track 1 of 12: 01. Nirvana - I Hate Myself and I Want to Die.flac
INFO:whipper.program.cdparanoia:checksums match, 7e24bff8
INFO:whipper.command.cd:CRCs match for track 1
Peak level: 0.981232
Rip quality: 100.00%

I am very happy to help in debugging this issue...

Edit: attached whipper.log.gz (with WHIPPER_DEBUG=DEBUG set)

jmechnich avatar Nov 11 '21 16:11 jmechnich

Related: #582

BBaoVanC avatar Mar 30 '24 21:03 BBaoVanC