Wrangler: [dev] panic when already running wrangler dev in another terminal

Created on 11 May 2020  ·  4Comments  ·  Source: cloudflare/wrangler

🐛 Bug Report

A search of issues reveals this is briefly mentioned in someone's feedback in #1047 , but I figured it's worth having its own issue.

Environment

  • operating system: macOS 10.14.6 (18G103)
  • output of rustc -V: rustc 1.41.0 (5e1a79984 2020-01-27)
  • output of node -v: v12.16.2
  • output of wrangler -V: 👷 ✨ wrangler 1.9.0
  • contents of wrangler.toml:
name = "typescript-demo"
type = "webpack"
account_id = "e733c486ff936cfb7cdf644badc953e2"
workers_dev = true
route = ""
zone_id = ""
webpack_config = "webpack.config.js"

Steps to reproduce

  1. Open a terminal and navigate to the root of a wrangler project.
  2. Run wrangler dev
  3. Open another terminal and navigate to the same directory as previously.
  4. Run wrangler dev

What did you expect to see?

A polite error message and a graceful shutdown.

What did you see instead?

➜ wrangler dev

[ truncated ]

⬇️ Installing wranglerjs...
⬇️ Installing wasm-pack...
Warning: webpack's output filename is being renamed to worker.js because of requirements from the Workers runtime
✨  Built successfully, built project size is 5 KiB.
thread 'tokio-runtime-worker' panicked at 'error binding to 127.0.0.1:8787: error creating server listener: Address already in use (os error 48)', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.13.5/src/server/mod.rs:124:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
⬇️ Installing wranglerjs...
Error: panic
bug duplicate user report

All 4 comments

@EverlastingBugstopper there should be a function we can pull up from /tail for gracefully assigning ports.

I think for this one we should just have an error message letting them know that they should re-run dev with another port instead of auto-provisioning one since it's user facing.

fwiw the function in question errors if a preferred port is passed: https://github.com/cloudflare/wrangler/blob/master/src/commands/tail/mod.rs#L30

cool ill throw it in utils

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EverlastingBugstopper picture EverlastingBugstopper  ·  3Comments

mxdpeep picture mxdpeep  ·  6Comments

steveklabnik picture steveklabnik  ·  7Comments

EverlastingBugstopper picture EverlastingBugstopper  ·  6Comments

shyim picture shyim  ·  5Comments