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: Failed to start worker dev #2583

Closed
oo00spy00oo opened this issue Jan 21, 2023 · 13 comments
Closed

🐛 BUG: Failed to start worker dev #2583

oo00spy00oo opened this issue Jan 21, 2023 · 13 comments
Labels
bug Something that isn't working

Comments

@oo00spy00oo
Copy link

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

2.8.0

What operating system are you using?

Linux

Describe the Bug

Error:

/workspace/node_modules/.pnpm/@cloudflare+workerd-linux-64@1.20230115.0/node_modules/@cloudflare/workerd-linux-64/bin/workerd: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
 [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                                                                                      │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
/workspace/node_modules/.pnpm/wrangler@2.8.0/node_modules/wrangler/wrangler-dist/cli.js:26719
            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:917:11)
    at Socket._write (node:net:929: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 NativeRuntime.updateConfig (/workspace/pool-army-worker/node_modules/.pnpm/@miniflare+tre@3.0.0-next.8/node_modules/@miniflare/tre/dist/src/index.js:2426:26)
    at async #init (/workspace/pool-army-worker/node_modules/.pnpm/@miniflare+tre@3.0.0-next.8/node_modules/@miniflare/tre/dist/src/index.js:6073:5)
    at async Mutex.runWith (/workspace/pool-army-worker/node_modules/.pnpm/@miniflare+tre@3.0.0-next.8/node_modules/@miniflare/tre/dist/src/index.js:2296:16)
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'
}

Node.js v18.12.1
 ELIFECYCLE  Command failed with exit code 7.

Run with command:

wrangler dev --experimental-local --persist
@oo00spy00oo oo00spy00oo added the bug Something that isn't working label Jan 21, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 21, 2023
@KianNH
Copy link
Contributor

KianNH commented Jan 23, 2023

Looks like you're missing some workerd dependencies - take a look at this:

libc++ 11+ (e.g. packages libc++-dev and libc++abi-dev on Debian Bullseye)

@mrbbot mrbbot added awaiting reporter response Needs clarification or followup from OP and removed awaiting reporter response Needs clarification or followup from OP labels Jan 23, 2023
@mrbbot
Copy link
Contributor

mrbbot commented Jan 23, 2023

Closing this as the above fix seems like the right solution. If this doesn't work, please re-open the issue.

@mrbbot mrbbot closed this as completed Jan 23, 2023
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Jan 23, 2023
@Nopsled
Copy link

Nopsled commented Apr 4, 2023

I might have run into something similar when I push my SvelteKit to Cloudflare Pages. It works when I run the local command: "npx wrangler pages dev --experimental-local --persist --compatibility-date=2023-04-03 -- npm run dev:vite". This is the error log from Cloudflare Pages build process after github clone suceed:

2023-04-04T02:21:43.907342Z	npm ERR! code 1
2023-04-04T02:21:43.90764Z	npm ERR! path /opt/buildhome/repo/node_modules/workerd
2023-04-04T02:21:43.909174Z	npm ERR! command failed
2023-04-04T02:21:43.909421Z	npm ERR! command sh -c -- node install.js
2023-04-04T02:21:43.909812Z	npm ERR! node:internal/errors:857
2023-04-04T02:21:43.910057Z	npm ERR!   const err = new Error(message);
2023-04-04T02:21:43.910244Z	npm ERR!               ^
2023-04-04T02:21:43.910374Z	npm ERR! 
2023-04-04T02:21:43.910597Z	npm ERR! Error: Command failed: /opt/buildhome/repo/node_modules/workerd/bin/workerd --version
2023-04-04T02:21:43.910733Z	npm ERR! /opt/buildhome/repo/node_modules/workerd/bin/workerd: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
2023-04-04T02:21:43.910879Z	npm ERR! 
2023-04-04T02:21:43.91101Z	npm ERR!     at checkExecSyncError (node:child_process:861:11)
2023-04-04T02:21:43.911119Z	npm ERR!     at Object.execFileSync (node:child_process:896:15)
2023-04-04T02:21:43.91124Z	npm ERR!     at validateBinaryVersion (/opt/buildhome/repo/node_modules/workerd/install.js:61:47)
2023-04-04T02:21:43.911364Z	npm ERR!     at /opt/buildhome/repo/node_modules/workerd/install.js:231:7 {
2023-04-04T02:21:43.911472Z	npm ERR!   status: 127,
2023-04-04T02:21:43.911585Z	npm ERR!   signal: null,

@leomp12
Copy link

leomp12 commented May 17, 2023

I'm having the same error, also on Linux and pnpm, with all workerd dependencies installed and also wrangler reinstalled...

@HeyITGuyFixIt
Copy link

HeyITGuyFixIt commented May 17, 2023

Using wrangler@3.0.0, with node:latest docker image (Node.js v20.1.0, Debian Bullseye) with libc++-dev libc++abi-dev ca-certificates libunwind-dev installed (apt update and apt upgrade were ran prior to installing). I'm using npm, not pnpm. I get the same error as above:

2023-05-17T14:09:35.179824633Z 🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
2023-05-17T14:09:35.179958488Z No functions. Shimming...
2023-05-17T14:09:35.191949617Z  ⛅️ wrangler 3.0.0
2023-05-17T14:09:35.191967980Z ------------------
2023-05-17T14:09:35.192102476Z wrangler dev now uses local mode by default, powered by 🔥 Miniflare and 👷 workerd.
2023-05-17T14:09:35.192112839Z To run an edge preview session for your Worker, use wrangler dev --remote
2023-05-17T14:09:35.204047030Z Metrics dispatcher: Dispatching disabled - would have sent {"type":"event","name":"run dev","properties":{"local":true,"usesTypeScript":true}}.
2023-05-17T14:09:35.204423442Z Using vars defined in .dev.vars
2023-05-17T14:09:35.231671437Z ⎔ Starting local server...
2023-05-17T14:09:35.231687180Z 
2023-05-17T14:09:35.260726764Z /srv/node_modules/wrangler/wrangler-dist/cli.js:30632
2023-05-17T14:09:35.260746671Z             throw a;
2023-05-17T14:09:35.260748208Z             ^
2023-05-17T14:09:35.260749574Z 
2023-05-17T14:09:35.260750706Z Error: write EPIPE
2023-05-17T14:09:35.260751887Z     at afterWriteDispatched (node:internal/stream_base_commons:160:15)
2023-05-17T14:09:35.260753033Z     at writeGeneric (node:internal/stream_base_commons:151:3)
2023-05-17T14:09:35.260754154Z     at Socket._writeGeneric (node:net:946:11)
2023-05-17T14:09:35.260755272Z     at Socket._write (node:net:958:8)
2023-05-17T14:09:35.260756379Z     at writeOrBuffer (node:internal/streams/writable:399:12)
2023-05-17T14:09:35.260757468Z     at _write (node:internal/streams/writable:340:10)
2023-05-17T14:09:35.260758570Z     at Writable.write (node:internal/streams/writable:344:10)
2023-05-17T14:09:35.260759793Z     at Runtime.updateConfig (/srv/node_modules/miniflare/dist/src/index.js:5120:26)
2023-05-17T14:09:35.260761034Z     at async #assembleAndUpdateConfig (/srv/node_modules/miniflare/dist/src/index.js:9130:23)
2023-05-17T14:09:35.260762162Z     at async #init (/srv/node_modules/miniflare/dist/src/index.js:8894:5)
2023-05-17T14:09:35.260763296Z Emitted 'error' event on Socket instance at:
2023-05-17T14:09:35.260764411Z     at emitErrorNT (node:internal/streams/destroy:151:8)
2023-05-17T14:09:35.260765493Z     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
2023-05-17T14:09:35.260766856Z     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
2023-05-17T14:09:35.260768327Z   errno: -32,
2023-05-17T14:09:35.260769560Z   code: 'EPIPE',
2023-05-17T14:09:35.260770654Z   syscall: 'write'
2023-05-17T14:09:35.260771776Z }
2023-05-17T14:09:35.260772850Z 
2023-05-17T14:09:35.260773895Z Node.js v20.1.0

