fix(compose): give the orchestrator the spotify service key - #10
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The service deployed and is polling correctly — 50 plays captured, all three scopes granted — but every dashboard request returns 503.
Cause
SPOTIFY_SERVICE_KEYwas passed tospotify-serviceand never toorchestrator. The orchestrator sent an empty key and the service rejected it:Networking was never the problem — from inside the orchestrator container:
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_URLandSPOTIFY_SERVICE_KEYpassed to the orchestratorspotify-serviceadded to itsdepends_onAlso: 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.Unauthorizedis 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.
Deploying
SPOTIFY_SERVICE_KEYis already in the server.envfrom the earlier setup, so no new secrets are needed — the orchestrator just needs to be handed it.