Skip to content

fix(compose): give the orchestrator the spotify service key - #10

Merged
mattDev0 merged 1 commit into
mainfrom
fix/orchestrator-spotify-key
Sep 1, 2026
Merged

fix(compose): give the orchestrator the spotify service key#10
mattDev0 merged 1 commit into
mainfrom
fix/orchestrator-spotify-key

Conversation

@mattDev0

@mattDev0 mattDev0 commented Sep 1, 2026

Copy link
Copy Markdown
Owner

The service deployed and is polling correctly — 50 plays captured, all three scopes granted — but every dashboard request returns 503.

Cause

SPOTIFY_SERVICE_KEY was passed to spotify-service and never to orchestrator. The orchestrator sent an empty key and the service rejected it:

Spotify service unreachable on /overview: 401 Unauthorized: [no body]

Networking was never the problem — from inside the orchestrator container:

http://devops-spotify:3002/livez     -> 200
http://devops-spotify:3002/overview  -> 401   (no key)

Only the shared secret was missing. Same shape as the previous failure: I wired the new service into compose but missed one of the connections into it.

Fix

  • SPOTIFY_URL and SPOTIFY_SERVICE_KEY passed to the orchestrator
  • spotify-service added to its depends_on

Also: stop reporting a rejected key as an outage

The 401 surfaced as "Spotify service is unreachable", which points the reader at the network when the fault is configuration. That cost real diagnosis time here.

HttpClientErrorException.Unauthorized is now caught separately and reports "Spotify service rejected the configured service key". The orchestrator also warns at startup when the key is unset, because in that state every single request fails identically.

This is the same lesson as the earlier Spotify "Offline" bug: an error that collapses distinct causes into one message hides the one that matters.

mvn test    24 passed

Deploying

SPOTIFY_SERVICE_KEY is already in the server .env from the earlier setup, so no new secrets are needed — the orchestrator just needs to be handed it.

The spotify service deployed and started polling correctly, but every
dashboard request returned 503. SPOTIFY_SERVICE_KEY was passed to the
spotify service and never to the orchestrator, so the orchestrator sent an
empty key and the service rejected it:

    Spotify service unreachable on /overview: 401 Unauthorized

Networking was fine throughout; /livez answered 200 from inside the
orchestrator container. Only the shared secret was missing.

Passes SPOTIFY_URL and SPOTIFY_SERVICE_KEY to the orchestrator and adds
spotify-service to its depends_on.

Also stops a rejected key being reported as an outage. A 401 is a
configuration fault and now says so, rather than surfacing as "Spotify
service is unreachable" and sending the reader to look at the network. The
orchestrator additionally warns at startup when the key is unset, since in
that state every request fails the same way.
@mattDev0
mattDev0 merged commit 39a86fa into main Sep 1, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant