Repository navigation
feat(railway): circuit-break pull cycle on invalid_client credential rejection #SUPERLOG - #535
Open
superlog-app[bot] wants to merge 1 commit into
Open
superlog-app[bot] wants to merge 1 commit into
superlog-app[bot] wants to merge 1 commit into
Conversation
…rejection #SUPERLOG Delivery-Id: fb0197450e2b26c66bd3120ecf6dba9686c21c0ee7503ada8c43a34d00adcdf4 Delivery-Base: main
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.
Summary
Railway's OAuth server is currently returning
{"error":"invalid_client"}for everyrefresh_tokengrant, indicating Superlog's Railway OAuth app credentials (RAILWAY_CLIENT_ID/RAILWAY_CLIENT_SECRET) have been rejected or revoked. This permanently stalls log/metric ingestion for all 12+ connected Railway installations and produces 12+railway token refresh failedERROR logs per minute (one per installation, every pull cycle).Root cause
invalid_clientis an application-level credential rejection — Railway refuses the OAuth app's client credentials, not the per-installation refresh token. Because all installations share the sameclient_id+client_secret, every installation fails identically on every tick. The puller previously treatedinvalid_clientidentically toinvalid_grant(user-revoked per-installation access): it loggedrailway token refresh failedper installation and continued to the next one, hammering Railway's token endpoint 12+ times per minute with requests that will all fail.Remediation
External action required (unblocks ingestion): Rotate the Railway OAuth application credentials in the Railway developer portal and update
RAILWAY_CLIENT_ID/RAILWAY_CLIENT_SECRETin production secrets. This code change alone does not restore ingestion.This PR (prevents token-endpoint hammering and improves signal clarity): Adds an
appLevelOAuthErrorclosure flag inrunRailwayPullOnce. When the firstinvalid_clientresponse is detected:This reduces Railway token-endpoint traffic from 12+ requests/minute to 1, and collapses the error signal from 12+ per cycle to 1 per cycle, making the failure immediately actionable.
Test
Added
puller.test.tscase: two installations with expiring tokens, Railway token endpoint returns{"error":"invalid_client"}. Asserts token endpoint is hit exactly once,stats.errors === 1, rotation message in logs, and no intake traffic.Incident: drifting-narwhal (e3d893f6-dc5d-40ad-9a78-321d178321ab)
Was this PR helpful? Leave feedback — goes straight to the Superlog team.
Summary by cubic
Circuit-breaks the Railway pull cycle when Railway rejects the OAuth application credentials (
invalid_client) instead of treating it like a per-installation revocation and failing 12+ times per cycle.Previously,
invalid_clientwas handled likeinvalid_grant, so every installation hit the token endpoint with requests that all failed, producing 12+railway token refresh failederrors per minute. Now the firstinvalid_clientstops the loop: one error is logged with credential-rotation guidance, no further token requests are issued in that cycle, and token-endpoint traffic drops from 12+/minute to 1. Added a test asserting the token endpoint is hit exactly once and no intake traffic occurs.Rollout action
Rotate the Railway OAuth app credentials in the developer portal and update
RAILWAY_CLIENT_ID/RAILWAY_CLIENT_SECRETin production secrets — this code change alone does not restore ingestion.Written for commit 537ddd9. Summary will update on new commits.