cloudflare / workers-sdk

โ›…๏ธ Home to Wrangler, the CLI for Cloudflare Workersยฎ
https://developers.cloudflare.com/workers/
Apache License 2.0
2.58k stars 663 forks source link

๐Ÿ› BUG: Wrangler doesn't work on my system/OS (provide a static build of `workerd`) #3457

Closed penalosa closed 1 year ago

penalosa commented 1 year ago

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

3

What operating system are you using?

N/A

Describe the Bug

Collection of issues related to Wrangler not working on specific systems/OSs which will be fixed by providing a static build of workerd.

huw commented 1 year ago

Also related to the discussion in cloudflare/workerd#46

lakano commented 1 year ago

FYI, it's also not works under Codespaces of Github, and could be really appreciate to make it works out-of-box as before with the wrangler v2.20.

huw commented 1 year ago

@lakano As of this morning, this is no longer true. The default Codespaces image has been upgraded to Debian 12 Bookworm. If you havenโ€™t changed your configuration, you should just be able to run โ€˜Codespaces: Rebuild Containerโ€™, otherwise you can upgrade the base image (usually either VARIANT in devcontainer.json, or by depending on ex. mcr.microsoft.com/vscode/devcontainers/javascript-node:20-bookworm in your Dockerfile).

For example, a minimum Codespaces setup is as follows:

.devcontainer/devcontainer.json

{
  "name": "workerd",
  "build": {
    "dockerfile": "Dockerfile"
  },
}

.devcontainer/Dockerfile

FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:20-bookworm

# Install `libc++-dev` for workerd to work
RUN apt-get update && apt-get -y install libc++-dev
gennai3 commented 1 year ago

Wrangler does not work on Debian 11 , I installed clang libc++-dev libc++abi-dev by apt install command , however, does not work correctly. Please let me know, I think Debian and Ubuntu are most popular Linux OS on Interent server. Thanks.

-- log

? Compiled Worker successfully ?? wrangler 3.1.0 wrangler dev now uses local mode by default, powered by ? Miniflare and ? workerd. To run an edge preview session for your Worker, use wrangler dev --remote Your worker has access to the following bindings:

KV Namespaces: KVDATA: 83e2f6aae8664bf89a......xxxxx ? Starting local server... [mf:wrn] The latest compatibility date supported by the installed Cloudflare Workers Runtime is "2023-05-18", but you've requested "2023-06-15". Falling back to "2023-05-18"... lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj /home/hodota/sonicjs/node_modules/wrangler/wrangler-dist/cli.js:30632 throw a; ^ Error: write EPIPE at afterWriteDispatched (node:internal/stream_base_commons:160:15) at writeGeneric (node:internal/stream_base_commons:151:3) at Socket._writeGeneric (node:net:905:11) at Socket._write (node:net:917:8) at writeOrBuffer (node:internal/streams/writable:391:12) at _write (node:internal/streams/writable:332:10) at Socket.Writable.write (node:internal/streams/writable:336:10) at Runtime.updateConfig (/home/hodota/sonicjs/node_modules/miniflare/dist/src/index.js:5121:26) at async Miniflare.#assembleAndUpdateConfig (/home/hodota/sonicjs/node_modules/miniflare/dist/src/index.js:9138:23) at async Miniflare.#init (/home/hodota/sonicjs/node_modules/miniflare/dist/src/index.js:8898:5) Emitted 'error' event on Socket instance at: at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { errno: -32, code: 'EPIPE', syscall: 'write' } ERROR: "dev:wrangler" exited with 7.

huw commented 1 year ago

@gennai3 Hello! I noticed youโ€™ve sent the same message to a few threads, so hopefully I can help you here. As explained above and on other threads youโ€™ve posted to (in great detail), workerd is currently incompatible with Debian 11, and will be until this issue is resolved. You will need to upgrade to Debian 12 in the meantime. I hope this helps you resolve your issue ๐Ÿ˜Œ

gennai3 commented 1 year ago

Thank you @huw for your support. I will try upgrde from Deabin 11 to Debian 12 soon. I hope Debian/Ubuntu will be work wrangler and Cloudfare product. Sorry that my multi post, thank you again.

juanpmarin commented 1 year ago

Hi It does not work either in Fedora Linux 38

juanpmarin commented 1 year ago

