workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

๐Ÿ› BUG: Can't assign requested address; toString() = 192.168.1.146:8788

Open joseflekardal opened this issue 1 year ago โ€ข 0 comments

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.80.0 [wrangler]

What version of Node are you using?

20.17.0

What operating system and version are you using?

macOS Sequoia 15.0

Describe the Bug

Observed behavior

I am not able to run my pages functions locally using Wrangler CLI.

I am running on macOS Sequoia 15.0 but I've seen the same error on Ventura, I've also tried multiple earlier versions of wrangler but they all seem to behave the same way.

Wrangler tries to bind to 192.168.1.146:8788 which is a weird default (I dont use a wrangler.toml file in this example). If i force it to use --ip '127.0.0.1' the command starts just fine but no requests come through, the logs are completely empty.

Expected behavior

At this point I just want to see my hello world working.

Steps to reproduce

Command

wrangler pages dev . --log-level debug

Folder structure

.
โ””โ”€โ”€ functions
    โ””โ”€โ”€ hello.js

hello.js is the standard hello world:

export function onRequest(context) {
  return new Response("Hello, world!")
}

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

 โ›…๏ธ wrangler 3.80.0
-------------------

No experimental flag store instantiated
Attempted to use flag "JSON_CONFIG_FILE" which has not been instantiated
โ–ฒ [WARNING] No compatibility_date was specified. Using today's date: 2024-10-05.

  โฏโฏ Add one to your wrangler.toml file: compatibility_date = "2024-10-05", or
  โฏโฏ Pass it in your terminal: wrangler pages dev [<DIRECTORY>]
  --compatibility-date=2024-10-05
  
  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more
  information.


Compiling worker to "/Users/username/project-name/.wrangler/tmp/pages-HFK0hz/functionsWorker-0.3034340515603402.mjs"...
โœจ Compiled Worker successfully
Retrieving cached values for userId from node_modules/.cache/wrangler
Metrics dispatcher: Posting data {"type":"event","name":"build pages functions","properties":{}}
Using vars defined in .dev.vars
Metrics dispatcher: Posting data {"type":"event","name":"run dev","properties":{"local":true,"usesTypeScript":false}}
โŽ” Starting local server...
workerd/util/symbolizer.c++:101: warning: Not symbolizing stack traces because $LLVM_SYMBOLIZER is not set. To symbolize stack traces, set $LLVM_SYMBOLIZER to the location of the llvm-symbolizer binary. When running tests under bazel, use `--test_env=LLVM_SYMBOLIZER=<path>`.
*** Fatal uncaught kj::Exception: kj/async-io-unix.c++:945: failed: ::bind(sockfd, &addr.generic, addrlen): Can't assign requested address; toString() = 192.168.1.146:8788
stack: 1100630bb 110062e59 11006120d 10d439185 10d439a0e 10d43a25a 10d43a96f 10d3db70f 110090e8d 11009109d 11008f688 11008f3a5 10d3c81e0 /usr/lib/dyld@62cc
Error in ProxyController: Could not connect to InspectorProxyWorker
 MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:9828:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Mutex.runWith (/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:3627:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}
=> Error contextual data: {
  config: {
    name: 'worker',
    compatibilityDate: '2024-10-05',
    compatibilityFlags: [],
    entrypoint: '/Users/username/project-name/.wrangler/tmp/pages-HFK0hz/functionsWorker-0.3034340515603402.mjs',
    directory: '/Users/username/project-name',
    bindings: {},
    migrations: [],
    triggers: [],
    env: undefined,
    build: {
      additionalModules: [],
      processEntrypoint: true,
      bundle: true,
      findAdditionalModules: undefined,
      minify: undefined,
      moduleRules: [],
      define: {},
      custom: [Object],
      jsxFactory: 'React.createElement',
      jsxFragment: 'React.Fragment',
      tsconfig: undefined,
      nodejsCompatMode: null,
      format: 'modules',
      moduleRoot: '/Users/username/project-name/.wrangler/tmp/pages-HFK0hz'
    },
    dev: {
      auth: [AsyncFunction: auth],
      remote: false,
      server: [Object],
      inspector: [Object],
      origin: [Object],
      liveReload: false,
      testScheduled: false,
      persist: ''
    },
    legacy: {
      site: undefined,
      legacyAssets: undefined,
      enableServiceEnvironments: false
    },
    unsafe: { capnp: undefined, metadata: undefined }
  },
  bundle: undefined
}
ProxyWorker miniflare options changed, reinstantiating...
Error in ProxyController: Failed to send message to InspectorProxyWorker: {"type":"reloadStart"}
 MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:9828:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Mutex.runWith (/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:3627:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}
=> Error contextual data: {
  config: {
    name: 'worker',
    compatibilityDate: '2024-10-05',
    compatibilityFlags: [],
    entrypoint: '/Users/username/project-name/.wrangler/tmp/pages-HFK0hz/functionsWorker-0.3034340515603402.mjs',
    directory: '/Users/username/project-name',
    bindings: {},
    migrations: [],
    triggers: [],
    env: undefined,
    build: {
      additionalModules: [],
      processEntrypoint: true,
      bundle: true,
      findAdditionalModules: undefined,
      minify: undefined,
      moduleRules: [],
      define: {},
      custom: [Object],
      jsxFactory: 'React.createElement',
      jsxFragment: 'React.Fragment',
      tsconfig: undefined,
      nodejsCompatMode: null,
      format: 'modules',
      moduleRoot: '/Users/username/project-name/.wrangler/tmp/pages-HFK0hz'
    },
    dev: {
      auth: [AsyncFunction: auth],
      remote: false,
      server: [Object],
      inspector: [Object],
      origin: [Object],
      liveReload: false,
      testScheduled: false,
      persist: ''
    },
    legacy: {
      site: undefined,
      legacyAssets: undefined,
      enableServiceEnvironments: false
    },
    unsafe: { capnp: undefined, metadata: undefined }
  },
  bundle: undefined
}
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/wrangler-dist/cli.js:29768
            throw a;
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:9828:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Mutex.runWith (/Users/username/.nvm/versions/node/v20.17.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:3627:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

joseflekardal avatar Oct 05 '24 11:10 joseflekardal