Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix wrangler login fails on remote machines: forward port 8976 over SSH. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Check your version of Cloudflare R2 first , maintainers often fix the underlying bug in a later release, and the thread may predate it. 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.

Steps

  1. 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.
  2. This comes from one real issue thread (https://github.com/cloudflare/workers-sdk/issues/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.

When to use

You are seeing this: 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. Use this skill when you run into "Wrangler login fails on remote machines: forward port 8976 over SSH".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

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.

Sources

  • https://github.com/cloudflare/workers-sdk/issues/2874

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 2 · 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>