Open newsve opened 6 months ago
@newsve Maybe a little different, but I have a similar problem on VS Code's DevContainer.
maybe help you this workaround https://developers.cloudflare.com/workers/wrangler/commands/#use-wrangler-login-on-a-remote-machine
@newsve Maybe a little different, but I have a similar problem on VS Code's DevContainer.
I'm also trying to do this in a VS Code DevContainer and having issues. If I open the URL in a browser and use the browser's dev tools to obtain the callback URL, then try to use curl to open the callback URL, it just hangs forever. I eventually get a timeout on the 'wrangler login' terminal, but it doesn't exit back to the prompt. The curl command is just hung there and doesn't time out. If I hit CTRL-C to exit curl, then the 'wrangler login' exits and goes back to a prompt, too.
This is the curl output:
GET /oauth/callback\?code\=...SNIP...\&scope\=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20constellation%3Awrite%20ai%3Awrite%20queues%3Awrite%20offline_access\&state\=...SNIP... HTTP/1.1 Host: localhost:8976 User-Agent: curl/7.88.1 Accept: /
It is clearly connecting to wrangler, but wrangler is not recognizing it or proceeding.
Also, it's worth noting that I tried this with and without the port forwarding from VS Code DevContainers.
Also run in vscode devcontainer, I can't make it work using the workaround, but rather I configured the CLOUDFLARE_ACCOUNT_ID
and CLOUDFLARE_API_TOKEN
in .env, and works.
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.51.2
What version of Node are you using?
20.12.1
What operating system and version are you using?
macOS 14.4.1
Describe the Bug
Observed behavior
Please describe.
npx wrangler login
Fwiw, I tried every possible permutation of the curl command.
Expected behavior
A successful login
related but closed again: https://github.com/cloudflare/workers-sdk/issues/2874
Please provide a link to a minimal reproduction
Follow aforementioned steps closely.
Please provide any relevant error logs
when running curl -v I got: