FlyWire Link Restorer
Revive old FlyWire / Neuroglancer share links that fail to load. Paste a dead link and hit Restore — the tool auto-detects what kind it is (FlyWire, MICrONS/Minnie, raw source, local_id…) and hands back the correct fixed link for the right viewer. This page is also a test ground keeping the older approaches side by side (session-token fix, middleauth+ bookmarklet/userscript). Everything runs in your browser — nothing is sent anywhere.
Why old links break — “HTTP error 0”
Error retrieving metadata for volume graphene://…/fly_v31: Fetching "" resulted in HTTP error 0
does not mean the data is gone. The fly_v31 production segmentation is still live.
HTTP error 0 means the browser's fetch never completed — an auth/CORS handshake was blocked before a real request was even formed (note the empty "" URL).
What the segmentation actually needs is a live, per-session middleauth token for the prodv1 data server. That token is not stored in the link — it lives in your browser session (cookies on flywire-daf.com / daf-apis.com) and is attached when the fetch happens. So an old link isn't carrying a “stale token”; your session just doesn't have a live one yet.
Try this first — the one-step fix that covers almost every case
Open any FlyWire scene first and let it finish authenticating (complete any Google login popup). That establishes the prodv1 token for your whole session — then every old link you open afterward loads immediately. The usual failure is opening a specific old link as the very first thing, before your session has a token. The native ngl.flywire.ai viewer authenticates bare sources for you; you do not need to edit the link or add any prefix.
About the restorer tool below (experimental)
The interactive restorer, bookmarklet, and userscript below rewrite the source to add a middleauth+ prefix. We learned this is usually not the real fix — the native viewer already authenticates bare sources, and the rewriting can even interfere with its own auth handshake. It's kept here as a test-ground / fallback for odd cases (e.g. local_id scenes you can't re-share). If a link won't load, do the green step above first; reach for these only if that fails.
Restore a link
Paste anything and hit Restore — it figures out the job. It auto-detects the kind of link and routes it: a FlyWire / FAFB scene → the native FlyWire viewer (which authenticates fly_v31); an old MICrONS / Minnie appspot link → Spelunker with middleauth+; a raw graphene:// source → gets the prefix; a local_id → explained. Works on a full URL, a ?json_url=, a bare state id, or pasted JSON. Sign in to CAVE (button below) and it fetches the saved state itself, then routes by the scene's actual contents — so a FlyWire scene hiding on a MICrONS-looking host gets sent to the FlyWire viewer automatically, no JSON pasting. (Pasting the { } JSON still works if you'd rather not sign in.)
Advanced: paste a CAVE token instead of signing in
If the sign-in popup doesn't hand back a token, paste one here. Get it in Python with from caveclient import CAVEclient; print(CAVEclient().auth.token), or read ~/.cloudvolume/secrets/cave-secret.json. It's stored only in this browser (localStorage) and sent only to global.daf-apis.com.
One-click fix: the “FlyWire Fix” bookmarklet
Install this once, then fix any broken scene with a single click — no console, no copy/paste. A local_id scene only exists inside the FlyWire tab, and browser security stops this site from reaching into it — but a bookmarklet runs inside that tab, so it can read the live scene, inject middleauth+, and reload.
Drag this to your bookmarks bar → ★ FlyWire Fix
How to install & use
- Install (once): drag the ★ FlyWire Fix button onto your browser's bookmarks bar. No bar showing? Press
Ctrl+Shift+B. (Or click Copy bookmarklet code, make a new bookmark, and paste it as the bookmark's URL/Location field.) - Use: on a broken FlyWire scene — EM and brain mesh visible but no segmentation (
HTTP error 0) — just click the FlyWire Fix bookmark. The page reloads withmiddleauth+applied; log in if prompted and the 3D segmentation loads. - Make it permanent: hit Share afterward to mint a portable
json_urllink so the scene survives browser/profile changes.
It pops “viewer not found” if clicked on a non-FlyWire page, and “nothing to change” if the source is already middleauth+ (then the issue is login-side — see the checklists below). The bookmarklet is regex-free and pure ASCII so it can't be mangled.
Full automation: the Tampermonkey userscript
The zero-effort tier. Install once and old broken links repair themselves: the userscript watches every ngl.flywire.ai scene, detects the un-authenticated graphene://https:// source before it errors, injects middleauth+, and reloads — no bookmark click, no console. It has a reload-loop guard (if the fix doesn't stick because you're logged out, it stops and shows a button instead of looping) and a manual ⚡ Fix segmentation auth button as a fallback.
Requires the Tampermonkey browser extension.
Then click here to install the script — Tampermonkey will open its install page automatically (it recognizes the .user.js URL). (Served from borkbook so Brave doesn't block it the way it can block raw.githubusercontent.com.)
How it behaves & how to tune it
- Auto-fix on by default. Open
AUTO_FIX: falsein the script'sCONFIGblock if you'd rather click the button each time instead of auto-reloading. - Won't touch healthy scenes — it only acts when a bare
graphene://https://source is present (already-middleauth+scenes are left alone). - Won't loop. If a repaired page comes back still-broken within 8 s (almost always “not logged in”), it stops auto-firing and shows the manual button + a login hint.
- Still finish with Share to mint a portable
json_urllink — the userscript fixes loading, but Share is what makes alocal_idscene durable.
Source lives in the workspace repo at tampermonkey-scripts/flywire-segmentation-auth-fix.user.js alongside the WebKnossos userscripts.
Manual alternative: the browser console
Prefer not to install a bookmarklet? Do the same fix by hand from the console. The FlyWire viewer hides Neuroglancer's raw Source field and a local_id URL has no JSON to paste here, so this runs at the JSON level: it reads the open scene, injects middleauth+, and reloads as a portable inline-state (#!) link.
What it does & what to do after
- Open the broken scene in
ngl.flywire.ai, press F12, click Console. - Paste the one-liner and hit Enter. The page reloads at a
#!inline-state URL withmiddleauth+added to the segmentation source. - Complete the Google login popup if it appears. The 3D meshes should load and segments become selectable (so you can finally refresh those red outdated IDs).
- Click Share to mint a portable
json_urllink — now the scene survives browser/profile changes and never needs this again.
Always use the Copy button above — do not copy this line out of a chat window or a doc viewer. Those often substitute “smart” curly quotes for straight ones, which makes the console throw Invalid or unexpected token. The Copy button hands over exact ASCII. (The snippet also uses plain split/join rather than a regex so escaped slashes can't be mangled either.)
If the console prints viewer is not defined: skip the console. Click Share to generate a link, open its json_url address (the …/nglstate/… URL) in a new tab while logged in to see the raw JSON, copy all of it, and paste it into the Restore a link box above — JSON mode injects middleauth+ and hands you a ready-to-open #! link.
If it still won't load after restoring
The middleauth+ prefix is only half the fix — the viewer also needs your FlyWire token. Do these in order:
Full recovery checklist
- Log in first. Open the FlyWire production site and authenticate with your FlyWire-authorized Google account (the one with FAFB /
prodv1access). Then re-open the link in the same browser so the token/cookie is present. - Use the current viewer. Open it in FlyWire's own Neuroglancer (
ngl.flywire.ai), not a genericneuroglancer.org/ Spelunker tab — a generic viewer won't perform the middleauth handshake and will reliably throw error 0. (Use the “rebase viewer” checkbox above.) - Edit the source by hand if needed: in the layer's data-source field, prepend
middleauth+so it readsgraphene://middleauth+https://prodv1.flywire-daf.com/segmentation/1.0/fly_v31and reload the layer. - Batch / programmatic rescue for many links: use
fafbsegto parse the old short link, extract the scene + segment IDs, and regenerate a fresh authed URL — R:fafbseg::flywire_expandurl(); Python: thefafbseg.flywireURL helpers.
Caveat: if the link references a very old materialization, its root IDs may have since been edited (merges/splits). The scene will load but some IDs may show as “outdated” — fafbseg can update them to their latest roots. Fix the volume loading first.
Stuck on “You are not logged in. Refresh the page…”?
That panel is the middleauth Google-OAuth handshake. Fixes, in order of likelihood:
- Allow popups for
ngl.flywire.ai, then refresh (F5). A popup blocker silently eating the Google login popup is the #1 cause of “I refreshed and nothing happened.” - Allow third-party cookies for
*.flywire-daf.comanddaf-apis.com. If they are blocked, the token handoff between the auth server and the viewer fails and you loop forever. (An Incognito window with shields down is a quick test.) - On Brave: drop the Shields. Click the Shields (lion) icon on
ngl.flywire.aiand turn it down for this site. Brave blocks third-party cookies and cross-site requests by default, which severs the middleauth handshake betweenngl.flywire.ai,*.flywire-daf.com, anddaf-apis.com— producingHTTP error 0even on a correctmiddleauth+source and even when you are logged in. This is a common cause that looks exactly like the original bug. - Logging in “twice” is expected, not a bug. middleauth grants a token at the global auth layer first, then the specific data server (
prodv1) requires its own access grant — so you legitimately get two prompts. Complete both. - Break a half-authed loop: clear cookies / site data for the
flywire-daf.comanddaf-apis.comdomains (or use a fresh Incognito window), then load the link again to discard a stale/partial token.
On a local_id link this matters extra: that scene lives only in the browser profile that created it. If it is the original browser, getting past login is all you need. If it is a different browser, login won't help — there is no server copy to load (see the result note when you paste one above).
Scene loads but the segmentation is broken (3D empty, can't select in 2D)?
If the EM image and a brain mesh appear but the segmentation layer throws HTTP error 0 — no meshes in 3D, nothing selectable in 2D, “outdated” IDs you can't refresh — then only the graphene segmentation source is failing. The EM and brain mesh are public sources; the segmentation is the one source that needs auth, and it is stored with the bare graphene://https://… form. The fix is the layer source, not the page URL — so re-running a local_id URL through this tool won't help (it carries no editable JSON). Do one of:
Quick (live edit): click the segmentation layer tab (e.g. Production-segmentation_with_graph) → open its Source tab → change graphene://https://prodv1.flywire-daf.com/… to graphene://middleauth+https://prodv1.flywire-daf.com/… and complete the login popup. Re-check “Load layer meshes (requires refresh).”
Robust (also gives a portable link): open the viewer's { } JSON-state editor → copy the whole state → paste it into the JSON box above to add middleauth+ → copy the result back into the editor and apply → log in if prompted. Then hit Share to mint a json_url link so the scene is portable and won't rot. Once the segmentation loads, you can select/deselect again and refresh the outdated (red) root IDs.
Old MICrONS / appspot links (a different problem)
Everything above is about FlyWire links whose data needs a token. Links shaped like neuromancer-seung-import.appspot.com/?json_url=https://www.dynamicannotationframework.com/nglstate/<id> (older MICrONS / Minnie65 scenes) fail for an unrelated reason. The Restore a link box at the top handles these too — paste one (or just its numeric state id) and it returns a working Spelunker link. The how/why is below.
www.dynamicannotationframework.com no longer answers at all (the connection is refused), so the viewer fetches the saved state, gets nothing, and shows an empty scene. The state server's domain was retired — the scene wasn't deleted. The same numeric ID still resolves on the current CAVE state server at
https://global.daf-apis.com/nglstate/api/v1/<id>; it just sits behind a Google/CAVE login now (hitting it un-authenticated redirects to OAuth rather than 404ing).
To recover one of these links:
- Swap the dead host for the live one — keep the numeric ID, change the rest:
www.dynamicannotationframework.com/nglstate/<id>→global.daf-apis.com/nglstate/api/v1/<id> - Be logged into CAVE first (same Google account you use for the data) so the state server hands the JSON over.
- Open it in a current viewer that does middleauth — e.g. Spelunker (
spelunker.cave-explorer.org). The oldappspotviewer predates this auth flow and often can't fetch the migrated state even when you're logged in.
If the link is instead a long self-contained #!%7B…%7D URL (the whole scene encoded inline, no json_url), there's no state server involved — it depends only on the viewer still running and the underlying precomputed://gs://… layers still being readable. Those usually still open.
Scene opens but the EM is black / loads forever (dead EM image)
Some old Minnie65 scenes point their EM image at an intermediate alignment on gs://microns-seunglab/minnie_v4/alignment/…/image_stitch_multi_block_v1. The lab garbage-collected those voxels, but the precomputed info header survives — so the layer still "loads," forever, as black tiles (the viewer keeps requesting chunks that 404). The segmentation still works because its data/meshes are still hosted; only the EM image is dead.
The tissue itself isn't gone — the released public EM (gs://iarpa_microns/minnie/minnie65/em) is alive. Fix: open the scene's { } JSON editor in Spelunker, copy the whole state, and paste it into the Restore a link box above. It repoints the dead EM image to the public release EM and hands back a self-contained Spelunker link (no login — public data). Segmentation, annotations, and position are left untouched.
Eyeball the registration afterward: the public EM is a later alignment of the same data, so if it looks slightly shifted against the segmentation, that old scene used a different alignment version (rare; usually it lines up).
Pull the state JSON yourself with caveclient
Once you're authenticated, dump any of these states to disk by ID and reload it into any neuroglancer:
from caveclient import CAVEclient
client = CAVEclient() # uses your ~/.cloudvolume cave-secret.json
state = client.state.get_state_json(6123190777020416)
# 'state' is the full neuroglancer state dict
client.state is the JSONService and defaults to the global.daf-apis.com server, so the ID from the old link is all you need.
Self-test
Runs the restoration logic against built-in cases so you can confirm it behaves before trusting it on a real link.