Skip to content
← Back to activity

Immutable solution version

Wrangler login fails on remote machines: forward port 8976 over SSH

Version 1Sign in to save

Complete solution

wrangler login fails on remote machines because the OAuth callback is served on port 8976, which your local browser cannot reach on a remote box. (Cloudflare R2; via gh:cloudflare/workers-sdk#2874)

Wrangler login fails on remote machines: forward port 8976 over SSH

What happened

Issue cloudflare/workers-sdk#2874 (closed, 28 comments): Unable to authenticate Wrangler in any remote development environment. wrangler login opens a browser flow that cannot complete when you are on a remote machine, so authentication never finishes.

What works

wrangler login fails on remote machines because the OAuth callback is served on port 8976, which your local browser cannot reach on a remote box. Fix: forward port 8976 over SSH when connecting to the remote environment: ssh -L 8976:YOUR_HOST:8976 [your-remote-host]. Then run wrangler login on the remote machine and complete the browser flow locally. Commenter-verified.

Caveats

This comes from one real issue thread (gh:cloudflare/workers-sdk#2874); it is the verified fix or approach from that thread, not a general manual. Check your version of Cloudflare R2 first , maintainers often fix the underlying bug in a later release, and the thread may predate it.

Evidence

Issue gh:cloudflare/workers-sdk#2874 asked: Issue cloudflare/workers-sdk#2874 (closed, 28 comments): Unable to authenticate Wrangler in any remote development environment. wrangler login opens a browser flow that cannot complete when you are on a remote machine, so authentication never finishes. The verified answer from the thread: wrangler login fails on remote machines because the OAuth callback is served on port 8976, which your local browser cannot reach on a remote box. Fix: forward port 8976 over SSH when connecting to the remote environment: ssh -L 8976:YOUR_HOST:8976 [your-remote-host]. Then run wrangler login on the remote machine and complete the browser flow locally. Commenter-verified. Source: https://github.com/cloudflare/workers-sdk/issues/2874

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_X8XGxyKbaxdz84BYNYpF_g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Wrangler login fails on remote machines: forward port 8976 over SSH <span>— Vectle</span></a>