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

Problem running beets import #2437

Closed
gatlinnewhouse opened this issue Feb 12, 2017 · 8 comments
Closed

Problem running beets import #2437

gatlinnewhouse opened this issue Feb 12, 2017 · 8 comments

Comments

@gatlinnewhouse
Copy link

gatlinnewhouse commented Feb 12, 2017

Problem

(Describe your problem, feature request, or discussion topic here. If you're reporting a bug, please fill out this and the "Setup" section below. Otherwise, you can delete them.)

Running this command in verbose (-vv) mode:

$ beet -vv (... paste here ...)

Led to this problem:

user configuration: /home/delueze/.config/beets/config.yaml
data directory: /home/delueze/.config/beets
plugin paths: /home/delueze/.config/beets/plugins
Sending event: pluginload
artresizer: method is (2, (6, 9, 7))
library database: /home/delueze/.config/beets/library.blb
library directory: /home/delueze/Music
Sending event: library_opened
Usage: 
  beet COMMAND [ARGS...]
  beet help COMMAND

Options:
  --format-item=FORMAT_ITEM
                        print with custom format
  --format-album=FORMAT_ALBUM
                        print with custom format
  -l LIBRARY, --library=LIBRARY
                        library database file to use
  -d DIRECTORY, --directory=DIRECTORY
                        destination music directory
  -v, --verbose         log more details (use twice for even more)
  -c CONFIG, --config=CONFIG
                        path to configuration file
  -h, --help            show this help message and exit

Commands:
  acousticbrainz    fetch metadata from AcousticBrainz
  clearart          remove images from file metadata
  config            show or edit the user configuration
  duplicates (dup)  List duplicate tracks or albums.
  edit              interactively edit metadata
  embedart          embed image files into file metadata
  extractart        extract an image from file metadata
  fetchart          download album art
  fields            show fields available for queries and format strings
  fingerprint       generate fingerprints for items without them
  ftintitle         move featured artists to the title field
  help (?)          give detailed help on a specific sub-command
  import (imp, im)  import new music
  list (ls)         query the library
  lyrics            fetch song lyrics
  mbsync            update metadata from musicbrainz
  missing (miss)    List missing tracks.
  modify (mod)      change metadata fields
  move (mv)         move or copy items
  remove (rm)       remove matching items from the library
  replaygain        analyze for ReplayGain
  rymgenre          fetch genres from rateyourmusic.com
  scrub             clean audio tags
  setlister         create playlist from an artists' latest setlist
  stats             show statistics about the library or a query
  submit            submit Acoustid fingerprints
  update (upd, up)  update the library
  version           output version information
  write             write tag information to files
Sending event: cli_exit

Here's a link to the music files that trigger the bug (if relevant):

Setup

  • OS: Manjaro 64 bit
  • Python version: Python 3.6.0
  • beets version: 1.4.4
  • Turning off plugins made problem go away (yes/no): yes disabling the lyrics plugin made it work

My configuration (output of beet config) is:

############################################################################
## Beets Configuration file.
## ~./config/beets/config.yaml
#############################################################################
 
### Global Options
library: ~/.config/beets/library.blb
directory: ~/Music/
pluginpath: ~/.config/beets/plugins
ignore: .AppleDouble ._* *~ .DS_Store
per_disc_numbering: true
threaded: yes
 
# Plugins
plugins: [
  acousticbrainz,
  bandcamp,
  chroma,
  duplicates,
  edit,
  embedart,
  fetchart,
  ftintitle,
  mbsync,
  missing,
  replaygain,
  rymgenre,
  setlister,
  scrub
]
 
# Import Options
import:
  move: true
  write: true
  delete: false
  resume: ask
  incremental: false
  quiet_fallback: skip
  timid: true
  group_albums: yes
  languages: en
  log: ~/beets-import.log

# Autotagger options
match:
  preferred:
    contries: ['US','GB|UK','JP']
    media: ['CD','Digital Media|File']
    original_year: yes

# Path options
paths:
  default: asciify{$albumartist/$album%aunique{}/$track $title}
  singleton: asciify{$artist/$album%aunique{}/$track $title}
  comp: asciify{Various Artists/$album%aunique{}/$track $title}
 
### Plugin Options

# Embeded album art options
embedart:
   compare_threshold: 80
   maxwidth: 500

# FetchArt options
fetchart:
   minwidth: 500
   sources: coverart albumart wikipedia

# Lyrics options
lyrics:
   force: yes
   google_API_key: SCRUBBED

# rymgenre doesn't run on import, so I use it as a backup
# for when lastgenre is giving me garbage results.
rymgenre:
  classes: primary
  depth: node
 
# Fetch fresh album art for new imports
fetchart:
  sources: coverart itunes amazon albumart
  store_source: yes

# Normalizing audio decibels
# Gstreamer is a pain, but still the correct backend
replaygain:
  backend: gstreamer
  overwrite: yes

# Make playlists from setlists
setlister:
  playlist_dir:~/Music/setlists
 
# Scrub extra metadata
scrub:
  auto: no 

This is the bug encountered:

Traceback (most recent call last):
  File "/usr/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.4', 'console_scripts', 'beet')()
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1209, in main
    _raw_main(args)
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1196, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.6/site-packages/beets/ui/commands.py", line 930, in import_func
    import_files(lib, paths, query)
  File "/usr/lib/python3.6/site-packages/beets/ui/commands.py", line 907, in import_files
    session.run()
  File "/usr/lib/python3.6/site-packages/beets/importer.py", line 319, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/lib/python3.6/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/lib/python3.6/site-packages/six.py", line 686, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/usr/lib/python3.6/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/usr/lib/python3.6/site-packages/beets/importer.py", line 1392, in plugin_stage
    func(session, task)
  File "/usr/lib/python3.6/site-packages/beets/plugins.py", line 124, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 706, in imported
    False, self.config['force'])
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 718, in fetch_item_lyrics
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 718, in <listcomp>
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 751, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 566, in fetch
    data = urllib.request.urlopen(url)
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
@sampsyo
Copy link
Member

