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: Error: write EPIPE in WSL2 (Ubuntu 20.04.6 LTS) #3262

Closed
LukePammant opened this issue May 17, 2023 · 28 comments
Closed

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

LukePammant opened this issue May 17, 2023 · 28 comments
Labels
bug Something that isn't working

Comments

@LukePammant
Copy link

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
@LukePammant LukePammant added the bug Something that isn't working label May 17, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk May 17, 2023
@huw
Copy link
Contributor

huw commented May 18, 2023

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

@radiorambo
Copy link

radiorambo commented May 18, 2023

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

@james-elicx
Copy link
Contributor

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.

@mrbbot
Copy link
Contributor

mrbbot commented May 18, 2023

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. 👍

@HeyITGuyFixIt
Copy link

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

@leomp12
Copy link

leomp12 commented May 18, 2023

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)

@caracal7
Copy link

the same issue OSX 10.13.6

@lucasavila00
Copy link

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

@342b45
Copy link

342b45 commented May 25, 2023

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

@TMBL-DEV
Copy link

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

same bro

@mrbbot
Copy link
Contributor

mrbbot commented May 26, 2023

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. 👍

@lakano
Copy link

lakano commented Jun 7, 2023

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

@penalosa
Copy link
Contributor

Closing in favour of #3457

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Jun 13, 2023
@mrbbot
Copy link
Contributor

mrbbot commented Jun 30, 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. 🙂

@Hoko2021
Copy link

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

@mrbbot
Copy link
Contributor

mrbbot commented Jun 30, 2023

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

@devmattrick
Copy link

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

@ABVitali
Copy link

ABVitali commented Jul 2, 2023

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

@pvarsh
Copy link

pvarsh commented Dec 19, 2023

Getting this again in December 2023

@timothyr
Copy link

+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>`.

@mrbbot
Copy link
Contributor

mrbbot commented Jan 2, 2024

@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.

@timothyr
Copy link

timothyr commented Jan 4, 2024

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.

@step135
Copy link

step135 commented Jan 17, 2024

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

@aliahadmd
Copy link

aliahadmd commented Mar 22, 2024

image

Raspberry Pi os (Debian) isn't working.

@talglobus
Copy link

talglobus commented Sep 30, 2024

Getting this exact issue while running tests with vitest on Mac OS 14.6.1

~/project/executor git:[main]
npx vitest

 DEV  v2.0.5 /Users/me/project/executor

Using vars defined in .dev.vars
[vpw:inf] Starting isolated runtimes for vitest.config.ts...

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: write EPIPE
 ❯ afterWriteDispatched node:internal/stream_base_commons:161:15
 ❯ writeGeneric node:internal/stream_base_commons:152:3
 ❯ Socket._writeGeneric node:net:952:11
 ❯ Socket._write node:net:964:8
 ❯ writeOrBuffer node:internal/streams/writable:570:12
 ❯ _write node:internal/streams/writable:499:10
 ❯ Writable.write node:internal/streams/writable:508:10
 ❯ Runtime.updateConfig node_modules/miniflare/dist/src/index.js:4941:26
 ❯ #assembleAndUpdateConfig node_modules/miniflare/dist/src/index.js:9821:30
 ❯ Mutex.runWith node_modules/miniflare/dist/src/index.js:3627:16

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -32, code: 'EPIPE', syscall: 'write' }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 Test Files  no tests
      Tests  no tests
     Errors  1 error
   Start at  14:59:48
   Duration  782ms (transform 0ms, setup 0ms, collect 0ms, tests 0ms, environment 0ms, prepare 0ms)


 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit
[vpw:dbg] Shutting down runtimes...
error during close Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:161:15)
    at writeGeneric (node:internal/stream_base_commons:152:3)
    at Socket._writeGeneric (node:net:952:11)
    at Socket._write (node:net:964:8)
    at writeOrBuffer (node:internal/streams/writable:570:12)
    at _write (node:internal/streams/writable:499:10)
    at Writable.write (node:internal/streams/writable:508:10)
    at Runtime.updateConfig (/Users/me/project/executor/node_modules/miniflare/dist/src/index.js:4941:26)
    at async #assembleAndUpdateConfig (/Users/me/project/executor/node_modules/miniflare/dist/src/index.js:9821:30)
    at async Mutex.runWith (/Users/me/project/executor/node_modules/miniflare/dist/src/index.js:3627:16) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write',
  type: 'Unhandled Error',
  stacks: [
    {
      method: 'afterWriteDispatched',
      file: '/Users/me/project/executor/node:internal/stream_base_commons',
      line: 161,
      column: 15
    },
    {
      method: 'writeGeneric',
      file: '/Users/me/project/executor/node:internal/stream_base_commons',
      line: 152,
      column: 3
    },
    {
      method: 'Socket._writeGeneric',
      file: '/Users/me/project/executor/node:net',
      line: 952,
      column: 11
    },
    {
      method: 'Socket._write',
      file: '/Users/me/project/executor/node:net',
      line: 964,
      column: 8
    },
    {
      method: 'writeOrBuffer',
      file: '/Users/me/project/executor/node:internal/streams/writable',
      line: 570,
      column: 12
    },
    {
      method: '_write',
      file: '/Users/me/project/executor/node:internal/streams/writable',
      line: 499,
      column: 10
    },
    {
      method: 'Writable.write',
      file: '/Users/me/project/executor/node:internal/streams/writable',
      line: 508,
      column: 10
    },
    {
      method: 'Runtime.updateConfig',
      file: '/Users/me/project/executor/node_modules/miniflare/dist/src/index.js',
      line: 4941,
      column: 26
    },
    {
      method: '#assembleAndUpdateConfig',
      file: '/Users/me/project/executor/node_modules/miniflare/dist/src/index.js',
      line: 9821,
      column: 30
    },
    {
      method: 'Mutex.runWith',
      file: '/Users/me/project/executor/node_modules/miniflare/dist/src/index.js',
      line: 3627,
      column: 16
    }
  ]
}

@vladinator1000
Copy link

This started happening to me on wrangler 3.107.3, doesn't happen when I revert to 3.105.0

@kentonv
Copy link
Member

kentonv commented Feb 6, 2025

Hi @vladinator1000,

Are you using Ubuntu 20.04 by any chance? Unfortunately, 20.04 is end-of-life since September, and GitHub is removing it from the list of available runner images, which means we had to update our builds to use 22.04 instead. Hence, workerd no longer works on 20.04, I'm afraid.

actions/runner-images#11101

@vladinator1000
Copy link

I am! In WSL though. Thanks @kentonv I guess I need to upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
Development

No branches or pull requests