Fedora users can install llvm-libunwind and it seems to fix the issue :D

https://github.com/cloudflare/workerd/issues/46#issuecomment-1554321869

LegendTomaszKwiatkowski commented 1 year ago

Ubuntu 20.04.6 LTS WSL2 install above modules is not doing anything - issue still persists

mrbbot commented 1 year ago

Hey everyone! ๐Ÿ‘‹ We've just released a new beta version of Wrangler that should improve compatibility. Try it out with npx wrangler@beta dev.

On Linux, libc++ is now statically linked, and we target glibc 2.31 when building. This means any Linux distro providing glibc 2.31 or higher should be supported. The following OSes have been tested:

Ubuntu 18.04 (which is now end-of-life) and Debian 10 will not be supported.

On macOS, we now target macOS 11 "Big Sur" when building. This means any version of macOS 11 or higher (Big Sur, Monterey, Ventura, Sonoma) should be supported.

I'm going to close this issue now, but please let us know if you encounter any issues. ๐Ÿ™‚

kael commented 1 year ago

Can't seem to install the latest beta

npx wrangler@beta dev

$ npm uninstall -g wrangler

removed 101 packages in 197ms
$ npx wrangler@beta dev
Need to install the following packages:
  wrangler@0.0.0-bcdc1fe5
Ok to proceed? (y) y
 โ›…๏ธ wrangler 0.0.0-bcdc1fe5
---------------------------
wrangler dev now uses local mode by default, powered by ๐Ÿ”ฅ Miniflare and ๐Ÿ‘ท workerd.
To run an edge preview session for your Worker, use wrangler dev --remote