sampsyo commented Feb 12, 2017

Thanks! It looks like the Google backend didn't move to Requests, which made errors leak through. Can you please give the above change a try to see if it fixes the problem?


For future reference, the first couple of gray boxes in the template up there are meant to hold the command you ran and the output you got. You've pasted the traceback at the bottom, which is fine for this particular report, but in the future, please include all the details—including the command you ran and the full output.

@gatlinnewhouse
Copy link
Author

Made the fixes as suggested to the relevant files. Everything seems to be in order now.

@gatlinnewhouse
Copy link
Author

Actually wait, something is coming up.

Tagging:
    A Tribe Called Quest - The Low End Theory
URL:
    https://musicbrainz.org/release/e2b51264-ab8f-4168-849d-738e703ac24e
(Similarity: 98.2%) (unmatched tracks, tracks) (CD, 1991, XE, Jive)
 * Buggin' Out              -> Buggin’ Out
 * Verses From The Abstract -> Verses From the Abstract
 * Vibes Anf Stuff          -> Vibes and Stuff (title)
 * Check The Rhime          -> Check the Rhime
 * Jazz (We've Got)         -> Jazz (We’ve Got)
Unmatched tracks (1):
 ! Check The Rhime (Mr. Muhammad's Mix) (Bonus Track Only Japan Edition) (#15) (3:39)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates? A
This album is already in the library!
Old: 14 items, MP3, 320kbps, 48:05, 110.3 MiB
New: 14 items, MP3, 320kbps, 48:05, 110.3 MiB
[S]kip new, Keep both, Remove old? R
Traceback (most recent call last):
  File "/usr/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.4', 'console_scripts', 'beet')()
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1209, in main
    _raw_main(args)
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1196, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.6/site-packages/beets/ui/commands.py", line 930, in import_func
    import_files(lib, paths, query)
  File "/usr/lib/python3.6/site-packages/beets/ui/commands.py", line 907, in import_files
    session.run()
  File "/usr/lib/python3.6/site-packages/beets/importer.py", line 319, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/lib/python3.6/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/lib/python3.6/site-packages/six.py", line 686, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/usr/lib/python3.6/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/usr/lib/python3.6/site-packages/beets/importer.py", line 1392, in plugin_stage
    func(session, task)
  File "/usr/lib/python3.6/site-packages/beets/plugins.py", line 124, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 706, in imported
    False, self.config['force'])
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 718, in fetch_item_lyrics
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 718, in <listcomp>
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 751, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 567, in fetch
    data = json.loads(data)
  File "/usr/lib/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'

@gatlinnewhouse
Copy link
Author

gatlinnewhouse commented Feb 13, 2017

(while running beet import)

@gatlinnewhouse
Copy link
Author

@sampsyo looks like the issue is right here:

  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 751, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "/usr/lib/python3.6/site-packages/beetsplug/lyrics.py", line 567, in fetch
    data = json.loads(data)
  File "/usr/lib/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'

@sampsyo
Copy link
Member

sampsyo commented Feb 13, 2017

Oops; thanks for trying this! I've just pushed one more change.

If you like, you can try running the latest source using instructions that can be found in the FAQ.

@gatlinnewhouse
Copy link
Author

Seems to work fine now!

@sampsyo
Copy link
Member

sampsyo commented Feb 14, 2017

Great! Thanks again for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants