Title: Sign-in callback 500s: replayed/cookie-less /google/auth throws MismatchingStateError as a bare GAE error page · Issue #210 · vpython/glowscript · GitHub
Open Graph Title: Sign-in callback 500s: replayed/cookie-less /google/auth throws MismatchingStateError as a bare GAE error page · Issue #210 · vpython/glowscript
X Title: Sign-in callback 500s: replayed/cookie-less /google/auth throws MismatchingStateError as a bare GAE error page · Issue #210 · vpython/glowscript
Description: Field report "glowscript.org is throwing 500s" — first morning of fall semester, from a classroom. The site was in fact healthy (910 successful sign-ins before 8:40am Pacific); what the classroom saw was the sign-in callback failing with...
Open Graph Description: Field report "glowscript.org is throwing 500s" — first morning of fall semester, from a classroom. The site was in fact healthy (910 successful sign-ins before 8:40am Pacific); what the classroom s...
X Description: Field report "glowscript.org is throwing 500s" — first morning of fall semester, from a classroom. The site was in fact healthy (910 successful sign-ins before 8:40am Pacific); what the c...
Opengraph URL: https://github.com/vpython/glowscript/issues/210
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sign-in callback 500s: replayed/cookie-less /google/auth throws MismatchingStateError as a bare GAE error page","articleBody":"## Field report\n\n\"glowscript.org is throwing 500s\" — first morning of fall semester, from a classroom. The site was in fact healthy (910 successful sign-ins before 8:40am Pacific); what the classroom saw was the sign-in callback failing with Google's bare \"500 Server Error\" page.\n\n## The mechanism\n\nThe authlib OAuth state is **single-use** and lives in the session cookie. `/google/auth` therefore 500s with `MismatchingStateError` for two real populations:\n\n1. **Anyone who refreshes the callback URL.** The state was consumed on the first attempt, so every subsequent load of the same URL can only fail. Observed live: one machine (a classroom podium or projector box, from the IP) retried a single dead callback **68 times**, each retry rendering the bare 500 page. From inside that room, the site is down.\n2. **Browsers that refuse the session cookie** — no state is ever stored, so the first attempt fails the same way.\n\n## How long has this been happening?\n\nAs far back as log retention reaches — a steady **1–2% of all sign-ins**, at summer traffic (~150/day) and semester traffic (900+/day) alike:\n\n| day | ok | 500 | rate |\n|---|---|---|---|\n| Aug 04 | 156 | 2 | 1.3% |\n| Aug 18 | ~896 | 4 | 0.4% |\n| Aug 25 | ~887 | 13 | 1.4% |\n| Aug 28 | ~883 | 17 | 1.9% |\n| Sep 01 | 910 | 90 | 9% raw / ~2.4% excluding the one 68-retry machine |\n\nThe last deploy was July 15; the rate is unchanged across it. Nothing regressed — semester start just made a chronic failure loud enough to be reported.\n\n## The fix\n\nA retry of the same callback URL can never succeed, so the only useful response is a clean landing where the user can start over. Catch `OAuthError` around `authorize_access_token()` and redirect to `/`; same for the bare-`/google/auth`-with-no-state branch, which currently logs \"Yikes!\" and then falls through to a guaranteed crash.\n\nPR follows with tests that reproduce the exact production exception.\n\n(Separately observed while diagnosing, not part of this issue: a ~7-minute whole-site outage 15:46–15:53 UTC today caused by App Engine declining to schedule instances for 37 minutes — no quota, billing, or config cause visible, no declared GCP incident. `min_instances: 1` would have ridden through it; worth its own discussion.)","author":{"url":"https://github.com/sspickle","@type":"Person","name":"sspickle"},"datePublished":"2026-09-01T16:01:02Z","url":"https://github.com/vpython/glowscript/issues/210"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:930677a6-6be8-0f09-b939-13a03ea1f36d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED7A:7B930:706198:9998A5:6B007A20 |
| html-safe-nonce | d208099c52f336a00ff3ee2ed8f3c2566c5aa30658d133e0efd3a7bbc352e98c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDdBOjdCOTMwOjcwNjE5ODo5OTk4QTU6NkIwMDdBMjAiLCJ2aXNpdG9yX2lkIjoiNTQ4NjcyMjQyMzUxODY4OTgyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a91717ee1f1f26fff9027def6040396e9eb2b7e23ecfa905cbe2082082830204 |
| hovercard-subject-tag | issue:5314038359 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/vpython/glowscript/210/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7745960814daa2c7da1105560398977f62c65fc967135e09dfbc8258fafd2c19/vpython/glowscript/issues/210 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7745960814daa2c7da1105560398977f62c65fc967135e09dfbc8258fafd2c19/vpython/glowscript/issues/210 |
| og:image:alt | Field report "glowscript.org is throwing 500s" — first morning of fall semester, from a classroom. The site was in fact healthy (910 successful sign-ins before 8:40am Pacific); what the classroom s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sspickle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83 |
| turbo-cache-control | no-preview |
| go-import | github.com/vpython/glowscript git https://github.com/vpython/glowscript.git |
| octolytics-dimension-user_id | 1280757 |
| octolytics-dimension-user_login | vpython |
| octolytics-dimension-repository_id | 187905631 |
| octolytics-dimension-repository_nwo | vpython/glowscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 187905631 |
| octolytics-dimension-repository_network_root_nwo | vpython/glowscript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1bc2aa1939001689f5ce935982c10a6138f745c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width