โœ˜ [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler dev path/to/script`) or the `main` config field.

If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose

Env:

kael commented 1 year ago

Can't seem to install the latest beta

It does work when installed directly into a project directory, though. :+1:

kael commented 1 year ago

Try it out with npx wrangler@beta dev

Does this version contain the new cloudflare:sockets module ?

I'd like to use the new TCP Socket API but it doesn't seem available: โœ˜ [ERROR] Could not resolve "cloudflare:sockets".

mrbbot commented 1 year ago

@kael Yes, this should be supported. Are you using a custom build? Would you be able to open a new issue for this?

kael commented 1 year ago

@kael Yes, this should be supported. Are you using a custom build? Would you be able to open a new issue for this?

I've tested with a simple worker and with a Remix install, but I seem to have messed with different versions of wrangler.

I'm going to test and paste results here, and open a ticket if you think it's necessary.

kael commented 1 year ago
Testing with Remix (with Cloudflare Pages)
  1. Installation

    1.1. Creating Remix project (without full installation)

    $ npx create-remix@latest cf-test-beta-wrangler
    ? What type of app do you want to create? Just the basics
    ? Where do you want to deploy? Choose Remix App Server if you're 
    unsure; it's easy to change deployment targets. Cloudflare Pages
    ? TypeScript or JavaScript? JavaScript
    ? Do you want me to run `npm install`? No
    ๐Ÿ’ฟ That's it! `cd` into "/home/kael/Project/cf-test-beta-wrangler" and check the README for development and deploy instructions!

    1.2. Installing Wrangler Beta and Remix Utils (with complete full installation)

    $ npm install --save-dev wrangler@beta
    $ npm install remix-utils
  2. Running Wrangler with Remix

    2.1. Basic

     ๐Ÿ’ฟ  remix dev
    
     info  building...
     info  built (415ms)
    
    > start
    > wrangler pages dev --compatibility-date=2023-06-21 ./public
    
    Compiling worker to "/tmp/functionsWorker-0.30047527969509336.mjs"...
    โœจ Compiled Worker successfully
     โ›…๏ธ wrangler 0.0.0-3f61892d
    ---------------------------
    wrangler dev now uses local mode by default, powered by ๐Ÿ”ฅ Miniflare and ๐Ÿ‘ท workerd.
    To run an edge preview session for your Worker, use wrangler dev --remote
    โŽ” Starting local server...
    
    โ–ฒ [WARNING] Parsed 2 valid header rules.
    
    [mf:inf] Ready on http://127.0.0.1:8788/
    [REMIX DEV] ba1ff211 ready

    2.2. Import { connect } from 'cloudflare:sockets'

    ๐Ÿ’ฟ  remix dev
    
     info  building...
     warn  could not resolve "cloudflare:sockets"
    โ”ƒ You imported "cloudflare:sockets" in app/routes/foo.jsx,
    โ”ƒ but that package is not in your `node_modules`.
    โ”ƒ Did you forget to install it?
    โ”—
    โœ˜ [ERROR] Build failed with 1 error:
    app/routes/foo.jsx:3:24: ERROR: Could not resolve "cloudflare:sockets" [plugin css-bundle-update-plugin]
    
        app/root.jsx:20:30:
          20 โ”‚ import { cssBundleHref } from "@remix-run/css-bundle";
             โ•ต                               ~~~~~~~~~~~~~~~~~~~~~~~
    
      This error came from the "onLoad" callback registered here:
    
        node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:47:12:
          47 โ”‚       build.onLoad({
             โ•ต             ~~~~~~
    
        at setup (/home/kael/Project/cf-test-beta-wrangler/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:47:13)
        at handlePlugins (/home/kael/Project/cf-test-beta-wrangler/node_modules/esbuild/lib/main.js:1279:21)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  3. Searching for 'cloudflare:sockets' in node_modules

$ grep "cloudflare:sockets" -R node_modules/*
Binary file node_modules/@cloudflare/workerd-linux-64/bin/workerd matches
Binary file node_modules/workerd/bin/workerd matches

package.json ```json { "private": true, "sideEffects": false, "type": "module", "scripts": { "build": "remix build", "dev": "remix dev --no-restart -c \"npm run start\"", "start": "wrangler pages dev --compatibility-date=2023-06-21 ./public", "typecheck": "tsc" }, "dependencies": { "@remix-run/cloudflare": "^1.18.1", "@remix-run/cloudflare-pages": "^1.18.1", "@remix-run/css-bundle": "^1.18.1", "@remix-run/react": "^1.18.1", "isbot": "^3.6.8", "react": "^18.2.0", "react-dom": "^18.2.0", "remix-utils": "^6.5.0" }, "devDependencies": { "@cloudflare/workers-types": "^3.19.0", "@remix-run/dev": "^1.18.1", "@remix-run/eslint-config": "^1.18.1", "@types/react": "^18.0.35", "@types/react-dom": "^18.0.11", "eslint": "^8.38.0", "typescript": "^5.0.4", "wrangler": "^0.0.0-3f61892d" }, "engines": { "node": ">=16.13.0" } } ```
kael commented 1 year ago
Testing with Cloudflare Workers
  1. Global Wrangler installation
$ npm install -g wrangler@beta
  1. Generate new Worker with Wrangler
$ wrangler generate worker-test-wrangler-beta
  1. Testing TCP socket connection with Gopher over HTTP
$ wrangler dev
 โ›…๏ธ wrangler 0.0.0-3f61892d
---------------------------
wrangler dev now uses local mode by default, powered by ๐Ÿ”ฅ Miniflare and ๐Ÿ‘ท workerd.
To run an edge preview session for your Worker, use wrangler dev --remote
โŽ” Starting local server...
[mf:wrn] The latest compatibility date supported by the installed Cloudflare Workers Runtime is "2023-06-28",
but you've requested "2023-07-03". Falling back to "2023-06-28"...
[mf:inf] Ready on http://127.0.0.1:8787/
[mf:inf] GET / 200 OK (426ms)
[mf:inf] GET /favicon.ico 200 OK (494ms)
Gopher over HTTP page ```gopher iWelcome to Floodgap Systems' official gopher server. error.host 1 iFloodgap has served the gopher community since 1999 error.host 1 i(formerly gopher.ptloma.edu). error.host 1 i error.host 1 iWe run Bucktooth 0.2.9 on xinetd as our server system. error.host 1 igopher.floodgap.com is an IBM Power 520 Express with a 2-way error.host 1 i4.2GHz POWER6 CPU and 8GB of RAM, running AIX 6.1 +patches. error.host 1 iSend gopher@floodgap.com your questions and suggestions. error.host 1 i error.host 1 i*********************************************************** error.host 1 i** OVER 20 YEARS SERVING YOU! ** error.host 1 i** Plain text is beautiful! ** error.host 1 i*********************************************************** error.host 1 i error.host 1 0Does this gopher menu look correct? /gopher/proxy gopher.floodgap.com 70 i(plus using the Floodgap Public Gopher Proxy) error.host 1 1Super-Dimensional Fortress: SDF Gopherspace sdf.org 70 iGet your own Gopherspace and shell account! error.host 1 i error.host 1 i--- Getting started with Gopher ------------------------------- error.host 1 1Getting started with gopher, software, more /gopher gopher.floodgap.com 70 i(what is Gopherspace? We tell you! And find out how error.host 1 ito create your own Gopher world!) error.host 1 i error.host 1 0Using your web browser to explore Gopherspace /gopher/wbgopher gopher.floodgap.com 70 i(READ IT! LEARN IT! LOVE IT!) error.host 1 i(useful tips for gopher newbies, updated 17 November 2018) error.host 1 i error.host 1 1The Overbite Project: Gopher clients for mobile and desktop (OverbiteWX, OverbiteNX, Overbite Android) /overbite gopher.floodgap.com 70 i(download gopher add-ons for Mozilla Firefox/SeaMonkey, error.host 1 imobile clients for Android and more! Put Gopherspace on error.host 1 iyour mobile phone or desktop computer!) error.host 1 1Other Gopher clients for various platforms /gopher/clients gopher.floodgap.com 70 i error.host 1 i--- Find and search for other Gopher sites on the Internet ---- error.host 1 1Search Gopherspace with Veronica-2 /v2 gopher.floodgap.com 70 ior search all known titles in Gopherspace with V-2 from here: error.host 1 7Search Veronica-2 /v2/vs gopher.floodgap.com 70 i error.host 1 1All the gopher servers in the world (that we know of) /world gopher.floodgap.com 70 i(updated with robot updates) error.host 1 1New Gopher servers since 1999 /new gopher.floodgap.com 70 i(updated 29 June 2023) error.host 1 i error.host 1 i--- Get news, weather and more through Gopherspace ------------ error.host 1 1Weather maps and forecasts via Floodgap Groundhog /groundhog gopher.floodgap.com 70 i(USA and Australia; updates occur throughout the day) error.host 1 1News and headline feeds via Flood Feeds /feeds gopher.floodgap.com 70 i(updates occur daily/regularly) error.host 1 1Most current Floodgap news feeds /feeds/latest gopher.floodgap.com 70 i(today's most updated news and headlines) error.host 1 i error.host 1 i--- File archives and downloads ------------------------------- error.host 1 1Floodgap File Archives and Mirrors /archive gopher.floodgap.com 70 i(includes external archives and historical files, error.host 1 iWalnut Creek CP/M-Osborne-Commodore-Beehive archives, error.host 1 iInfo-Mac, classic Mac software and more) error.host 1 i error.host 1 i--- Fun, games, and other neat things ------------------------- error.host 1 1Floodgap Gopher Fun and Games /fun gopher.floodgap.com 70 i(with xkcd, the Gopher Figlet gateway and the fld.gp Gopher error.host 1 i Shortener Service) error.host 1 1Floodgap users and staff gopher pages /users gopher.floodgap.com 70 i(the usual gang of idiots) error.host 1 1The New GopherVR: A Virtual Reality View of Gopherspace /gophervr gopher.floodgap.com 70 i(version 0.5.1 released 24 October 2015) error.host 1 i error.host 1 i--- Server software behind the scenes ------------------------- error.host 1 1The Bucktooth gopher server /buck gopher.floodgap.com 70 i(version 0.2.9 released 1 May 2011) error.host 1 i error.host 1 i--- Gopherspace advocacy and activism ------------------------- error.host 1 1Floodgap Gopher Statistics Project /gstats gopher.floodgap.com 70 i(monthly traffic analysis of the Floodgap Public Gopher Proxy error.host 1 ifor community advocacy purposes; updates monthly) error.host 1 i error.host 1 i--- Floodgap specific ----------------------------------------- error.host 1 2Floodgap CSO/ph phonebook server gopher.floodgap.com 105 0Yes, gopher.floodgap.com is the same as gopher.ptloma.edu /ptloma gopher.floodgap.com 70 1The Floodgap Free Software License /ffsl gopher.floodgap.com 70 0Where's Floodgap? (not for hatemail ;-) /whereis gopher.floodgap.com 70 0What's the temperature in the Floodgap server room? /servertemps.txt gopher.floodgap.com 70 0"/usr/bin/tail" our gopher server log /recent gopher.floodgap.com 70 0RIP, Master gopher at University of Minnesota /umngone gopher.floodgap.com 70 hFloodgap.com (Web pages) URL:http://www.floodgap.com/ gopher.floodgap.com 70 i error.host 1 iPlease note that this gopher is no longer affiliated with error.host 1 iPoint Loma Nazarene University. Some areas are rate-limited due error.host 1 ito spidering. error.host 1 ```

