vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

"Error: write EPIPE" in Travis #2176

Closed Kocal closed 6 years ago

Kocal commented 6 years ago

Version

3.0.0-rc.11

Node and OS info

Node 8.11.3 / yarn 1.9.4 / Travis Trusty without sudo

Steps to reproduce

In a Travis environment:

What is expected?

It should not throw errors.

What is actually happening?

This is yarn build output:

Starting type checking service...
Using 1 worker with 2048MB memory limit
events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: write EPIPE
    at _errnoException (util.js:992:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }

This problem just happens after migrating our code base from PWA template to vue-cli 3.

I don't know if it's related to vue-cli-service or yarn or Travis, because I have another command (yarn lint which runs vue-cli-service lint) and it's working properly.

Also, sometimes it works fine... there is no errors... :thinking:

By the way, I don't have this kind of problem when running those commands:

Thanks you!

Kocal commented 6 years ago

Hum, it will be difficult to give you a depo that reproduce this issue, because this problem happens on a private repo (from work). 😕 Anyway I will try to do something.

For now I will dump some important files, maybe it will help you:

package.json ``` { "name": "x", "version": "0.0.2", "description": "X", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build --modern", "build:staging": "vue-cli-service build --modern --mode staging", "lint": "vue-cli-service lint", "test:unit": "vue-cli-service test:unit" }, "dependencies": { "apollo-cache-inmemory": "^1.2.1", "apollo-client": "^2.2.8", "apollo-link": "^1.2.2", "apollo-link-http": "^1.5.4", "awesome-phonenumber": "^2.2.5", "axios": "^0.18.0", "chart.js": "^2.7.2", "diacritics": "^1.3.0", "graphql": "^0.13.2", "graphql-tag": "^2.9.2", "hex-to-rgba": "^1.0.1", "html-entities": "^1.2.1", "html-truncate": "^1.2.2", "lodash": "^4.17.10", "md5": "^2.2.1", "moment": "^2.22.1", "raven-js": "^3.26.3", "register-service-worker": "^1.0.0", "string-strip-html": "^1.3.2", "vee-validate": "^2.0.9", "vue": "^2.5.16", "vue-apollo": "^3.0.0-beta.5", "vue-chartjs": "^3.3.1", "vue-i18n": "^7.6.0", "vue-meta": "^1.5.0", "vue-moment": "^3.2.0", "vue-numerals": "^0.0.2", "vue-router": "^3.0.1", "vue2-google-maps": "^0.9.7", "vuedraggable": "^2.16.0", "vuetify": "^1.1.4", "vuetify-algolia-places": "^1.0.0-alpha.3", "vuex": "^3.0.1" }, "devDependencies": { "@babel/plugin-proposal-optional-chaining": "^7.0.0-beta.53", "@types/graphql": "^0.13.1", "@types/html-entities": "^1.2.16", "@types/jest": "^22.2.3", "@types/lodash": "^4.14.108", "@vue/cli-plugin-babel": "^3.0.0", "@vue/cli-plugin-eslint": "^3.0.0", "@vue/cli-plugin-pwa": "^3.0.0", "@vue/cli-plugin-typescript": "^3.0.0", "@vue/cli-plugin-unit-jest": "^3.0.0", "@vue/cli-service": "^3.0.0", "@vue/eslint-config-airbnb": "^3.0.0", "@vue/eslint-config-prettier": "^3.0.0", "@vue/eslint-config-typescript": "^3.0.0", "@vue/test-utils": "^1.0.0-beta.20", "babel-core": "7.0.0-bridge.0", "cross-env": "^5.2.0", "jest-localstorage-mock": "^2.2.0", "jest-transform-graphql": "^2.1.0", "lint-staged": "^7.2.0", "node-sass": "^4.9.0", "sass-loader": "^7.0.1", "stylus": "^0.54.5", "stylus-loader": "^3.0.2", "ts-jest": "^23.0.1", "typescript": "^3.0.1", "vue-cli-plugin-apollo": "^0.15.0", "vue-template-compiler": "^2.5.16" }, "engines": { "node": ">= 8.x", "npm": ">= 5.x", "yarn": ">= 1.3.x" }, "browserslist": [ "> 0.25%", "not ie 11", "not op_mini all" ], "gitHooks": { "pre-commit": "lint-staged" }, "lint-staged": { "*.js": [ "vue-cli-service lint", "git add" ], "*.ts": [ "vue-cli-service lint", "git add" ], "*.vue": [ "vue-cli-service lint", "git add" ] } } ```
vue.config.js ```js module.exports = { runtimeCompiler: true, pwa: { name: 'x', themeColor: '#1976d2', }, }; ```

~Oh by the way, I forgot to say that this problem just happens after migrating our code base from PWA template to vue-cli 3. 🤔~ EDIT: added in original post

Kocal commented 6 years ago

Interesting, I don't know if it coincidence or not, but I stopped to build the app with --modern flag and I have no errors anymore. :thinking:

I'm closing for now.

Kocal commented 6 years ago

Interesting, now yarn lint gives me this output:

Starting type checking service...
Using 1 worker with 2048MB memory limit
events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:364:12)
    at PoolWorker.writeJson (/home/travis/build/Yproximite/XXX/node_modules/thread-loader/dist/WorkerPool.js:89:22)
    at PoolWorker.run (/home/travis/build/Yproximite/XXX/node_modules/thread-loader/dist/WorkerPool.js:69:12)
    at WorkerPool.distributeJob (/home/travis/build/Yproximite/XXX/node_modules/thread-loader/dist/WorkerPool.js:326:20)
    at /home/travis/build/Yproximite/XXX/node_modules/thread-loader/node_modules/async/queue.js:10:5
    at Object.process (/home/travis/build/Yproximite/XXX/node_modules/thread-loader/node_modules/async/internal/queue.js:175:17)
    at /home/travis/build/Yproximite/XXX/node_modules/thread-loader/node_modules/async/internal/queue.js:82:19
    at Immediate._onImmediate (/home/travis/build/Yproximite/XXX/node_modules/thread-loader/node_modules/async/internal/setImmediate.js:27:16)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
error Command failed with exit code 1.

I will take a look to thread-loader.

jvanst commented 6 years ago

I am running into the same problem right now building with TravisCI.

This project is for work but I will make one which I can share the source code of.

Version

3.0.1

Node and OS info

OS: Ubuntu 14.04.5 LTS Node: v8.12.0 NPM: 6.4.1 NVM: 0.33.11

Steps to reproduce

Scaffold project with PWA support.

npm run build (Which runs vue-cli-service build)

What is expected?

I expect vue-cli to build the appropriate bundles.

What is actually happening?

Error is being thrown.

> tournkey-client@0.1.0 build /home/travis/build/sport-travel/tournkey-client
> vue-cli-service build
events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:376:12)
    at PoolWorker.writeJson (/home/travis/build/sport-travel/tournkey-client/node_modules/thread-loader/dist/WorkerPool.js:89:22)
    at PoolWorker.run (/home/travis/build/sport-travel/tournkey-client/node_modules/thread-loader/dist/WorkerPool.js:69:12)
    at WorkerPool.distributeJob (/home/travis/build/sport-travel/tournkey-client/node_modules/thread-loader/dist/WorkerPool.js:326:20)
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/queue.js:10:5
    at Object.process (/home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/queue.js:164:17)
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/queue.js:104:15
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/onlyOnce.js:12:16
    at callback (/home/travis/build/sport-travel/tournkey-client/node_modules/thread-loader/dist/WorkerPool.js:163:21)
    at /home/travis/build/sport-travel/tournkey-client/node_modules/thread-loader/dist/WorkerPool.js:190:15
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/map.js:32:9
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/once.js:12:16
    at replenish (/home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/eachOfLimit.js:59:25)
    at iterateeCallback (/home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/eachOfLimit.js:49:17)
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/onlyOnce.js:12:16
    at /home/travis/build/sport-travel/tournkey-client/node_modules/async/internal/map.js:29:13
    at Socket.onChunk (/home/travis/build/sport-travel/tournkey-client/node_modules/thread-loader/dist/readBuffer.js:32:9)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Socket.Readable.read (_stream_readable.js:475:10)
    at flow (_stream_readable.js:846:34)
    at resume_ (_stream_readable.js:828:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tournkey-client@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tournkey-client@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2018-09-13T17_45_55_960Z-debug.log
The command "npm run build" exited with 1.
Done. Your build exited with 1.
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
{ Error: EPIPE: broken pipe, write errno: -32, code: 'EPIPE', syscall: 'write' }
jvanst commented 6 years ago

@Kocal Do you have any updates since you last commented?

Kocal commented 6 years ago

Well, I simply stopped building modern app in Travis, and I have no errors anymore :man_shrugging:

jvanst commented 6 years ago

Update to this.

I was able to solve this by changing the travis build environment from a container based to full virtualization. The thread-loader package does not play nicely with containers that don't use all the threads available.

Read more here: https://docs.travis-ci.com/user/reference/overview/#virtualization-environments

To run in a full virtual machine add sudo: required to the top of your .travis.yaml

Kocal commented 6 years ago

How much boot-time do you lose when using a full VM?

jvanst commented 6 years ago

Boot-times are about 30s longer, a trade off I'm willing to take for now.

LinusBorg commented 6 years ago

Would it help to set parallel to false (= no thread-loader), or is that even slower than threadloader + full vm?

https://cli.vuejs.org/config/#parallel