Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. #4709

Closed
tdobson opened this issue Jan 5, 2024 · 39 comments
Assignees
Labels
awaiting Cloudflare response Awaiting response from workers-sdk maintainer team bug Something that isn't working start-dev-worker Relating to the startDevWorker API

Comments

@tdobson
Copy link

tdobson commented Jan 5, 2024

Which Cloudflare product(s) does this pertain to?

Pages, Workers Runtime, Wrangler core, Miniflare

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

wrangler 3.22.3, miniflare version 3.20231218.1, workerd 1.20231218.0

What version of Node are you using?

v16.17.1

What operating system are you using?

Debian 12.4 (latest stable)

Describe the Bug

Hey I'm a junior developer (or maybe lower) and I followed
https://developers.cloudflare.com/pages/framework-guides/deploy-a-react-site/
to deploy a static React site to cloudflare pages. It worked brilliantly, and I was starting on the development (which, as a newbie, means enthusiastically testing out code that doesn't work).

Suddenly I started getting these errors when through up a development site.

I tried removing bits of code that might have caused it that I'd recently changed, and I don't think that's it.

At first glance, the error log reads like "oh, you already have something running on that port"
but if you look at the examples in error between those - you see what's happening:

  1. The dev site starts
  2. Wrangler tries to do some magic to bring the workers in.
  3. This fails, but the dev site continues
  4. when the dev site is terminated - we see this repeat
  5. and whilst the dev site is still running, we see it fail before this point.

I did a bit of digging into the locations of the error messages.

/home/tdobson/Videos/dev/save-old-glossop/node_modules/wrangler/wrangler-dist/cli.js:29374
            throw a;
            ^

When I look at that file, it literally just says

          process.argv.slice(2);
          process.on("uncaughtException", function(a) {
            throw a;
          });
          process.on(
            "unhandledRejection",
            function(a) {
              throw a;
            }
          );

In miniflare/dist/src/index.js, I tried adding a couple of console logs - and to me, that didn't add much useful, but maybe it did to you.


    if (this.#disposeController.signal.aborted)
      return;
    console.error(maybeSocketPorts)
    console.error(configBuffer)
    console.error(runtimeOpts)

    if (maybeSocketPorts === void 0) {
      throw new MiniflareCoreError(
        "ERR_RUNTIME_FAILURE",
        "The Workers runtime failed to start. There is likely additional logging output above."
      );
    }

The project compiles and deploys to Cloudflare Pages just nicely.

From my point of view, it's frustrating because I don't care about serverside functions. It'd be a neat feature for the future, but I need to suck less at React before I want to play with that. If there's an obvious option I can use to disable it, I'd be hyped - this is my first project with Cloudflare Pages and I was enjoying it til this point.

I wonder if this is linked to this other bug report. I suspect not, but if it is - feel free to merge etc

Thanks for taking a look at this. Happy to provide other info etc.

If you want me to test something for you - I'd be happy to, and if you could dumb things down/give me the commands to run - I'd really appreciate it.

Please provide a link to a minimal reproduction

https://github.com/tdobson/cloudflare-wrangler-setup-problem-example

Please provide any relevant error logs


tdobson@tragicomix:~/Videos/dev/save-old-glossop$  wrangler pages dev --compatibility-date=2023-12-18 --port 3000 --log-level=debug -- npm start 
Running npm start...
Sleeping 5 seconds to allow proxy process to start before attempting to automatically determine port...
To skip, specify the proxy port with --proxy.
[proxy]: 
> save-old-glossop@0.1.0 start
> react-scripts start


✘ [ERROR] [proxy]: (node:56144) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

  (Use `node --trace-deprecation ...` to show where the warning was created)
  


✘ [ERROR] [proxy]: (node:56144) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

  


[proxy]: Starting the development server...


[proxy]: Compiled successfully!

[proxy]: 
You can now view save-old-glossop in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.86.52:3000

Note that the development build is not optimized.

[proxy]: To create a production build, use npm run build.


[proxy]: webpack compiled successfully

Automatically determined the proxy port to be 3000.
No functions. Shimming...
 ⛅️ wrangler 3.22.3
-------------------
▲ [WARNING] --local is no longer required and will be removed in a future version.

  `wrangler dev` now uses the local Cloudflare Workers runtime by default. 🎉


Retrieving cached values for userId from node_modules/.cache/wrangler
Metrics dispatcher: Dispatching disabled - would have sent {"type":"event","name":"run dev","properties":{"local":true,"usesTypeScript":true}}.
Using vars defined in .dev.vars
⎔ Starting local server...
Not Implemented Error: BundlerController#onConfigUpdate
ProxyWorker miniflare options changed, reinstantiating...
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 Miniflare.#assembleAndUpdateConfig (/usr/local/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:8902:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Mutex.runWith (/usr/local/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:3863:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}
=> Error contextual data: {
  config: {
    name: 'worker',
    script: { contents: '' },
    dev: {
      server: [Object],
      inspector: [Object],
      urlOverrides: [Object],
      liveReload: false
    }
  },
  bundle: undefined
}
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 Miniflare.#assembleAndUpdateConfig (/usr/local/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:8902:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Mutex.runWith (/usr/local/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:3863:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}
=> Error contextual data: {
  config: {
    name: 'worker',
    script: { contents: '' },
    dev: {
      server: [Object],
      inspector: [Object],
      urlOverrides: [Object],
      liveReload: false
    }
  },
  bundle: undefined
}
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit                                                                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
/usr/local/lib/node_modules/wrangler/wrangler-dist/cli.js:29374
            throw a;
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at Miniflare.#assembleAndUpdateConfig (/usr/local/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:8902:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Mutex.runWith (/usr/local/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:3863:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

@tdobson tdobson added the bug Something that isn't working label Jan 5, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 5, 2024
@tdobson
Copy link
Author

tdobson commented Jan 6, 2024

Just tried updating my node environment to Node.js v18.19.0. The issue persists.

Mercifully, I have learned that npm start will do "just fine" for me, so I'm now able to continue my dev. yay.


tdobson@tragicomix:~/Videos/dev/save-old-glossop-not-working$ npm run
Lifecycle scripts included in save-old-glossop@0.1.0:
  start
    react-scripts start
  test
    react-scripts test

available via `npm run-script`:
  build
    react-scripts build
  eject
    react-scripts eject
  pages:dev
    wrangler pages dev --compatibility-date=2023-12-18 --port 3000 -- npm start
  pages:deploy
    npm run build && wrangler pages deploy ./build

tdobson@tragicomix:~/Videos/dev/save-old-glossop-not-working$ npm run pages:dev

> save-old-glossop@0.1.0 pages:dev
> wrangler pages dev --compatibility-date=2023-12-18 --port 3000 -- npm start

Running npm start...
Sleeping 5 seconds to allow proxy process to start before attempting to automatically determine port...
To skip, specify the proxy port with --proxy.
[proxy]: 
> save-old-glossop@0.1.0 start
> react-scripts start


✘ [ERROR] [proxy]: (node:99096) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

  (Use `node --trace-deprecation ...` to show where the warning was created)
  


✘ [ERROR] [proxy]: (node:99096) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

  


[proxy]: Starting the development server...


[proxy]: Compiled successfully!

[proxy]: 
You can now view save-old-glossop in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.1.65:3000

[proxy]: 
Note that the development build is not optimized.
To create a production build, use npm run build.


Automatically determined the proxy port to be 3000.
No functions. Shimming...
[proxy]: webpack compiled successfully

 ⛅️ wrangler 3.22.3
-------------------
▲ [WARNING] --local is no longer required and will be removed in a future version.

  `wrangler dev` now uses the local Cloudflare Workers runtime by default. 🎉


Using vars defined in .dev.vars
⎔ Starting local server...
undefined
<Buffer 00 00 00 00 ae 5c 00 00 00 00 00 00 00 00 04 00 0d 00 00 00 df 00 00 00 a5 81 00 00 67 00 00 00 00 00 00 00 00 00 00 00 3d 82 00 00 0f 00 00 00 24 00 ... 189766 more bytes>
{
  signal: AbortSignal { aborted: false },
  entryAddress: 'localhost:3000',
  loopbackPort: 40761,
  requiredSockets: [ 'entry', 'direct:1' ],
  inspectorAddress: undefined,
  verbose: false,
  handleRuntimeStdio: [Function (anonymous)]
}
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit                                                                                               │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
/home/tdobson/Videos/dev/save-old-glossop-not-working/node_modules/wrangler/wrangler-dist/cli.js:29374
            throw a;
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/home/tdobson/Videos/dev/save-old-glossop-not-working/node_modules/miniflare/dist/src/index.js:8906:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (/home/tdobson/Videos/dev/save-old-glossop-not-working/node_modules/miniflare/dist/src/index.js:3863:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v18.19.0

@a5r0n
Copy link

a5r0n commented Jan 7, 2024

same for node 20, bare "hello-world" worker created by C3 cli.

@penalosa penalosa added the start-dev-worker Relating to the startDevWorker API label Jan 8, 2024
@mchennupati
Copy link

if you are using a mac, it likely has to do with folder permissions, make sure you give yourself full rights: chown R user folder etc.
That worked for me.

@AnderScore
Copy link

Works for me if i first kill any proccess on port 3000
fuser -k 3000/tcp

and then run
npx wrangler pages dev --compatibility-date=2023-12-18 -- npm start
Note that i have removed --port 3000

Using WSL
node: v16.20.2
wrangler: 3.25.0

@lrapoport-cf
Copy link
Contributor

@tdobson can you please re-run this command with WRANGLER_LOG=debug, or if you're running this on the latest version of wrangler, these logs should already be written to a file logged at the end of your session.

can you please then provide these debug logs so we can investigate? thanks!

@lrapoport-cf lrapoport-cf added awaiting reporter response Needs clarification or followup from OP and removed start-dev-worker Relating to the startDevWorker API labels Feb 5, 2024
@roryabraham
Copy link

roryabraham commented Feb 5, 2024

I'm not @tdobson but I was running into the same thing w/ node 20.10.0 and Wrangler 3.26.0, here are my debug logs:

logs

--- 2024-02-05T20:23:11.291Z debug
🪵  Writing logs to "/Users/roryabraham/Library/Preferences/.wrangler/logs/wrangler-2024-02-05_20-23-11_224.log"
---

--- 2024-02-05T20:23:11.291Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
    at Object.openSync (node:fs:581:18)
    at Object.readFileSync (node:fs:457:35)
    at tryLoadDotEnv (/Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:124257:72)
    at loadDotEnv (/Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:124266:12)
    at /Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:162342:20
    at /Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:131131:16
    at maybeAsyncResult (/Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:129352:44)
    at /Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:131130:14
    at /Users/roryabraham/Expensidev/Cloudflare-Workers/node_modules/wrangler/wrangler-dist/cli.js:129339:22
    at Array.reduce (<anonymous>) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '.env'
}
---

--- 2024-02-05T20:23:11.297Z log
 ⛅️ wrangler 3.26.0
�[38;5;214m-------------------�[39m
---

--- 2024-02-05T20:23:11.315Z debug
Metrics dispatcher: Posting data {"type":"event","name":"run dev","properties":{"local":true,"usesTypeScript":false}}
---

--- 2024-02-05T20:23:11.319Z log
Using vars defined in .dev.vars
---

--- 2024-02-05T20:23:11.319Z log
Your worker has access to the following bindings:
- Vars:
  - CSP_DEFAULT_SRC: "(hidden)"
  - CSP_SCRIPT_SRC: "(hidden)"
  - CSP_CONNECT_SRC: "(hidden)"
  - blob: "(hidden)"
  - CSP_IMG_SRC: "(hidden)"
  - data: "(hidden)"
  - CSP_STYLE_SRC: "(hidden)"
  - CSP_FONT_SRC: "(hidden)"
  - CSP_FRAME_SRC: "(hidden)"
  - CSP_WORKER_SRC: "(hidden)"
  - CSP_CHILD_SRC: "(hidden)"
  - CSP_MEDIA_SRC: "(hidden)"
  - CSP_FRAME_ANCESTORS: "(hidden)"
---

--- 2024-02-05T20:23:11.363Z log
�[2m⎔ Starting local server...�[22m
---

--- 2024-02-05T20:23:11.398Z debug
workerd/util/symbolizer.c++:96: 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/compat/tls.c++:72: failed: OpenSSL error; message = error:0900006e:PEM routines:OPENSSL_internal:NO_START_LINE
stack: 102e1b53b 102e1d2c3 1020e45a3 1020e66c3 1020eddeb 1020f15b3 1020eff03 1020dd147 1020e176b 1020e1653 1020e163b 1041ab883 1041abbcb 1041aa32b 1041aa0fb 1020d41af 18d6690df
---

Interesting – seems to be an SSL error?

@yqrashawn
Copy link

same here with miniflare README example code

maybe related to cloudflare/workerd#2589?

import { Miniflare } from "miniflare";

// Create a new Miniflare instance, starting a workerd server
const mf = new Miniflare({
	script: `addEventListener("fetch", (event) => {
    event.respondWith(new Response("Hello Miniflare!"));
  })`,
});

// Send a request to the workerd server, the host is ignored
const response = await mf.dispatchFetch("http://localhost:8787/");
console.log(await response.text()); // Hello Miniflare!

// Cleanup Miniflare, shutting down the workerd server
await mf.dispose();
zsh ❯ cat package.json
{
  "name": "little-tooth-5b50",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "deploy": "wrangler deploy",
    "dev": "wrangler dev",
    "start": "wrangler dev"
  },
  "devDependencies": {
    "wrangler": "^3.0.0"
  }
}%

zsh ❯ cat test.mjs
import { Miniflare } from 'miniflare';

// Create a new Miniflare instance, starting a workerd server
const mf = new Miniflare({
        script: `addEventListener("fetch", (event) => {
    event.respondWith(new Response("Hello Miniflare!"));
  })`,
});

// Send a request to the workerd server, the host is ignored
const response = await mf.dispatchFetch('http://localhost:8787/');
console.log(await response.text()); // Hello Miniflare!

// Cleanup Miniflare, shutting down the workerd server
await mf.dispose();

zsh ❯ node --version
v21.5.0

zsh ❯ node test.mjs
workerd/util/symbolizer.c++:96: 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/compat/tls.c++:72: failed: OpenSSL error; message = error:0900006e:PEM routines:OPENSSL_internal:NO_START_LINE
stack: 104e9353b 104e952c3 10415c5a3 10415e6c3 104165deb 1041695b3 104167f03 104155147 10415976b 104159653 10415963b 106223883 106223bcb 10622232b 1062220fb 10414c1af 182fd50df
/Users/yqrashawn/workspace/home/little-tooth-5b50/node_modules/miniflare/dist/src/index.js:8480
      throw new MiniflareCoreError(
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/yqrashawn/workspace/home/little-tooth-5b50/node_modules/miniflare/dist/src/index.js:8480:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (/Users/yqrashawn/workspace/home/little-tooth-5b50/node_modules/miniflare/dist/src/index.js:3405:16)
    at async #waitForReady (/Users/yqrashawn/workspace/home/little-tooth-5b50/node_modules/miniflare/dist/src/index.js:8530:5)
    at async Miniflare.dispatchFetch (/Users/yqrashawn/workspace/home/little-tooth-5b50/node_modules/miniflare/dist/src/index.js:8599:5)
    at async file:///Users/yqrashawn/workspace/home/little-tooth-5b50/test.mjs:11:18 {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v21.5.0

@petebacondarwin petebacondarwin added awaiting Cloudflare response Awaiting response from workers-sdk maintainer team and removed awaiting reporter response Needs clarification or followup from OP labels Feb 16, 2024
@penalosa penalosa self-assigned this Feb 19, 2024
@penalosa
Copy link
Contributor

@tdobson could you try running wrangler pages dev --compatibility-date=2023-12-18 -- npm start? i.e. without --port 3000

@penalosa penalosa added awaiting reporter response Needs clarification or followup from OP and removed awaiting Cloudflare response Awaiting response from workers-sdk maintainer team labels Feb 19, 2024
@a5r0n
Copy link

a5r0n commented Feb 21, 2024

@penalosa same shit...

YMBOLIZER to the location of the llvm-symbolizer binary. When running tests under bazel, use `--test_env=LLVM_SYMBOLIZER=<path>`.
*** Fatal uncaught kj::Exception: kj/compat/tls.c++:72: failed: OpenSSL error; message = error:0900006e:PEM routines:OPENSSL_internal:NO_START_LI
NE

@a5r0n
Copy link

a5r0n commented Feb 21, 2024

#4420 (comment)

@petebacondarwin petebacondarwin added awaiting Cloudflare response Awaiting response from workers-sdk maintainer team start-dev-worker Relating to the startDevWorker API and removed awaiting reporter response Needs clarification or followup from OP labels Feb 22, 2024
@penalosa
Copy link
Contributor

@a5r0n does the comment in #4420 solve your problem (i.e. do you have a malformed certificate file)? If so, we should definitely add some better messaging around this error case, since it seems to be relatively common.

@penalosa penalosa added awaiting reporter response Needs clarification or followup from OP and removed awaiting Cloudflare response Awaiting response from workers-sdk maintainer team labels Feb 26, 2024
@a5r0n
Copy link

a5r0n commented Feb 26, 2024

@penalosa yes it doas. but i'm sure the cert file is okay, is there anyway to check that?

@penalosa
Copy link
Contributor

@a5r0n Could you try running NODE_EXTRA_CA_CERTS="" wrangler pages dev --compatibility-date=2023-12-18 -- npm start and see what the output of that is?

@xeodou
Copy link

xeodou commented Mar 8, 2024

I resolved the issue by disabling my IPv6 localhost in my /etc/hosts files. Like,

127.0.0.1       localhost
#fe80::1         localhost

@memetican
Copy link

memetican commented Jul 6, 2024

I'm trying to trace a similar problem with 3.63.1 however I'm not using pages, just doing basic wrangler worker development.
Reverting to 3,57.1 restores basic wrangler functionality.

I've tried the solutions above regarding certs however I'm not using pages and everything runs fine with 3.57.1.

With 3.63.1, one of the things logging identified is that when wrangler init did not create the .dev or .dev.vars files, which it seems to require now? However creating those files didn't resolve all of the issues. Log file attached.

wrangler-2024-07-06_09-32-36_362.log

@liguob666
Copy link

-------------------------------------------------------

Using vars defined in .dev.vars
⎔ Starting local server...
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                                                                                                          │╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯C:\Users\ fanbo3\myTestMini\miniapp\dddname\node_modules\wrangler\wrangler-dist\cli.js:29765
            throw a;
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (C:\Users\ \ fanbo3\myTestMini\miniapp\dddname\node_modules\miniflare\dist\src\index.js:9178:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (C:\Users\ \fanbo3\myTestMini\miniapp\dddname\node_modules\miniflare\dist\src\index.js:3521:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v20.15.0`

This question keeps popping up, how should I handle it?

@liguob666
Copy link

I had the same problem. I switched wrangler to wrangler 3.57.1 ​​and it worked fine.

@navtesh21
Copy link

        throw a;
        ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
at #assembleAndUpdateConfig (C:\Users\Asmin\Desktop\serverless\my-app\node_modules\miniflare\dist\src\index.js:9178:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Mutex.runWith (C:\Users\Asmin\Desktop\serverless\my-app\node_modules\miniflare\dist\src\index.js:3521:16) {
code: 'ERR_RUNTIME_FAILURE',
cause: undefined
}

Node.js v20.11.0

i changed the version to 3.57.1 but still not working
image

@petebacondarwin
Copy link
Contributor

I believe you are experiencing an issue with a recent change to workerd that break on Windows 11?
See #6170

@navtesh21
Copy link

I believe you are experiencing an issue with a recent change to workerd that break on Windows 11? See #6170

i have windows 10 can you provide me anything to fix this issue its been an houe now and i am not able to find something

@mavrick
Copy link

mavrick commented Jul 16, 2024

 ERROR  *** Received structured exception #0xc0000005: access violation; stack: 7ff9ed0e301f 7ff788f594eb 7ff788f595b3 7ff788f4d1ec 7ff788f4d197 7ff7887c832e 7ff7887c863f 7ff7876b1706 7ff7876b14ea 7ff78894047f 7ff788947636 7ff78894099c 7ff788947636 7ff78893e30c 7ff7876a1551 7ff789fdc8df 7ffa0e27257c 7ffa0eb4af27


 ERROR  Failed to initialize wrangler bindings proxy The Workers runtime failed to start. There is likely additional logging output above.

  at Miniflare2.#assembleAndUpdateConfig (node_modules\miniflare\src\index.ts:1343:10)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at Mutex.runWith (node_modules\miniflare\src\workers\shared\sync.ts:66:45)
  at Miniflare2.#waitForReady (node_modules\miniflare\src\index.ts:1425:3)
  at Miniflare2._getProxyClient (node_modules\miniflare\src\index.ts:1631:3)
  at Miniflare2.getBindings (node_modules\miniflare\src\index.ts:1654:23)
  at async getPlatformProxy (node_modules\wrangler\wrangler-dist\cli.js:210786:20)
  at _getPlatformProxy (node_modules\nitro-cloudflare-dev\dist\runtime\plugin.dev.mjs:41:17)

@pi0
Copy link
Contributor

pi0 commented Jul 18, 2024

We have fixed this regression for nitro proxy using this method.

@Verdant31
Copy link

I resolved the issue by disabling my IPv6 localhost in my /etc/hosts files. Like,

127.0.0.1       localhost
#fe80::1         localhost

How to do this on windows?

@divofred
Copy link

divofred commented Aug 3, 2024

I fixed this error by running
npm install wrangler@3.57.1
I changed it from 3.68.0 to 3.57.1

@AnantKrSharma
Copy link

@divofred
I did the same, but now it gives a warning :
Screenshot 2024-08-03 222711

@divofred
Copy link

divofred commented Aug 3, 2024

@divofred
I did the same, but now it gives a warning :
Screenshot 2024-08-03 222711

You just have to change the compatibility date to "2024-05-12" in your wrangler.toml file
@AnantKrSharma

@AnantKrSharma
Copy link

umm.. is that a good practice ?

@divofred
Copy link

divofred commented Aug 3, 2024

umm.. is that a good practice ?

The latest version of wrangler is buggy, so you are downgrading to the previous version. Since you are going back to 3.57.1, it is good practice to change the compatibility date. Hope this makes it clear

@AnantKrSharma
Copy link

oh.. so the problem is in Wrangler..
Thanks for your help!

@lifetin
Copy link

lifetin commented Aug 6, 2024

我通过运行修复了这个错误, npm install wrangler@3.57.1 我将其从 3.68.0 更改为 3.57.1

用这个可以了.

@SimonEast
Copy link

I was also getting this error on Windows 10, with the latest wranger installed a few minutes ago via npm install wrangler --save-dev. I think it was version 3.69.1 on Node v21.7.3.

The error is quite vague and unhelpful, but a Google search led me here.

I ran:

npm install wrangler@3.57.1
npm run dev

...and now the dev server is starting up correctly.

@Zaid-B24
Copy link

I got the following error while using the latest version of Wrangler:
"MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.".
Upon looking into files, I found that the error is coming from the following code:
"if (maybeSocketPorts === void 0) {
throw new MiniflareCoreError(
"ERR_RUNTIME_FAILURE",
"The Workers runtime failed to start. There is likely additional logging output above."
);
}"
Initially, the latest version worked for me but failed when I attempted to create a second application. Fortunately, downgrading Wrangler to version 3.57.1 resolved the issue for me.

@marwie
Copy link

marwie commented Aug 14, 2024

Same error for me as Zaid mentioned above with 3.71.0. Downgrading to 3.57.1 works again on Win 10
3.71.0 is working fine on my OSX system

@carlop3333
Copy link

carlop3333 commented Aug 14, 2024

Same error in Windows 10, even following steps from #4709 (comment) do not work in a hello world project:

PS C:\Users\Carlo\--project--> set NODE_EXTRA_CA_CERTS ""
PS C:\Users\Carlo\--project--> npx wrangler dev

 ⛅️ wrangler 3.71.0
-------------------

⎔ Starting local server...

C:\Users\Carlo\--project--\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 (C:\Users\Carlo\--project--\node_modules\miniflare\dist\src\index.js:9178:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (C:\Users\Carlo\--project--\node_modules\miniflare\dist\src\index.js:3521:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v22.6.0

The latest version without the error is 3.61.0, other versions like 3.62.0 give the error.

EDIT: Installing latest VS C++ Redistributable fixed the issue! 100% related to #6170

@yashpandey002
Copy link

I am having the same issue on Fedora Linux 40.
I tried downgrading the Wrangler version from latest to 3.57.1 but it still doesn’t work, can anyone help?
image

@twicer-is-coder
Copy link

Same error in Windows 10, even following steps from #4709 (comment) do not work in a hello world project:

PS C:\Users\Carlo\--project--> set NODE_EXTRA_CA_CERTS ""
PS C:\Users\Carlo\--project--> npx wrangler dev

 ⛅️ wrangler 3.71.0
-------------------

⎔ Starting local server...

C:\Users\Carlo\--project--\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 (C:\Users\Carlo\--project--\node_modules\miniflare\dist\src\index.js:9178:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (C:\Users\Carlo\--project--\node_modules\miniflare\dist\src\index.js:3521:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v22.6.0

The latest version without the error is 3.61.0, other versions like 3.62.0 give the error.

EDIT: Installing latest VS C++ Redistributable fixed the issue! 100% related to #6170

Working, Thanks a lot.

@freemedom
Copy link

freemedom commented Aug 29, 2024

npm install wrangler@3.57.1
i use this to solve this error. i tried install that https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170. but it seems need to restart windows system to work, and now i cann't restart system.

@twicer-is-coder
Copy link

npm install wrangler@3.57.1 i use this to solve this error. i tried install that https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170. but it seems need to restart windows system to work, and now i cann't restart system.

Yes, you need to restart after installing VC Redist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Cloudflare response Awaiting response from workers-sdk maintainer team bug Something that isn't working start-dev-worker Relating to the startDevWorker API
Projects
None yet
Development

No branches or pull requests