question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENOSPC: no space left on device, mkdir '/app/build/docs

See original GitHub issue

Describe the bug Building Docs fails when running storybook build inside the docker container. It works on the local windows machine (storybook start, storybook build). it creates build/docs and build/docsE2e. But as soon as ran inside the docker linux container, it fails at build step.

To Reproduce Steps to reproduce the behavior:

  1. I have lerna monorepo setup with storybook/react. Got 4 packages in the repo.
  2. A basic setup with storybook 5.1.9
  3. Build the folder with docker build command
  4. When it hits storybook build, it fails with below error.
nps is executing `build.docs` : build-storybook -s ./assets, ./env -c "utils/storybook" -o "build/docs/" --no-dll
info @storybook/react v5.1.9
info
info clean outputDir..
cp: cannot create directory '/app/build/docs/': No such file or directory
info => Copying static files from: ./assets,
info => Copying prebuild dll's..
(node:491) UnhandledPromiseRejectionWarning: ShellJSInternalError: ENOSPC: no space left on device, write
    at Object.fs.writeSync (fs.js:735:20)
    at copyFileSync (/app/node_modules/shelljs/src/cp.js:71:10)
    at /app/node_modules/shelljs/src/cp.js:298:7
    at Array.forEach (<anonymous>)
    at Object._cp (/app/node_modules/shelljs/src/cp.js:243:11)
    at Object.cp (/app/node_modules/shelljs/src/common.js:384:25)
    at buildStaticStandalone (/app/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/build-static.js:239:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
(node:491) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:491) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior A expected behavior is it should build the app and output the build folder as below

nps is executing `build.docsE2e` : node node_modules\cross-env\dist\bin\cross-env.js STORYBOOK_ENV=e2e build-storybook -s ./assets, ./env -c "utils/storybook" -o build/docs_e2e/
info @storybook/react v5.1.9
info
info clean outputDir..
cp: cannot create directory 'C:/Code/workspace/ react-app/build/docs_e2e/': No such file or directory
info => Copying static files from: ./assets,
info => Copying prebuild dll's..
info => Building manager..
info => Loading manager config..
info => Loading presets
info => Loading custom babel config as JS
info => Loading custom addons config.
info => Compiling manager..
info => manager built (15 s)
info => Building preview..
info => Loading preview config..
info => Loading presets
info => Loading custom babel config as JS
info => Loading custom webpack config (full-control mode).
info => Using base config because react-scripts is not installed.
info => Compiling preview..
info => Preview built (1.5 min)
WARN asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
WARN This can impact web performance.
WARN Assets:
WARN   vendors~main.94d0c7b14ef9bc7c18a7.bundle.js (4.68 MiB)
WARN entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
WARN Entrypoints:
WARN   main (4.83 MiB)
WARN       runtime~main.94d0c7b14ef9bc7c18a7.bundle.js
WARN       vendors~main.94d0c7b14ef9bc7c18a7.bundle.js
WARN       main.94d0c7b14ef9bc7c18a7.bundle.js
WARN
WARN webpack performance recommendations:
WARN You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
WARN For more info visit https://webpack.js.org/guides/code-splitting/
info => Output directory: C:\Code\workspace\ react-app\build\docs_e2e\

System:

  • Local (Windows 10)
  • Docker (Linux Container)

Additional context Add any other context about the problem here. package.json

build: {
    default: 'npm start build.docs && npm start build.docsE2e',
    bootstrap: 'lerna bootstrap --hoist',
    rollup: 'rollup -c',
    docs: `build-storybook -s ./assets, ./env -c "${StoryBookConfigFolder}" -o ${DocsFolder}`,
    docsE2e: `${crossEnv(
      'STORYBOOK_ENV=e2e'
    )} build-storybook -s ./assets, ./env -c "${StoryBookConfigFolder}" -o ${DocsE2EFolder}`,
},
scripts: { 
   "build": "npm start build",
 },

