beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.92k stars 1.82k forks source link

SSL error with fetchart and lyrics plugins #2214

Closed snk4ever closed 8 years ago

snk4ever commented 8 years ago

Problem

When I use beet, I get error messages from the lyrics and fetchart plugins.

Running this command in verbose (-vv) mode:

 beet -vv
user configuration: /home/myself/.config/beets/config.yaml
data directory: /home/myself/.config/beets
plugin paths:
** error loading plugin lyrics:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/beets/plugins.py", line 253, in l                                     oad_plugins
    namespace = __import__(modname, None, None)
  File "/usr/local/lib/python2.7/dist-packages/beetsplug/lyrics.py", line 25, in                                      <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 53, i                                     n <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib                                     /pyopenssl.py", line 70, in <module>
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

** error loading plugin fetchart:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/beets/plugins.py", line 253, in l                                     oad_plugins
    namespace = __import__(modname, None, None)
  File "/usr/local/lib/python2.7/dist-packages/beetsplug/fetchart.py", line 25,                                      in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 53, i                                     n <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib                                     /pyopenssl.py", line 70, in <module>
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

Sending event: pluginload
library database: /data/backup/configs/beetsLibrary.blb
library directory: /data/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:
  config            show or edit the user configuration
  convert           convert to external location
  fields            show fields available for queries and format strings
  help (?)          give detailed help on a specific sub-command
  import (imp, im)  import new music
  list (ls)         query the library
  modify (mod)      change metadata fields
  move (mv)         move or copy items
  remove (rm)       remove matching items from the library
  replaygain        analyze for ReplayGain
  scrub             clean audio tags
  stats             show statistics about the library or a query
  update (upd, up)  update the library
  version           output version information
  write             write tag information to files
Sending event: cli_exit

Setup

My configuration (output of beet config) is:

lyrics:
    auto: yes
    import.write: yes
fetchart:
    maxwidth: 600
library: /data/backup/configs/beetsLibrary.blb

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \.$: _
    \s+$: ''
replaygain:
    overwrite: yes
    backend: command
    auto: yes
    targetlevel: 89
    command: ''
    noclip: yes

plugins: scrub convert replaygain

paths:
    default: Albums/$albumartist/$year-$album/$track $title
    singleton: Singles/$artist - $title
    comp: Compil-OST/$album/$track $title
    albumtype:soundtrack: Compil-OST/$album/$track $title
convert:
    auto: yes
    copy_album_art: yes
    embed: no
    never_convert_lossy_files: yes
    format: mp3
    formats:
        mp3:
            command: ffmpeg -i $source -y -vn -aq 0 $dest
            extension: mp3
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        aac:
            command: ffmpeg -i $source -y -vn -acodec libfaac -aq 100 $dest
            extension: m4a
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    album_art_maxwidth: 0
    dest:
    threads: 2
    tmpdir:
    max_bitrate: 500

    paths: {}
    pretend: no
    quiet: no
threaded: yes
art_filename: cover
ignore: .AppleDouble ._* *~ .DS_Store

ui:
    color: yes
directory: /data/music/

import:
    copy: yes
    write: yes
    resume: ask
    art: yes
    quiet_fallback: skip
    timid: yes
    log: beetslog.txt
acoustid:
    apikey: bitLoajn
mpdupdate:
    host: localhost
    port: 6600
    password: hidden
scrub:
    auto: yes
sampsyo commented 8 years ago

Hmm, this looks an unfortunate dependency hell issue—google has plenty of results for other people running into broken Requests setups. Weep for Python's packaging woes. :cry:

Can you try installing a more recent PyOpenSSL (perhaps from pip instead of your OS's repositories)?

ghost commented 8 years ago

It's more of an issue wit Debian's request packages if an outdated requests the problem.

snk4ever commented 8 years ago

Thanks, searching around with your recommandation to update pyopenSSL, I found this: http://stackoverflow.com/questions/28987891/patch-pyopenssl-for-sslv3-issue

I issued these commands: sudo easy_install --upgrade pip pip install requests==2.6.0

Re-enabled the plugins and now I don't get the errors anymore :)

Thanks for your comments.