oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.12k stars 2.67k forks source link

Bun install segfault in Docker (with VPN connection) #7267

Closed alexkuz closed 5 months ago

alexkuz commented 9 months ago

What version of Bun is running?

v1.0.13 (f5bf67bd)

What platform is your computer?

Linux 6.2.0-35-generic x86_64 x86_64

What steps can reproduce the bug?

  1. Add files: package.json
    {
    "name": "fail",
    "version": "0.0.0",
    "dependencies": {
        "@amplitude/analytics-browser": "1.2.3",
        "@loadable/component": "5.15.3",
        "@paypal/react-paypal-js": "7.8.1",
        "@radix-ui/react-accordion": "^1.1.1",
        "@radix-ui/react-popover": "^1.0.6",
        "@radix-ui/react-select": "^1.2.2",
        "@radix-ui/react-slider": "^1.1.2",
        "@radix-ui/react-switch": "^1.0.2",
        "@radix-ui/react-tooltip": "^1.0.6",
        "@react-hook/merged-ref": "^1.3.2",
        "@sentry/browser": "^6.14.3",
        "@stripe/react-stripe-js": "2.1.0",
        "@stripe/stripe-js": "1.54.0",
        "browser-update": "^3.3.13",
        "connected-react-router": "^6.7.0",
        "core-js": "^2.5.7",
        "date-fns": "2.28.0",
        "emoji-mart": "^3.0.1",
        "es6-symbol": "^3.1.1",
        "firebase": "^9.15.0",
        "focus-group": "^0.3.1",
        "focus-trap-react": "^8.9.0",
        "focus-visible": "^4.1.5",
        "form-atoms": "^3.1.0",
        "hark": "1.2.3",
        "history": "^4.7.2",
        "idb": "^6.1.2",
        "iterators-polyfill": "^1.0.2",
        "jotai": "^2.2.2",
        "konva": "^4.1.6",
        "local-storage": "^1.4.2",
        "lodash": "^4.17.10",
        "md5": "^2.2.1",
        "object.assign": "^4.1.0",
        "p5": "^0.7.3",
        "parse-css-color": "0.2.1",
        "pica": "^5.0.0",
        "promise-polyfill": "^8.1.3",
        "query-string": "^6.2.0",
        "rc-slider": "^8.6.3",
        "rc-tooltip": "^3.7.2",
        "react": "^18.2.0",
        "react-aria-menubutton": "^6.0.1",
        "react-axe": "^3.1.0",
        "react-day-picker": "8.6.0",
        "react-dom": "^18.2.0",
        "react-easy-crop": "^5.0.2",
        "react-error-boundary": "^3.1.1",
        "react-hook-form": "^7.44.3",
        "react-imask": "^6.5.0-alpha.0",
        "react-intersection-observer": "^9.4.3",
        "react-is": "^18.2.0",
        "react-popupbox": "^2.0.3",
        "react-redux": "^7.1.3",
        "react-resize-observer": "^1.1.1",
        "react-responsive": "^8.0.3",
        "react-router": "^5.1.2",
        "react-router-dom": "^5.1.2",
        "react-scripts": "^5.0.1",
        "react-select": "^2.0.0",
        "react-switch": "7.0.0",
        "react-textarea-autosize": "^6.1.0",
        "react-tiny-popover": "7.1.0",
        "react-transition-state": "^2.1.0",
        "recordrtc": "5.6.2",
        "redux": "^4.0.0",
        "redux-devtools-extension": "^2.13.5",
        "redux-logger": "^3.0.6",
        "redux-thunk": "^2.3.0",
        "sha.js": "^2.4.11",
        "shadertoy-react": "^1.1.2",
        "simple-guid": "^0.0.1",
        "styled-components": "^5.3.0",
        "swr": "^2.2.0",
        "url-search-params-polyfill": "^8.1.1",
        "wavesurfer.js": "^6.4.0",
        "whatwg-fetch": "^3.0.0"
    },
    "devDependencies": {
        "@total-typescript/ts-reset": "^0.3.7",
        "@types/emoji-mart": "^3.0.9",
        "@types/facebook-pixel": "0.0.24",
        "@types/gtag.js": "0.0.12",
        "@types/jest": "^22.2.2",
        "@types/loadable__component": "^5.10.0",
        "@types/local-storage": "^1.4.0",
        "@types/lodash": "^4.14.108",
        "@types/md5": "^2.1.32",
        "@types/node": "^12.7.8",
        "@types/rc-slider": "^8.6.2",
        "@types/rc-tooltip": "^3.7.0",
        "@types/react": "^18.0.24",
        "@types/react-dom": "^18.0.8",
        "@types/react-is": "^18.2.0",
        "@types/react-redux": "^7.1.25",
        "@types/react-responsive": "^8.0.2",
        "@types/react-router": "^5.1.4",
        "@types/react-router-dom": "^5.1.3",
        "@types/react-textarea-autosize": "^4.3.3",
        "@types/recordrtc": "^5.6.10",
        "@types/redux-logger": "^3.0.6",
        "@types/styled-components": "^5.1.9",
        "@types/wavesurfer.js": "^6.0.3",
        "buffer": "^6.0.3",
        "eslint-plugin-local-rules": "^1.3.2",
        "http-proxy": "^1.17.0",
        "http-proxy-middleware": "^0.20.0",
        "npm-run-all": "^4.1.3",
        "postcss-normalize": "^10.0.1",
        "postcss-styled-syntax": "^0.3.3",
        "react-error-overlay": "6.0.9",
        "script-progress": "^1.0.5",
        "stylelint": "^15.2.0",
        "stylelint-config-recommended": "^10.0.1",
        "typescript": "^4.8.4",
        "webpack-bundle-analyzer": "^4.9.0"
    }
    }

