workers-sdk: ๐Ÿ› BUG: `Error: write EPIPE` in WSL2 (Ubuntu 20.04.6 LTS)

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

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 11
  • Comments: 24 (8 by maintainers)

Most upvoted comments

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. ๐Ÿ‘

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. ๐Ÿ‘

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)

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

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

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

same bro

Getting this again in December 2023

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. ๐Ÿ™‚

             /////////////                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

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