Closed penalosa closed 1 year ago
Also related to the discussion in cloudflare/workerd#46
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.
@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
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.
@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 ๐
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.
Hi It does not work either in Fedora Linux 38
Fedora users can install llvm-libunwind
and it seems to fix the issue :D
https://github.com/cloudflare/workerd/issues/46#issuecomment-1554321869
Ubuntu 20.04.6 LTS
WSL2 install above modules is not doing anything - issue still persists
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. ๐
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:
Can't seem to install the latest beta
It does work when installed directly into a project directory, though. :+1:
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"
.
@kael Yes, this should be supported. Are you using a custom build? Would you be able to open a new issue for this?
@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.
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
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)
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
$ npm install -g wrangler@beta
$ wrangler generate worker-test-wrangler-beta
$ 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)
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
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.
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.
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?
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
.
@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 usingwrangler init
.
@mrbbot Sounds like a problem more on the JS level right?
@fhanau I suspect so, will try take a look at this soon ๐
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?
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.
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]
.
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
npx wrangler@2.20.0 pages dev ./public ---persist-to ./pages --ip 127.0.0.1 --port 8111
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.
Not working in BunsenLabs GNU/Linux 10.5 (Lithium)
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.
This is happening for me on wrangler@3.57.2 and Ubuntu 22.04. Using wrangler@2.20.0 works fine.
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.
โฏ 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 ...
.
I got these commands working with wrangler@3.36.0 but not working with wrangler@3.37.0 and onwards.
@pointatnick what's your platform? Is it Ubuntu on WSL1 by any chance?
@dom96 Yes, Ubuntu on WSL1
@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?
@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!
@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.
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
.