Dockerfile

FROM oven/bun
WORKDIR /app
COPY package.json ./
RUN bun install
  1. Run
    docker build .

What is the expected behavior?

Docker image builds successfully

What do you see instead?

=> [internal] load build definition from Dockerfile                                                       0.0s
 => => transferring dockerfile: 101B                                                                       0.0s
 => [internal] load .dockerignore                                                                          0.0s
 => => transferring context: 2B                                                                            0.0s
 => [internal] load metadata for docker.io/oven/bun:latest                                                 0.5s
 => [1/4] FROM docker.io/oven/bun@sha256:a54fbd46b130c04bd49602e8310ed7a03dcac80207afb4cd4c8eb39e50160e93  0.0s
 => [internal] load build context                                                                          0.0s
 => => transferring context: 3.93kB                                                                        0.0s
 => CACHED [2/4] WORKDIR /app                                                                              0.0s
 => CACHED [3/4] COPY package.json ./                                                                      0.0s
 => ERROR [4/4] RUN bun install                                                                           23.2s
------                                                                                                          
 > [4/4] RUN bun install:                                                                                       
0.298 bun install v1.0.13 (f5bf67bd)                                                                            
0.299  Resolving dependencies
23.13 Segmentation fault (core dumped)
------
Dockerfile:4
--------------------
   2 |     WORKDIR /app
   3 |     COPY package.json ./
   4 | >>> RUN bun install
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c bun install" did not complete successfully: exit code: 139

Additional information

UPD: build fails only in combination with a turned on OpenVPN connection

Jarred-Sumner commented 9 months ago

I'm not able to reproduce this on Linux x64 or macOS arm64

I wonder if it's docker only somehow

alexkuz commented 9 months ago

Ah! it only fails when my VPN (OpenVPN) is turned on o_O

ericlery commented 9 months ago

Ah! it only fails when my VPN (OpenVPN) is turned on o_O

Most VPN providers block IPv6.

See: https://helpdesk.privateinternetaccess.com/kb/articles/why-do-you-block-ipv6-2

alexkuz commented 9 months ago

