cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®

Home Page:https://developers.cloudflare.com/workers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛 BUG: `Error: write EPIPE` in WSL2 (Ubuntu 20.04.6 LTS)

LukePammant opened this issue · comments

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

3.0.0

What operating system are you using?

WSL2 (Ubuntu 20.04.6 LTS)

Describe the Bug

When running npx wrangler dev I get the following error:

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:907:11)
    at Socket._write (node:net:919:8)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at Runtime.updateConfig (/home/luke/eop/worker/node_modules/miniflare/dist/src/index.js:5120:26)
    at async #assembleAndUpdateConfig (/home/luke/eop/worker/node_modules/miniflare/dist/src/index.js:9130:23)
    at async #init (/home/luke/eop/worker/node_modules/miniflare/dist/src/index.js:8894:5)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

I saw a few posts saying this might be related to missing dependencies. I've installed clang, libc++-dev, lld and python3 based on the workerd readme.

Versions of apps:

  • clang -v = Ubuntu clang version 11.0.0-2~ubuntu20.04.1
  • node -v = Node.js v19.3.0
  • libc++-dev = 1:10.0-50~exp1
  • python3 --version = 3.8.10
  • python3-distutils = 3.8.10-0ubuntu1~20.04
commented

Likely a duplicate of cloudflare/workerd#46 — I don’t think anyone has gotten the prebuilt binaries working on any Ubuntu before 22.04

commented

while wrangler 2 worked perfectly, facing same issue in fedora 38 container after updating to wrangler 3.

Hey there, reporting in with my experience. I tried wrangler@3 on the following distributions through WSL:

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Debian 11

I made sure to install the workerd dependencies on each distribution prior to using Wrangler.

Both Ubuntu 20.04 and Debian 11 encountered this error. However, Ubuntu 22.04 was able to run Wrangler fine.

I guess it's time to switch from 20.04 to 22.04 for my local dev environment.

commented

Hey! 👋 Thanks for raising this. As pointed out earlier in the thread, the workerd npm distribution is currently incompatible with Debian 11 "Bullseye", so won't work with any distro based off that (e.g. Ubuntu 20.04). Debian 12 "Bookworm" based distros (e.g. Ubuntu 22.04) should work, provided you apt install libc++1. We're working on getting a statically linked version of workerd published that should work on older Linux versions. No timeline on when this will be available though. 👍

A number of us have been experiencing the same error and reported it in #2583.

I don't think it's Debian/Ubuntu specific, getting the same error also with all dependencies installed on Arch Linux (6.3.1-arch2-1)

the same issue OSX 10.13.6

             /////////////                lucas@pop-os 
         /////////////////////            ------------ 
      ///////*767////////////////         OS: Pop!_OS 22.04 LTS x86_64 
    //////7676767676*//////////////       Kernel: 6.2.6-76060206-generic 
   /////76767//7676767//////////////      Uptime: 18 hours, 58 mins 
  /////767676///*76767///////////////     Packages: 2718 (dpkg), 115 (nix-user) 
 ///////767676///76767.///7676*///////    Shell: bash 5.1.16 
/////////767676//76767///767676////////   Resolution: 1920x1080, 1920x1080 
//////////76767676767////76767/////////   DE: GNOME 
///////////76767676//////7676//////////   WM: Mutter 
////////////,7676,///////767///////////   WM Theme: Pop 
/////////////*7676///////76////////////   Theme: Pop-dark [GTK2/3] 
///////////////7676////////////////////   Icons: Pop [GTK2/3] 
 ///////////////7676///767////////////    Terminal: gnome-terminal 
  //////////////////////'////////////     CPU: AMD Ryzen 7 3800X (16) @ 3.900GH 
   //////.7676767676767676767,//////      GPU: NVIDIA GeForce RTX 2070 Rev. A 
    /////767676767676767676767/////       Memory: 8331MiB / 64223MiB 
      ///////////////////////////
         /////////////////////                                    
             /////////////                                        


downgrading to 2.20.0 from 3.0 fixed it for me

Is there any fix for arch users because updating to latest version of libc++ didn't work.

Is there any fix for arch users because updating to latest version of libc++ didn't work.

same bro

commented

Hey everyone! 👋 Wanted to give an update on this issue. We've now got builds working with statically linked libc++ that should support older Linux distributions and macOS versions. Just having a few issues getting some tests to pass, but hoping to resolve them soon. 👍

Hi! Just to mention that Github Codespaces got this bug too with 3.0.1, we need to fallback to 2.20.0 until the bugfix

Closing in favour of #3457

commented

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 20.04/22.04
  • Debian 11/12
  • Fedora 37/38/39
  • Arch Latest

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

Please let us know if you encounter any issues. 🙂

I'm running WSL 2 Ubuntu 20.04.6 and following trying out the beta build I get this error:

workerd/util/symbolizer.c++:95: 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=. *** Fatal uncaught kj::Exception: kj/compat/tls.c++:1074: failed: exceeded maximum certificate chain length of 10

my glibc version is 2.31

commented

@Hoko2021 would you be able to open a separate issue for this and ping me on it?

I can confirm that the beta version (0.0.0-3f61892d) of wrangler fixes this for me on Arch Linux.

I confirm that with the same version specified by devmattrick (0.0.0-3f61892d) it works for me with WSL2 and ubuntu 20.04.

Getting this again in December 2023

+1 getting this error again when adding D1 bindings to wrangler.toml. If I remove the D1 bindings, the error goes away.

workerd/server/workerd-api.c++:619: error: wrapped binding module can't be resolved (internal modules only); moduleName = cloudflare-internal:d1-api
workerd/util/symbolizer.c++:98: 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>`.

@pvarsh could you share your full error logs?

@timothyr are you using a service worker (i.e. addEventListener("fetch", ...))? The way Miniflare implements D1 locally uses workerd's wrapped bindings, which aren't yet supported with service workers. You'll need to migrate to module workers to use D1.

Thanks, I migrated to ES modules and D1 bindings are working. It was really difficult to find examples of projects using ES module format, but after trial and error I got it to work.

@mrbbot Not working in BunsenLabs GNU/Linux 10.5 (Lithium)

commented

image

Raspberry Pi os (Debian) isn't working.