Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadFiles Crashing at launch #3165

Closed
bryangauvin opened this issue Feb 24, 2019 · 9 comments
Closed

BadFiles Crashing at launch #3165

bryangauvin opened this issue Feb 24, 2019 · 9 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@bryangauvin
Copy link

bryangauvin commented Feb 24, 2019

Hello,
I'm still new to Beets and am trying to perfect my setup. I'm up to Badfiles and am getting the following error when running "beet bad". Any help would be appreciated.

�[31;01m\ABRP\New Volume\Music-Flac\2Pac\All Eyez on Me\04 - Got My Mind Made Up feat. Delmar Arnaud, Kurupt, Redman & Method Man.mp3�[39;49;00m: file does not exist
Traceback (most recent call last):
File "C:\Users\Bryan\AppData\Local\Programs\Python\Python36\Scripts\beet-script.py", line 11, in
load_entry_point('beets==1.4.7', 'console_scripts', 'beet')()
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\ui_init_.py", line 1256, in main
raw_main(args)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\ui_init
.py", line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 119, in check_bad
status, errors, output = checker(path)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 81, in checker
return self.run_command(cmd)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 64, in run_command
output = output.decode(sys.getfilesystemencoding())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 25: invalid start byte

@bryangauvin bryangauvin changed the title Crashing at launch BadFiles Crashing at launch Feb 24, 2019
@sampsyo
Copy link
Member

sampsyo commented Feb 24, 2019

Hi! Could you please follow the issue template so we can see your platform setup, etc.? That stuff will actually be really important for understanding this problem.

It looks like the badfiles plugin is using the filesystem encoding to decode a program's output stream, which is clearly wrong. We should also probably be ignoring or replacing errors for this decode call, but it will take some careful consideration to see if that's safe.

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Feb 24, 2019
@bryangauvin
Copy link
Author

I apologize. Where can I find this template? I've searched and can not find it.

@sampsyo
Copy link
Member

sampsyo commented Feb 24, 2019

It's what appears when you try to file a new issue in this repository. You can hit the "new issue" button and copy it out of there. Or get it here:
https://raw.githubusercontent.com/beetbox/beets/master/.github/ISSUE_TEMPLATE.md

@bryangauvin
Copy link
Author

bryangauvin commented Feb 24, 2019

Problem

I'm still new to Beets and am trying to perfect my setup. I'm up to Badfiles and am getting the following error when running "beet bad". Any help would be appreciated.

�[31;01m\ABRP\New Volume\Music-Flac\2Pac\All Eyez on Me\04 - Got My Mind Made Up feat. Delmar Arnaud, Kurupt, Redman & Method Man.mp3�[39;49;00m: file does not exist
Traceback (most recent call last):
File "C:\Users\Bryan\AppData\Local\Programs\Python\Python36\Scripts\beet-script.py", line 11, in 
load_entry_point('beets==1.4.7', 'console_scripts', 'beet')()
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\ui__init__.py", line 1256, in main
_raw_main(args) File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\ui__init__.py", line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 119, in check_bad
status, errors, output = checker(path)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 81, in checker
return self.run_command(cmd)
File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 64, in run_command
output = output.decode(sys.getfilesystemencoding())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 25: invalid start byte

Running this command in verbose (-vv) mode:

beet bad -vv

Led to this problem:

Traceback (most recent call last):
  File "C:\Users\Bryan\AppData\Local\Programs\Python\Python36\Scripts\beet-script.py", line 11, in <module>
    load_entry_point('beets==1.4.8', 'console_scripts', 'beet')()
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\ui\__init__.py", line 1266, in main
    _raw_main(args)
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\ui\__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 150, in command
    par_map(self.check_item, items)
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beets\util\__init__.py", line 1031, in par_map
    pool.map(transform, items)
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\multiprocessing\pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\multiprocessing\pool.py", line 644, in get
    raise self._value
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\multiprocessing\pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 122, in check_item
    status, errors, output = checker(path)
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 86, in checker
    return self.run_command(cmd)
  File "c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages\beetsplug\badfiles.py", line 69, in run_command
    output = output.decode(sys.getfilesystemencoding())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 25: invalid start byte

Setup

  • OS: Windows 10
  • Python version: Python 3.6.8
  • beets version: 1.4.8
  • Turning off plugins made problem go away (yes/no): No

My configuration (output of beet config) is:

directory: \\ABRP\New Volume\Music-Flac
library: C:\musiclibrary.db
art_filename: albumart
threaded: yes
original_date: no
per_disc_numbering: no

plugins:
- chroma
- convert
- discogs
- acousticbrainz
- embedart
- fetchart
- ftintitle
- lastgenre
- mbsync
- scrub
- bucket
- inline
- the
- badfiles
- missing
- info
- duplicates

ui:
    color: yes
    colors:
        text_success: green
        text_warning: yellow
        text_error: red
        text_highlight: red
        text_highlight_minor: lightgray
        action_default: turquoise
        action: blue
discogs:
    user_token: REDACTED
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5

import:
    copy: no
    move: yes
    write: yes
    delete: yes
    resume: ask
    incremental: no
    quiet_fallback: skip
    none_rec_fallback: skip
    timid: no
    languages: en
    log: ~/beets-import.log
lyrics:
    auto: yes

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \.$: _
    \s+$: ''

match:
    strong_rec_thresh: 0.3
    medium_rec_thresh: 0.25
    rec_gap_thresh: 0.25
    max_rec:
        missing_tracks: medium
        unmatched_tracks: medium
    distance_weights:
        source: 2.0
        artist: 3.0
        album: 3.0
        media: 1.0
        mediums: 1.0
        year: 1.0
        country: 0.5
        label: 0.5
        catalognum: 0.5
        albumdisambig: 0.5
        album_id: 5.0
        tracks: 2.0
        missing_tracks: 0.9
        unmatched_tracks: 0.6
        track_title: 3.0
        track_artist: 2.0
        track_index: 1.0
        track_length: 2.0
        track_id: 5.0
    preferred:
        countries: []
        media: []
        original_year: no
    ignored: []
    track_length_grace: 10
    track_length_max: 30
scrub:
    auto: yes
embedart:
    auto: yes
    maxwidth: 0
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
lastgenre:
    auto: yes
    source: album
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    force: yes
    separator: ', '
    prefer_specific: no
lastfm:
    user: bryangauvin
plex:
    host: localhost
    port: 32400

paths:
    default: $albumartist/$album%aunique{}/$track - $title
    singleton: Non-Album/$artist - $title
    comp: Compilations/$album%aunique{}/$track - $title
    albumtype_soundtrack: Soundtracks/$album/$track $title
acoustid:
    apikey: REDACTED
acousticbrainz:
    auto: yes
    force: no
    tags: []
fetchart:
    auto: yes
    cautious: yes
    cover_names: cover folder
    sources: coverart itunes amazon albumart
    store_source: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
chroma:
    auto: yes
duplicates:
    full: yes
    path: yes
    tag: beetdupe=1
    merge: yes
    count: yes
    album: no
    checksum: ''
    copy: ''
    delete: no
    format: ''
    keys: []
    move: ''
    tiebreak: {}
    strict: no
badfiles:
    commands:
        mp3: mp3val
        flac: flac
convert:
    auto: yes
    silent: yes
    ffmpeg: /usr/bin/ffmpeg
    opts: -ab 320k -ac 2 -ar 48000
    max_bitrate: 320
    threads: 5
    convert: yes
    copy_album_art: yes
    dest: \\ABRP\New Volume\Music-Mp3
    embed: yes
    quiet: no
    never_convert_lossy_files: yes
    format: mp3
    formats:
        mp3:
            command: ffmpeg -i -y $source -codec:a libmp3lame -qscale:a 0 $dest
            extension: mp3
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest

    paths:
        default: $albumartist/$title
    pretend: no
    id3v23: inherit
    tmpdir:
    no_convert: ''
    album_art_maxwidth: 0
bucket:
    bucket_year: []
    bucket_alpha: []
    bucket_alpha_regex: {}
    extrapolate: no
the:
    the: yes
    a: yes
    format: '{0}, {1}'
    strip: no
    patterns: []
ftintitle:
    auto: yes
    drop: no
    format: feat. {0}
pathfields: {}
item_fields: {}
album_fields: {}
missing:
    count: no
    total: no
    album: no

@sampsyo
Copy link
Member

sampsyo commented Feb 24, 2019

Thanks! I've pushed a possible fix. Can you please verify that this fixes the error for you?

@bryangauvin
Copy link
Author

I tried to pip upgrade and its stating that I am up to date

pip install -U beets

Requirement already up-to-date: beets in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (1.4.8)
Requirement already satisfied, skipping upgrade: six>=1.9 in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (1.12.0)
Requirement already satisfied, skipping upgrade: mutagen>=1.33 in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (1.42.0)
Requirement already satisfied, skipping upgrade: munkres~=1.0.0 in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (1.0.12)
Requirement already satisfied, skipping upgrade: unidecode in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (1.0.23)
Requirement already satisfied, skipping upgrade: musicbrainzngs>=0.4 in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (0.6)
Requirement already satisfied, skipping upgrade: pyyaml in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (3.13)
Requirement already satisfied, skipping upgrade: jellyfish in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (0.7.1)
Requirement already satisfied, skipping upgrade: colorama in c:\users\bryan\appdata\local\programs\python\python36\lib\site-packages (from beets) (0.4.1)

@sampsyo
Copy link
Member

sampsyo commented Feb 24, 2019

You will need to run from source (see the FAQ).

@bryangauvin
Copy link
Author

bryangauvin commented Feb 24, 2019 via email

@sampsyo
Copy link
Member

sampsyo commented Feb 24, 2019

Excellent; thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

2 participants