interesting. (t's a VPN from my work though, not an external provider; not sure what settings it has)

ambergristle commented 9 months ago

Ah! it only fails when my VPN (OpenVPN) is turned on o_O

i was able to reproduce w/o a vpn, but i was on public wifi that i'd expect doesn't support ipv6 either. happy to share any details that might be relevant

kingcwt commented 8 months ago

I also encountered this problem

image

下面是我的package.json { "name": "vue-templete", "private": true, "version": "1.0.0", "type": "module", "scripts": { "dev": "bunx --bun vite --config ./project/vite.config.ts --host --mode NODE_ENV=dev", "dev:dcp": "vite --config ./project-dcp/vite.config.ts --host --mode NODE_ENV=dev", "dcp": "vite --config ./project-dcp/vite.config.ts --host --mode NODE_ENV=dev", "dcp-test": "vite --config ./project-dcp/vite.config.ts --host --mode NODE_ENV=test", "build": "vite build --config ./project/vite.config.ts --mode NODE_ENV=pro --emptyOutDir", "build:dcp": "vite build --config ./project-dcp/vite.config.ts --mode NODE_ENV=pro --emptyOutDir", "preview": "vite preview", "prettier": "prettier -c --write */", "lint": "eslint ./project/src --fix --ext .js,.ts,.jsx,.tsx,.vue", "prepare": "husky install", "pre-commit": "npx husky add .husky/pre-commit" }, "husky": { "hooks": { "applypatch-msg": "echo \"[Husky] applypatch-msg\"", "pre-applypatch": "echo \"[Husky] pre-applypatch\"", "post-applypatch": "echo \"[Husky] post-applypatch\"", "pre-commit": "echo \"[Husky] pre-commit\"" } }, "dependencies": { "@ant-design/icons-vue": "^6.1.0", "ant-design-vue": "^4.0.0-rc.6", "axios-https": "^1.0.2", "color": "^4.2.3", "ilibs": "^1.0.10", "jss": "^10.10.0", "jss-plugin-camel-case": "^10.10.0", "jss-preset-default": "^10.10.0", "lodash": "^4.17.21", "quill": "2.0.0-dev.4", "vue": "^3.3.4", "vue-clipboard3": "^2.0.0", "vue-i18n": "9", "vue-only-office": "^1.0.0", "vue-router": "^4.2.4", "xmldom": "^0.6.0" }, "devDependencies": { "@babel/core": "^7.22.9", "@babel/eslint-parser": "^7.22.9", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-env": "^7.22.9", "@babel/preset-typescript": "^7.22.5", "@types/jest": "^29.5.3", "@types/lodash": "^4.14.196", "@types/node": "^20.4.5", "@types/quill": "^2.0.11", "@types/xmldom": "^0.1.32", "@typescript-eslint/eslint-plugin": "^5.19.0", "@typescript-eslint/parser": "^5.19.0", "@vitejs/plugin-vue": "^4.2.3", "@vue/test-utils": "^2.4.1", "ambiences": "^1.2.26", "eslint": "^8.13.0", "eslint-config-alloy": "^5.1.0", "eslint-config-prettier": "^8.9.0", "eslint-define-config": "^1.22.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-vue": "^9.16.1", "husky": "^8.0.3", "mockjs": "^1.1.0", "prettier": "^3.0.0", "rollup-plugin-external-globals": "^0.9.0", "rollup-plugin-visualizer": "^5.9.2", "terser": "^5.19.2", "ts-loader": "^9.4.4", "typescript": "^5.1.6", "unplugin-vue-components": "^0.25.1", "vite": "^4.4.5", "vite-plugin-html": "^3.2.0", "vite-plugin-imagemin": "^0.6.1", "vite-plugin-mock": "^2.9.6", "vue-tsc": "^1.8.6", "vue3-jest": "^27.0.0-alpha.1" } }

jdoig commented 6 months ago

+1 also experiencing this

4F2E4A2E commented 6 months ago

+1

Zananok commented 5 months ago

+1 bun install v1.0.33 (9e91e137)

alexkuz commented 5 months ago

In my case, the issue seems to be fixed in v1.0.14+

If you have a similar behaviour, I think it's better to open another issue with your specific example

amjed-ali-k commented 5 months ago

i am also experiencing this, on Digital Ocean App platform