Sign in as a Carbon or Silicon

Errors

Every failure has the same shape, in the CLI (--json: one object on stderr, empty stdout), the daemon protocol and the backend:

JSONjson
{"error": {"code": "spotify_auth_required", "message": "what happened and why",
           "hint": "the exact next step", "retryable": false, "details": {…}}}

Branch on code, never on message. retryable: true means repeating the same request later can succeed. details carries evidence (stderr excerpts, both attempts of a verified action, request ids).

Exit codes

ExitMeaning
0success
1the operation failed (see code); every code not listed below
2usage: bad arguments or input (invalid_input, usage, threshold_passed)
3not signed in (not_authenticated, spotify_auth_required)
4refused (automation_permission_denied, permission_denied, forbidden, recipient_not_registered)
5unavailable (daemon_unavailable, backend_unavailable, dependency_unavailable, transport, rate_limited, timeout)

Bad arguments

Bad arguments are caught before anything runs, with exit 2. Parser errors are usage and keep what the parser knows in details: usage (the command's usage line, also when the parser's own text has none), argument (e.g. "--limit <LIMIT>"), value (the value it refused) and possible_values, when they apply. The hint always includes the usage line. Values the parser accepts but the command cannot use are invalid_input. Examples:

Codes

Input and sign-in

CodeExitMeaningFix
invalid_input / usage2arguments or values are wrong: a malformed Spotify id or link, a reference of the wrong kind, search words given to lyrics, a limit out of range, a config value of the wrong type, a config set given key=value instead of JSON, an empty docs --search, a report --attach file that is not text, an unknown subcommand, or Spotify answering 400 Bad Requestthe hint shows the accepted forms or the command meant; <command> --help
not_authenticated3no Silicon Accounts session in this home, or it was revoked or expired (the backend's unauthenticated)spotify login '<SLT>', with an SLT from silicon-accounts, Silicon Silicon Accounts's own CLI (silicon-apps install silicon-accounts; spotify docs auth)
slt_rejected1the SLT expired (~2 min), was used, or is for another appmint a fresh one for spotify and log in right away (spotify docs auth)
reconsent_required4Ting feature consent is missing, revoked or changedspotify ting authorize --new, review in Silicon Accounts and complete the request; ordinary login remains signed in
forbidden4Silicon Accounts refused the request (account authorization)check the selected account and sign in again
permission_denied4Spotify refused (403: a playlist you neither own nor collaborate on), or a daemon socket, home or trigger belongs to another user or homeedit only your own playlists; use your own OS user and home

Spotify and playback

CodeExitMeaningFix
spotify_auth_required3spotify_player is not signed in to Spotifyspotify auth login
spotify_player_missing1spotify_player is not installedbrew install spotify_player
spotify_player_failed1spotify_player failed in an unexpected way, printed malformed JSON, or printed text instead of JSON (details: command, stdout, parse_error)retry; spotify doctor; report
spotify_player_busy1another spotify_player instance was starting (retryable)retry in a moment
transport5spotify_player, or the daemon's own Web API request, could not reach the Spotify Web API. For a start it is normally only a fallback.reason (details: connect, timeout, and unanswered: true when the start may have left, which is then looked for in Spotify.app first)check the network and retry
no_active_device1the Web API sees no active device, or answered a start with "Device not found" (or nothing active) also after the devices were listed again. Also a fallback.reason, a status --full warning, and a spotify queue warning (warnings[]: Spotify's upcoming list is empty because nothing plays on any device; retryable)play anything in Spotify.app once
device_not_found1a Web API start (song, episode, show or Liked Songs) found no other active device and no device that is clearly Spotify.app on this Mac in the Web API's device list: no Computer device named like this Mac (scutil --get ComputerName), or, only when that name is unknown, not exactly one Computer device (details.devices: each device's name and type). Normally only a fallback.reason (from: web_api): AppleScript then starts the itemopen Spotify.app and play anything once so it registers with Spotify
device_restricted1the device Spotify.app plays on (a speaker, a TV) takes no commands through the Spotify Web API, so a start cannot be sent there (details.device: its name and type). Normally only a fallback.reason (from: web_api): AppleScript starts the item through Spotify.app, which controls that devicenone under auto; spotify devices connect <id> moves playback to a device that takes commands
web_api_failed1the Spotify Web API answered a start, a lookup or a search with an unexpected status (details: request, status, message, reason; unanswered: true for a start answered 5xx that Spotify.app did not show), named no album or show for the item, answered for Liked Songs without its size, or spotify_player's cached access token has expired (retryable, except for the missing album or show). Normally only a fallback.reason (from: web_api): AppleScript then starts the item. For search it is the error when spotify_player's search failed too (details.first_attempt)none under auto; retry; spotify daemon status shows whether its spotify_player runs
premium_required1Web API playback needs Premium. For a start (song, episode, show, Liked Songs) it is normally only a fallback.reason (from: web_api) and AppleScript plays itspotify config set '{"strategy": "applescript"}'
spotify_not_running1Spotify.app is closedspotify launch
spotify_not_installed1macOS cannot find Spotify.appinstall Spotify
automation_permission_denied4macOS blocks Apple Events to SpotifySystem Settings → Privacy & Security → Automation → spotify-daemon → turn on Spotify (under the terminal app's entry instead when the daemon was started from a terminal: spotify daemon run, or on demand without the launchd agent); not listed: tccutil reset AppleEvents com.unlikefraction.spotify-daemon and retry so macOS asks (spotify docs daemon: Permissions)
applescript_failed1osascript could not run, or AppleScript failed without saying whyretry; spotify doctor
nothing_playing1Spotify has no current itemstart something
nothing_to_resume1resume with nothing loadedspotify play <something>
not_a_podcast1spotify podcast now while the current item is not an episodespotify podcast play spotify:episode:<id>
not_allowed_in_context1Spotify disallows shuffle/repeat hereplay a playlist or album
no_effect1spotify_player accepted a command that did not happen, or its instance logged a refusal; or the Web API accepted a start (song, episode, show, Liked Songs) that Spotify.app did not play in time (details: context, device, offset or position, observed; for a song landed_elsewhere, true when another track of its album played). Usually only a fallback.reason (AppleScript made the change); it is the error under strategy spotify_player, and for repeat when a spotify_player step was not confirmed (retryable; spotify docs playback: Repeat)under auto, none; else retry in a minute
state_mismatch1spotify_player's working state (play state, shuffle, current item) disagrees with Spotify.app, so its command would do nothing or the wrong thing. Under strategy auto it is normally only a fallback.reason and AppleScript made the change; under strategy spotify_player it is the error (retryable). details: spotify_player, spotify_appunder spotify_player: retry after the next track change, or spotify daemon restart
track_mismatch1like/unlike refused: spotify_player can only change its own current track, and that is not the song Spotify.app plays; it did not catch up after one nudge. Nothing changed (retryable; details: spotify_app, spotify_player, catch_up_failed). Not retryable with details.relinked: true: spotify_player plays the same song under another id (track relinking; details.matched_by: linked_from or title_length_album), so it would change that id; nothing changed. Not retryable without relinked: spotify_player's track changed during the command, so the like may have hit another songretry in a few seconds; with relinked, use the heart in Spotify.app; otherwise, if not retryable, check spotify library liked
focus_not_returned—only ever inside refocused.error (or details.refocused.error), never a command error: Spotify.app came to the front during an AppleScript start and macOS ignored both lsappinfo setfront and open -a, so it stayed in front (spotify docs playback: Keeping Spotify.app in the background)switch back yourself; starts through the Web API never bring Spotify.app forward
web_state_stale—a spotify status --full warning: the Web API's playback is for another item than Spotify.app's (or could not be refreshed), so web.stale is true and repeat or shuffle that contradict Spotify.app are left out (retryable). A song it plays under another id (relinked) is the same item: web.relinked, no warningretry in a few seconds; if it keeps naming another item, web describes that item
verification_failed1neither path produced the effect. For play --liked also: once Liked Songs plays, Spotify.app did not show a shuffle change, the restart in list order or the skip to a random song (Liked Songs keeps playing and is not started again; spotify docs playback)check Spotify.app (ads, dialogs, offline)
not_found1no such item, lyrics, trigger, firing or queue entry (a well-formed id that does not exist); play --liked with an empty Liked Songs (nothing is started)the hint names the lookup command
not_playable1Spotify has no release of the song or episode that this account may play (details.reason: market — not in your country; explicit — the account is set not to play explicit content; product — not on your plan); nothing was started and playback was left alonefind another version: spotify search '<title> <artist>' --type track, then spotify play <uri>
unsupported1the underlying tools cannot do this (rename playlists, add episodes to a playlist, repeat-one via AppleScript, like an episode, ad or local file; under strategy spotify_player, a show, an episode or a track with --context when the Web API start failed; under strategy applescript, a radio).the hint names the alternative
rate_limited5Spotify or the backend is limiting (also a fallback.reason when spotify_player's instance logged a 429, with details.request and details.spotify_player, and of a Web API start while a 429's Retry-After pause runs: 1 s to 10 minutes, 30 s when Spotify gives none; searches and lookups wait out the same pause)wait and retry
timeout5Spotify, spotify_player or the daemon did not answer in timeretry; if macOS shows "spotify-daemon wants access to control Spotify", click Allow first
platform_unsupported1this needs macOSrun it on the Mac that plays the music

Triggers and Ting

CodeExitMeaningFix
threshold_passed2a current trigger's checkpoint is already behindlater checkpoint or --scope every
recipient_not_registered4Ting needs feature permission or recipient registrationspotify ting authorize, complete approval, then retry
recipient_changed1the trigger's home now holds another Silicon's session (in spotify trigger history)remove the trigger and create it again as the right Silicon

The managed queue has no codes of its own: items that cannot be queued are invalid_input, an unknown position, id or URI is not_found, and spotify next with an empty managed queue is not an error (it runs Spotify's own next).

Daemon, setup and updates

CodeExitMeaningFix
daemon_unavailable5the daemon is down or unreachablespotify daemon start; see its log
daemon_missing1spotify-daemon is not installed next to spotifyreinstall
daemon_outdated1an older daemon is running and could not be replacedreinstall both from one release; spotify daemon restart
protocol_mismatch1the daemon speaks another protocol version (the CLI replaces an older daemon by itself)spotify daemon restart
unknown_op1the daemon is older than the CLI and does not know the requestspotify daemon restart
daemon_stuck1spotify-daemon did not stop within 10 spgrep -fl spotify-daemon, then kill it
daemon_running1another spotify-daemon already runs for this user (in the daemon log)spotify daemon status; spotify daemon restart replaces it
launchd_failed1spotify daemon install could not register the launchd agent (it needs a logged-in GUI session)log in to the Mac's desktop and retry; spotify daemon start works without launchd
daemon_dir / daemon_bind_failed / daemon_store1the daemon cannot create ~/.silicon-spotify, listen on its socket, or use its databasecheck the permissions and free space of ~/.silicon-spotify; for a corrupt database, stop the daemon and move daemon.sqlite aside (triggers are lost)
doctor_failed1spotify doctor found a required check failing (details.failed names them)run the listed fixes, or spotify setup
homebrew_missing1spotify setup needs Homebrew to install Spotify.app or spotify_playerinstall Homebrew (https://brew.sh), or cargo install spotify_player
install_failed1a brew install run by spotify setup failedrun the brew command yourself to see why
no_release / download_failed / checksum_missing / checksum_mismatch / unpack_failed1spotify update (or the hourly update) found no usable release, or the download did not verify; nothing was installedretry later; report it if it persists
update_not_writable1the update cannot replace the binaries in their directoryre-run the installer (spotify docs usage), or install with Silicon Apps

Files, backend and bugs

CodeExitMeaningFix
store_io / corrupt_store / unsafe_store1a file under $SILICON_HOME/.spotify cannot be read or written, is not valid JSON, or the directory is a symlinkfix or delete the named file (deleting session.json logs you out); use a real directory owned by you
backend_unavailable5the backend could not be reachednetwork; spotify config get api_url
dependency_unavailable5the backend could not reach Silicon Accounts or Ting (retryable)retry later
backend_unexpected_response / backend_error1the backend answered in a shape this CLI does not knowspotify update, then retry
internal1a bugspotify report

Backend codes

The backend API (spotify docs api) answers every error, including framework errors such as a wrong method or an oversized body, with the same envelope and an X-Request-Id header. Its codes by HTTP status:

HTTPCodeMeaning
400invalid_inputthe request is malformed (missing header, bad JSON, bad field); also a request Silicon Accounts rejected as malformed
401unauthenticatedthe bearer or refresh token is missing, malformed, expired or revoked. The CLI shows it as not_authenticated
401slt_rejectedPOST /api/v1/auth/login: Silicon Accounts refused the SLT (expired, used, or minted for another app)
401webhook_unverifiedan /webhook/ delivery failed Silicon Accounts signature, timestamp or header checks (nothing for users to do; the backend logs the reason)
403forbidden, reconsent_required, recipient_not_registeredSilicon Accounts or Ting refused; see the tables above
404not_foundno such route, or Ting does not know the type
405method_not_allowedthe route exists but not for this method; the Allow header lists the methods it accepts
409conflictan Idempotency-Key was reused with a different request; retry the original request with its original key
413payload_too_largethe body is over 512 KiB; shorten the report or its attachments
429rate_limitedslow down; retryable: true
500internala bug; report it with the X-Request-Id
503dependency_unavailableSilicon Accounts or Ting is unreachable or refused the backend's own credentials; retryable: true

Through the CLI, every 401 is reported as not_authenticated (exit 3), except that spotify login reports a refused SLT as slt_rejected (exit 1). conflict, payload_too_large and method_not_allowed exit 1, and dependency_unavailable exits 5. Ting's own refusals pass through with Ting's code.

Offline: spotify docs errors · Source: docs/errors.md