So TCP socket does work with Workers. :+1:


NB: Not sure why there are 2 versions of wrangler installed globally:

$ wrangler -v
 โ›…๏ธ wrangler 0.0.0-3f61892d
$ wrangler2 -v
 โ›…๏ธ wrangler 0.0.0-3f61892d
fhanau commented 1 year ago

NB: Not sure why there are 2 versions of wrangler installed globally:

wrangler and wrangler2 should both point to the same underlying script, so there's just two links to the same wrangler installation. For example, both of them point to /opt/homebrew/lib/node_modules/wrangler/bin/wrangler.js on mac with Node installed via homebrew, although your path may be different.

Also wanted to note that with the new version 3.1.2 the extended OS support is now available in the stable release. As Brendan said above, please let us know if you encounter any more issues.

kael commented 1 year ago

Also wanted to note that with the new version 3.1.2 the extended OS support is now available in the stable release. As Brendan said above, please let us know if you encounter any more issues.

I've started a basic React app with Pages and the general solution that seems to solve compatibility issues is to install Wrangler in the global scope and remove the reference of Wrangler in the devDependencies package.json (and in node_modules).

It does work - locally - so far, although I have yet to deploy it.

I'll give a try and test with the Wrangler 3.1.2 and let you know - I'm currently busy having fun with the new TCP socket cloudflare:sockets module. :smile:

Cheers.

jbasdf commented 1 year ago

I was getting the "Not symbolizing stack traces because $LLVM_SYMBOLIZER is not set" error on Mac OSX 13.4.1 (22F82) even with wrangler 3.1.2 installed. I had to remove wrangler from my package.json and then install it globally for everything to work. Is this the recommended setup going forward?

kael commented 1 year ago
Testing with Remix (with Cloudflare Pages)

@fhanau I've tested installation of a Remix project with Wrangler 3.1.2 and I'm getting the same error than above when importing the cloudflare:sockets module in a Remix one, being with Wrangler installed globally or locally, or by using wrangler init.

It looks like a Remix bug though, doesn't it ? Not sure why cssBundlePlugin is involved when importing cloudflare:sockets.

package.json ```json { "private": true, "sideEffects": false, "type": "module", "scripts": { "build": "remix build", "dev": "remix dev --no-restart -c \"npm run start\"", "start": "wrangler pages dev --compatibility-date=2023-06-21 ./public", "typecheck": "tsc", "pages:deploy": "npm run build && wrangler pages publish ./public" }, "dependencies": { "@remix-run/cloudflare": "^1.16.0", "@remix-run/cloudflare-pages": "^1.16.0", "@remix-run/css-bundle": "^1.16.0", "@remix-run/react": "^1.16.0", "isbot": "^3.6.8", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@cloudflare/workers-types": "^3.19.0", "@remix-run/dev": "^1.16.0", "@remix-run/eslint-config": "^1.16.0", "@types/react": "^18.0.35", "@types/react-dom": "^18.0.11", "eslint": "^8.38.0", "typescript": "^5.0.4", "wrangler": "^3.1.2" }, "engines": { "node": ">=16.13.0" } } ```
fhanau commented 1 year ago

@fhanau I've tested installation of a Remix project with Wrangler 3.1.2 and I'm getting the same error than above when importing the cloudflare:sockets module in a Remix one, being with Wrangler installed globally or locally, or by using wrangler init.

@mrbbot Sounds like a problem more on the JS level right?

mrbbot commented 1 year ago

@fhanau I suspect so, will try take a look at this soon ๐Ÿ‘

rodbs commented 1 year ago