"dependencies": {
    "focus-trap-react": "^3.0.3",
    "lerna": "3.0.0-beta.21",
    "lodash": "^4.17.4",
    "react-autosuggest": "^9.3.2",
    "react-scrolllock": "^4.0.0",
    "react-transition-group": "^2.2.0",
    "storybook-addon-redux-listener": "^0.1.7"
  },
  "devDependencies": {
    "@babel/cli": "^7.2.3",
    "@babel/core": "^7.3.4",
    "@babel/plugin-external-helpers": "^7.2.0",
    "@babel/plugin-proposal-class-properties": "^7.3.4",
    "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/plugin-transform-runtime": "^7.4.4",
    "@babel/polyfill": "^7.4.4",
    "@babel/preset-env": "^7.3.4",
    "@babel/preset-react": "^7.0.0",
    "@babel/register": "^7.0.0",
    "@commitlint/cli": "^6.1.3",
    "@commitlint/config-conventional": "^6.1.3",
    "@storybook/addon-actions": "^5.1.9",
    "@storybook/addon-info": "^5.1.9",
    "@storybook/addon-knobs": "^5.1.9",
    "@storybook/addon-notes": "^5.1.9",
    "@storybook/addons": "^5.1.9",
    "@storybook/react": "^5.1.9",
    "@wdpui/eslint-config": "^1.0.17",
    "@wdpui/gel-thememanager": "^3.1.0",
    "@wdpui/react-gel": "^3.2.0",
    "axe-core": "2.3.1",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^9.0.0",
    "babel-jest": "^24.5.0",
    "babel-loader": "^8.0.5",
    "babel-plugin-lodash": "^3.3.4",
    "babel-plugin-styled-components": "^1.1.7",
    "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
    "babel-preset-jest": "^24.3.0",
    "chai": "^4.1.0",
    "copy-webpack-plugin": "^4.5.2",
    "core-js": "^2.6.9",
    "enzyme": "^3.9.0",
    "enzyme-adapter-react-16": "^1.10.0",
    "enzyme-to-json": "^3.3.4",
    "eslint": "^4.5.0",
    "eslint-config-airbnb": "^15.0.2",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-jsx-a11y": "^5.1.1",
    "eslint-plugin-prettier": "^2.1.2",
    "eslint-plugin-react": "^7.1.0",
    "glob": "^7.1.2",
    "husky": "^0.13.1",
    "jest": "^24.5.0",
    "jest-html-reporter": "^2.3.0",
    "jest-styled-components": "^5.0.1",
    "lint-staged": "^4.0.2",
    "mocha": "^3.4.2",
    "nps": "^5.6.0",
    "nps-utils": "^1.3.0",
    "prettier-eslint-cli": "^4.1.1",
    "raf": "^3.4.0",
    "raw-loader": "^0.5.1",
    "react": "^16.x",
    "react-addons-test-utils": "^15.6.0",
    "react-dom": "^16.x",
    "react-redux": "^5.x",
    "react-syntax-highlighter": "^5.6.2",
    "react-test-renderer": "^16.0.0",
    "redux": "^3.x",
    "redux-devtools-extension": "^2.13.8",
    "redux-mock-store": "^1.5.3",
    "rollup": "^0.59.2",
    "rollup-plugin-babel": "^4.0.1",
    "rollup-plugin-commonjs": "^9.1.3",
    "rollup-plugin-json": "^3.0.0",
    "rollup-plugin-node-resolve": "^3.3.0",
    "rollup-plugin-svg": "^1.0.1",
    "rollup-plugin-url": "^1.4.0",
    "rollup-watch": "^4.0.0",
    "styled-components": "^3.1.4",
    "stylelint": "^7.11.0",
    "stylelint-config-standard": "^16.0.0",
    "stylelint-processor-styled-components": "^0.2.1",
    "wdio-json-reporter": "^0.2.1",
    "wdio-junit-reporter": "^0.3.0",
    "wdio-mocha-framework": "^0.5.10",
    "wdio-spec-reporter": "^0.1.0",
    "wdio-visual-regression-service": "^0.8.0",
    "webdriverio": "^5.8.3",
    "webpack": "^4.35.0",
    "yargs": "^8.0.2"
  },
 

Docker File

# The Node version that we'll be running for our version of React.
# You may have to search the Node directory for a version that fits
# the version of React you're using.
FROM node:8.10.0

# Create a work directory and copy over our dependency manifest files.
RUN mkdir -p /app
WORKDIR /app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# copy npmrc file
COPY .dockernpmrc /root/.npmrc

# install and cache app dependencies
COPY package.json package-lock.json package-scripts.js lerna.json /app/
RUN npm install 

# copy all the source
COPY . /app

# Run BUILD 
RUN npm run build

# Expose PORT 3000 on our virtual machine so we can run our server
EXPOSE 9002

# start app
CMD ["npm", "start"]


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
khanzzirfancommented, Jul 25, 2019

Hi All, Resolved the issue, by moving all package-scripts commands to package.json file. Seems like culprit is nps package-scripts file.

0reactions
stale[bot]commented, Jul 19, 2019

Hi everyone! Seems like there hasn’t been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don’t have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ENOSPC no space left on device -Nodejs - Stack Overflow
This error happens when there's not enough space available on the disk. If you are using Docker and building the containers from the...
Read more >
Need To Solve: ENOSPC: no space left on device
My suggestion: Try to run the commands in an interactive shell in a container instead of running Docker build. Then you can see...
Read more >
Azure DevOps Build fails with "Error: ENOSPC: no space left ...
During the artifact files being generated, you are hitting the size limit of the desk and it is therefore giving the error, ENOSPC:...
Read more >
Errno::ENOSPC: No space left on device - Discourse Meta
I have built and rebuilt the app a few times; could that be reason I ran out of disk space?
Read more >
Errno::ENOSPC: No space left on device in Ruby on Rails
It's true, you have very little space left. Filesystem Size Used Avail Use% Mounted on /dev/xvda 9.5G 8.7G 325M 97% /.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found