@HeyITGuyFixIt
Copy link

This may be an issue with node. This issue seems related. I can reproduce basically the same error by running the example from epipebomb.

@bretthoerner
Copy link

Same here, using 3.0.0 inside a plain node:18-bullseye container. I don't see any missing deps like the original issue (I went ahead and installed libc++-dev to no avail). This blocks our CI tests when using the new Wrangler.

@unboiled
Copy link

I have the same error in Fedora 38. Fedora doesn't have the libc++ but uses libstdc++ as the standard library instead.

@kschniedergers
Copy link

running into the same issue running locally on arch

@sbussard
Copy link

sbussard commented Jun 5, 2023

Same issue, debian 11, node 18.

The apt install ... solution isn't working for me

@cleaton
Copy link

cleaton commented Jun 9, 2023

To make it less cryptic and more general for different linux distros. Try:

  1. ldd node_modules/workerd/bin/workerd to see missing .so libs
  2. Look for the packages in your distro that provides them.

In my case, Fedora 38 needed dnf install libcxx llvm-libunwind because:

ldd node_modules/workerd/bin/workerd
  linux-vdso.so.1 (0x00007fff2c9b3000)
  libc++.so.1 => not found
  libunwind.so.1 => not found
  libc++abi.so.1 => not found
  libm.so.6 => /lib64/libm.so.6 (0x00007fb3f6b1f000)
  libc.so.6 => /lib64/libc.so.6 (0x00007fb3f6941000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fb3fa5ab000)

It would be great if wrangler was better at displaying errors from workerd. Running wokrerd directly is way more understandable than the wrangler stack trace.

./workerd: error while loading shared libraries: libunwind.so.1: cannot open shared object file: No such file or directory

@Karakatiza666
Copy link

I am using image mcr.microsoft.com/devcontainers/javascript-node:16 (Debian 11).
After installing apt install -y libc++-dev libc++abi-dev libunwind-dev
and running ldd node_modules/workerd/bin/workerd
I get:
"
node_modules/workerd/bin/workerd: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.32' not found (required by node_modules/workerd/bin/workerd)
node_modules/workerd/bin/workerd: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.33' not found (required by node_modules/workerd/bin/workerd)
node_modules/workerd/bin/workerd: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found (required by node_modules/workerd/bin/workerd)
linux-vdso.so.1 (0x00007ffc56ce6000)
libc++.so.1 => /usr/lib/x86_64-linux-gnu/libc++.so.1 (0x00007f5e5bff2000)
libunwind.so.1 => not found
libc++abi.so.1 => /usr/lib/x86_64-linux-gnu/libc++abi.so.1 (0x00007f5e5bfba000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5e584bc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5e582e8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5e5c0c7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5e5bf98000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5e5bf8c000)
libatomic.so.1 => /usr/lib/x86_64-linux-gnu/libatomic.so.1 (0x00007f5e5bf82000)
"

So, I get the OP's when running wrangler dev.

@taro-ishihara
Copy link

SAME ISSUE WITH THIS

`FROM node:18.16.0

WORKDIR /mydir

RUN apt-get update && apt-get install -y clang libc++-dev libc++abi-dev libunwind-dev

RUN npm install -g wrangler

RUN git clone "your repository"
WORKDIR /web
RUN yarn

CMD wrangler dev`

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