I was getting the "Not symbolizing stack traces because $LLVM_SYMBOLIZER is not set" error on Mac OSX 13.4.1 (22F82) even with wrangler 3.1.2 installed. I had to remove wrangler from my package.json and then install it globally for everything to work. Is this the recommended setup going forward?

@jbasdf I'm getting the same error (wrangler 3.2) and I cannot get rid of it (I've also tried out wrangler dynamically w/o success). Any ideas? is this bug supposed to be fixed?

rodbs commented 1 year ago

This is the full error I get with wrangler 3.2 (and also with beta) in macOS 13.14

workerd/util/symbolizer.c++:99: 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): Address already in use; toString() = 0.0.0.0:3001
stack: 1022c7f13 1022c7cab 1022c5543 100a4918b 100a49a54 100a1491f 100a1832b 100a1815f 100a18147 1022fde2f 1022fe08b 1022fc7e3 1022fc5b3 100a0c1a

โœ˜ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
kael commented 1 year ago

Address already in use; toString() = 0.0.0.0:3001

I get a similar message after I edit the code with wrong syntax, the shell crashes but the process is still alive, then I can't restart the app because the address is already in use.

I'm using ps to find the still alive Node process: ps aux | grep node and kill [PID].

excelsior091224 commented 1 year ago

This module still won't work.

xxxxxx@raspberrypi:~/dev/astro_test/extinct-equinox $ npx wrangler pages dev --proxy 5000 --binding MICROCMS_SERVICE_DOMAIN="xxxxxxxxxxxxxx" MICROCMS_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxx" -- npm run dev -- --host --port 5000 
Running npm run dev -- --host --port 5000...
โ–ฒ [WARNING] No compatibility_date was specified. Using today's date: 2023-07-26.

  Pass it in your terminal:

  --compatibility-date=2023-07-26

  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for
  more information.

Compiling worker to "/tmp/functionsWorker-0.3816089213091922.mjs"...
โœจ Compiled Worker successfully
[proxy]: 
> @example/blog@0.0.1 dev
> astro dev --host --port 5000

 โ›…๏ธ wrangler 3.3.0
------------------
wrangler dev now uses local mode by default, powered by ๐Ÿ”ฅ Miniflare and ๐Ÿ‘ท workerd.
To run an edge preview session for your Worker, use wrangler dev --remote
Your worker has access to the following bindings:
- Vars:
  - MICROCMS_SERVICE_DOMAIN: "(hidden)"
  - MICROCMS_API_KEY: "(hidden)"
โŽ” Starting local server...
[mf:wrn] The latest compatibility date supported by the installed Cloudflare Workers Runtime is "2023-07-17",
but you've requested "2023-07-26". Falling back to "2023-07-17"...
external/com_google_tcmalloc/tcmalloc/system-alloc.cc:661] MmapAligned() failed - unable to allocate with tag (hint, size, alignment) - is something limiting address placement? 0x4be40000000 1073741824 1073741824 @ 0x5583dd78ec 0x5583dd3d14 0x5583dd34a0 0x5583db3b90 0x5583dd0a68 0x5583dd0834 0x5583da8da8 0x5583d17798 0x5583d3ed24 0x5582ca8b60 0x5582ca88c8 0x5582cad098 0x5583d9fed0 0x7fa2758dc0
external/com_google_tcmalloc/tcmalloc/arena.cc:58] FATAL ERROR: Out of memory trying to allocate internal tcmalloc data (bytes, object-size); is something preventing mmap from succeeding (sandbox, VSS limitations)? 131072 640 @ 0x5583dd7c50 0x5583db3c20 0x5583dd0a68 0x5583dd0834 0x5583da8da8 0x5583d17798 0x5583d3ed24 0x5582ca8b60 0x5582ca88c8 0x5582cad098 0x5583d9fed0 0x7fa2758dc0
โœ˜ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.

[proxy]:   ๐Ÿš€  astro  v2.9.3 started in 3252ms

  โ”ƒ Local    http://localhost:5000/
  โ”ƒ Network  http://192.168.1.81:5000/
             http://192.168.1.13:5000/
             http://100.73.172.95:5000/
             http://172.27.0.1:5000/
             http://169.254.41.228:5000/
             http://169.254.151.189:5000/
             http://169.254.180.76:5000/
             http://169.254.27.181:5000/
             http://169.254.230.138:5000/
             http://169.254.145.58:5000/
             http://169.254.87.137:5000/
             http://169.254.94.160:5000/
             http://169.254.188.161:5000/

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โŽ” Shutting down local server...

OS:Raspberry pi OS

Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

npm:9.8.1

syonfox commented 11 months ago
npx wrangler@2.20.0 pages dev ./public ---persist-to ./pages --ip 127.0.0.1  --port 8111
buren commented 10 months ago

On macOS, we now target macOS 11 "Big Sur" when building. This means any version of macOS 11 or higher (Big Sur, Monterey, Ventura, Sonoma) should be supported.

I saw this comment https://github.com/cloudflare/workers-sdk/issues/3432#issuecomment-1614428641 about Big Sur being supported. I was on 11.1 and that didn't work for me, upgraded to macOS 14 and now it works.

step135 commented 8 months ago

Not working in BunsenLabs GNU/Linux 10.5 (Lithium)

fhanau commented 8 months ago

Not working in BunsenLabs GNU/Linux 10.5 (Lithium)

Hi, as far as I can see BunsenLabs Lithium is based on Debian Buster and uses glibc 2.28, whereas workerd (and by extension wrangler) requires glibc 2.31 or higher. Please consider upgrading to Beryllium or higher.

pointatnick commented 3 months ago

This is happening for me on wrangler@3.57.2 and Ubuntu 22.04. Using wrangler@2.20.0 works fine.

fhanau commented 3 months ago

This is happening for me on wrangler@3.57.2 and Ubuntu 22.04. Using wrangler@2.20.0 works fine.

Can you share the specific error message you see? Ubuntu 20.04 and 22.04 should be fully supported.

pointatnick commented 3 months ago
โฏ npx wrangler dev
 โ›…๏ธ wrangler 3.57.2
-------------------
Your worker has access to the following bindings:
- D1 Databases:
  - DB: prod-d1-tutorial (2589c028-00a3-4acf-976b-97ba7f1fa7a8)
โœ˜ [ERROR] 2778 external/com_google_tcmalloc/tcmalloc/system-alloc.cc:753] MmapAligned() failed - unable to allocate with tag (hint=0x6f5140000000, size=1073741824, alignment=1073741824) - is something limiting address placement?

  2778 external/com_google_tcmalloc/tcmalloc/arena.cc:52] CHECK in Alloc: FATAL ERROR: Out of memory
  trying to allocate internal tcmalloc data (bytes=131072, object-size=640); is something preventing
  mmap from succeeding (sandbox, VSS limitations)?

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                       โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
/home/orokamono/d1-tutorial/node_modules/wrangler/wrangler-dist/cli.js:29749
            throw a;
            ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

A similar error happened with npx wrangler d1 execute ....

pointatnick commented 3 months ago

I got these commands working with wrangler@3.36.0 but not working with wrangler@3.37.0 and onwards.

dom96 commented 3 months ago

@pointatnick what's your platform? Is it Ubuntu on WSL1 by any chance?

pointatnick commented 3 months ago

@dom96 Yes, Ubuntu on WSL1

dom96 commented 3 months ago

@pointatnick I ran into a similar issue and recently switched to WSL2 which seems to have solved the problem. Can you give that a try as well?

pointatnick commented 3 months ago

@dom96 I've tried before to upgrade to WSL2 but I am limited by my hardware. I trust upgrading would fix the issue, since it was hard finding WSL1 as an explanation for the bug. I'm good with using a slightly older version of wrangler for now. Thanks for the responses!

fhanau commented 2 months ago

@dom96 I've tried before to upgrade to WSL2 but I am limited by my hardware. I trust upgrading would fix the issue, since it was hard finding WSL1 as an explanation for the bug. I'm good with using a slightly older version of wrangler for now. Thanks for the responses!

Glad to hear that this works with WSL2. I tried to see what might cause the breakage with WSL1 โ€“ From prior discussion it sounds like the tcmalloc issue starts with https://github.com/cloudflare/workers-sdk/compare/wrangler%403.36.0...wrangler%403.37.0. This maps to the https://github.com/cloudflare/workerd/compare/v1.20240314.0...v1.20240320.0 workerd update, which includes a tcmalloc update which might be responsible. The tcmalloc update includes a large range of changes so this might be hard to track down, but suggests that the issue isn't necessarily within workerd itself.