Skip to content

Spotify authorization failed #6270

@Dibz15

Description

@Dibz15

Problem

Running this command in verbose (-vv) mode:

beet -vv spotify "Journey"

Led to this problem:

user configuration: /config/config.yaml
data directory: /config
plugin paths: []
Loading plugins: chroma, convert, deezer, embedart, fetchart, fromfilename, lastgenre, lyrics, musicbrainz, replaygain, scrub, spotify, web
fetchart: google: Disabling art source due to missing key
fetchart: lastfm: Disabling art source due to missing key
lastgenre: Loading whitelist /lsiopy/lib/python3.12/site-packages/beetsplug/lastgenre/genres.txt
Sending event: pluginload
library database: /config/musiclibrary.blb
library directory: /music
Sending event: library_opened
Parsed query: AndQuery([OrQuery([SubstringQuery('artist', 'Journey', fast=True), SubstringQuery('title', 'Journey', fast=True), SubstringQuery('comments', 'Journey', fast=True), SubstringQuery('album', 'Journey', fast=True), SubstringQuery('albumartist', 'Journey', fast=True), SubstringQuery('genre', 'Journey', fast=True)])])
Parsed sort: NullSort()
spotify: Processing 1 tracks...
spotify: Searching Spotify for 'I Need You to Love Me - FredTown Manila Remix artist:'BarlowGirl' album:'Our Journey...So Far''
spotify: Spotify access token has expired. Reauthenticating.
error: Spotify authorization failed: 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/token
{"error":"invalid_client","error_description":"Invalid client"}

Note: spotify access token has expired. With authentication error. As of two days ago when I last used beets, this wasn't happening (same exact setup).

Setup

  • OS: docker container from linuxserver.io
  • Python version: 3.12
  • beets version: 2.5.1
  • Turning off plugins made problem go away (yes/no): this involves the spotify plugin, so no

My configuration (output of beet config) is:

# --------------- Plugins ---------------

plugins: fetchart embedart convert scrub replaygain lastgenre chroma web fromfilename musicbrainz deezer spotify lyrics
directory: /music
# --------------- Main ---------------

library: /config/musiclibrary.blb
art_filename: albumart

# --------------- Performance ---------------

threaded: yes
original_date: no

# --------------- Tagging ---------------

per_disc_numbering: no
convert:
    auto: no
    ffmpeg: /usr/bin/ffmpeg
    opts: -ab 320k -ac 2 -ar 48000
    max_bitrate: 320
    threads: 1
    dest:
    pretend: no
    link: no
    hardlink: no
    format: mp3
    id3v23: inherit
    write_metadata: yes
    formats:
        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
        mp3: ffmpeg -i $source -y -vn -aq 2 $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
    auto_keep: no
    tmpdir:
    quiet: no
    embed: yes
    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
    delete_originals: no
    playlist:
paths:
    default: $albumartist/$album%aunique{}/$track - $title
    singleton: $albumartist/$title
    comp: Compilations/$album%aunique{}/$track - $title
    albumtype_soundtrack: Soundtracks/$album/$track $title

import:
    write: yes
    copy: no
    move: yes
    resume: ask
    incremental: yes
    quiet_fallback: skip
    timid: no
    log: /config/beet.log
lastgenre:
    auto: yes
    source: album
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    force: no
    keep_existing: no
    separator: ', '
    prefer_specific: no
    title_case: yes
    extended_debug: no
embedart:
    auto: yes
    maxwidth: 0
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    quality: 0
fetchart:
    auto: yes
    minwidth: 0
    maxwidth: 0
    quality: 0
    max_filesize: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    - cover_art_url
    store_source: no
    high_resolution: no
    deinterlace: no
    cover_format:
    google_key: REDACTED
    google_engine: REDACTED
    lastfm_key: REDACTED
    fanarttv_key: REDACTED
replaygain:
    auto: no
    overwrite: no
    backend: command
    threads: 4
    parallel_on_import: no
    per_disc: no
    peak: 'true'
    targetlevel: 89
    r128: [Opus]
    r128_targetlevel: 84
    command: ''
    noclip: yes
scrub:
    auto: yes
lyrics:
    auto: yes
    translate:
        api_key: REDACTED
        from_languages: []
        to_language:
    dist_thresh: 0.11
    fallback:
    force: no
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    print: no
    sources:
    - lrclib
    - google
    - genius
    - tekstowo
    synced: no
    genius_api_key: REDACTED
    local: no
replace:
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    '[\xE8-\xEB]': e
    '[\xEC-\xEF]': i
    '[\xE2-\xE6]': a
    '[\xF2-\xF6]': o
    '[\xF8]': o
    \.$: _
    \s+$: ''
web:
    host: 0.0.0.0
    port: 8337
    cors: ''
    cors_supports_credentials: no
    reverse_proxy: no
    include_paths: no
    readonly: yes
disabled_plugins: []
chroma:
    search_limit: 5
    data_source_mismatch_penalty: 0.5
    auto: yes
musicbrainz:
    search_limit: 5
    data_source_mismatch_penalty: 0.5
    host: musicbrainz.org
    https: no
    ratelimit: 1
    ratelimit_interval: 1
    genres: no
    external_ids:
        discogs: no
        bandcamp: no
        spotify: no
        deezer: no
        tidal: no
    extra_tags: []
deezer:
    search_limit: 5
    data_source_mismatch_penalty: 0.5
    search_query_ascii: no
spotify:
    search_limit: 5
    data_source_mismatch_penalty: 0.5
    search_query_ascii: no
    mode: list
    tiebreak: popularity
    show_failures: no
    region_filter:
    regex: []
    client_id: REDACTED
    client_secret: REDACTED
    tokenfile: spotify_token.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    spotifyspotify plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions