Error spawn e2big

I am not sure why I am running into this error, I have not seen them before with this module. [23:06:48] Starting 'deploy'... [23:06:51] gulp-rsync: Starting rsync to tri@myserver.com:/path...

@tnguyen14

I am not sure why I am running into this error, I have not seen them before with this module.

[23:06:48] Starting 'deploy'...
[23:06:51] gulp-rsync: Starting rsync to tri@myserver.com:/path/to/server/directory...
internal/child_process.js:297
    throw errnoException(err, 'spawn');
          ^
Error: spawn E2BIG
    at exports._errnoException (util.js:846:11)
    at ChildProcess.spawn (internal/child_process.js:297:11)
    at exports.spawn (child_process.js:330:9)
    at Object.rsync.execute (/path/to/project/node_modules/gulp-rsync/rsync.js:92:22)

Here’s the gulpfile config:

var rsync = require('gulp-rsync');
gulp.task('deploy', function() {
  return gulp.src('**')
    .pipe(rsync({
        hostname: 'myserver.com',
        destination: '/path/to/server/directory',
        username: 'tri',
        progress: true,
        times: true,
        exclude: ['node_modules', '.DS_Store']
    }));
});

@wesbos

I had this issue too — I ended up moving the gulpfile one level up, and then rsyncing it from there.

make sure to specify root otherwise it will upload as a sub-folder

gulp.task('deploy', function() {
  return gulp.src(['./CODE/**/*', '!node_modules/**/*' ])
    .pipe(p.rsync({
      hostname: 'nah.com',
      username  :'naa',
      root : 'CODE/',
      destination: '/path/to/folder',
      progress  : true
    }));
});

@fergusjordan

@tnguyen14 wondering if wesbos’s answer fixed this issue for you. I’m currently hitting this same issue and his answer hasn’t seemed to work for me.

@frob

Make sure you have the trailing slash in the root.

not

@apast

Dealing with a similar issue, I found the Linux System Errors documentation containing code errors and core definition.
i.e.:
E2BIG: Argument list too long (POSIX.1)

Reference: http://man7.org/linux/man-pages/man3/errno.3.html

In our case it makes sense, considering we are deploying 7200 files.

Considering @frob suggestion, we already applied slash, but it doesn’t work for us. Someone had a similar case or have some suggestion?

Best regards!

@jdewit

Remove the wildcard match in the src function and set recursive to true, like so:

gulp.task('deploy', function() {
  return gulp.src('./')
    .pipe(rsync({
      root: './',
      hostname: 'some-host',
      destination: '/var/www/some-folder',
      recursive: true
    }));
});

When restarted the pod on openshift cluster and got a different result in the logs,
this time the main process was started, see the log below.
Conclusion: E2BIG error doesn’t seem to be systematic.

Log Location: [ /opt/apigee/logs/edgemicro.log ]
cd /opt/apigee && edgemicro start -o myorg -e test -k xxxx -s yyyy -r 8000 -d /opt/apigee/plugins &
current nodejs version is v8.12.0
current edgemicro version is 2.5.28
info: jwt_public_key download from https://myorg-test.apigee.net/edgemicro-auth/publicKey returned 200 OK 
info: products download from https://myorg-test.apigee.net/edgemicro-auth/products returned 200 OK 
info: config download from https://edgemicroservices.apigee.net/edgemicro/bootstrap/organization/myorg/environment/test returned 200 OK 
PROCESS PID : 18
TypeError: respawnIntervalManager.getIntervalForNextSpawn is not a function
    at replaceWorker (/usr/local/lib/node_modules/edgemicro/cli/lib/reload-cluster.js:99:43)
    at EventEmitter.replaceAndTerminateWorker (/usr/local/lib/node_modules/edgemicro/cli/lib/reload-cluster.js:123:5)
    at emitOne (events.js:116:13)
    at EventEmitter.emit (events.js:211:7)
    at emit (/usr/local/lib/node_modules/edgemicro/cli/lib/reload-cluster.js:59:15)
    at EventEmitter.emitWorkerDisconnect (/usr/local/lib/node_modules/edgemicro/cli/lib/reload-cluster.js:171:5)
    at emitOne (events.js:116:13)
    at EventEmitter.emit (events.js:211:7)
    at ChildProcess.worker.process.once (internal/cluster/master.js:213:13)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at ChildProcess.emit (events.js:208:7)
    at finish (internal/child_process.js:747:14)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickCallback (internal/process/next_tick.js:181:9)
Removing the socket file as part of cleanup
fs.js:675
  return binding.read(fd, buffer, offset, length, position);
                 ^


Error: EFAULT: bad address in system call argument, read
    at Object.fs.readSync (fs.js:675:18)
    at tryReadSync (fs.js:540:20)
    at Object.fs.readFileSync (fs.js:575:19)
    at Object.Module._extensions..js (module.js:663:20)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/edgemicro/node_modules/microgateway-config/lib/io.js:7:11)
fs.js:675
  return binding.read(fd, buffer, offset, length, position);
                 ^


Error: EFAULT: bad address in system call argument, read
    at Object.fs.readSync (fs.js:675:18)
    at tryReadSync (fs.js:540:20)
    at Object.fs.readFileSync (fs.js:575:19)
    at Object.Module._extensions..js (module.js:663:20)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/edgemicro/node_modules/microgateway-config/lib/io.js:7:11)
using pluginDir
using plugin dir /opt/apigee/plugins
using pluginDir
using pluginDir
using plugin dir /opt/apigee/plugins
using plugin dir /opt/apigee/plugins
using pluginDir
using plugin dir /opt/apigee/plugins
using pluginDir
using plugin dir /opt/apigee/plugins

Thanks,

Mohan Chipada

#vue.js #vue-cli

#vue.js #vue-cli

Вопрос:

Я разрабатываю приложение в Vue.js 2. Я использую Ubuntu 20.04.1 LTS. Мой package.json файл выглядит так:

 {
  "name": "my-app",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "vue": "^2.6.12",
    "vue-router": "^3.4.9",
    "vuex": "^3.6.2",
    "vuex-persistedstate": "^4.0.0-beta.3",
     ...and others
  },
  "devDependencies": {
    ...some dependencies
  }
}
 

Когда я запускаю npm run build , я получаю следующее исключение:

 > vue-cli-service build


⠹  Building for production...internal/child_process.js:403
    throw errnoException(err, 'spawn');
    ^

Error: spawn E2BIG
    at ChildProcess.spawn (internal/child_process.js:403:11)
    at Object.spawn (child_process.js:553:9)
    at new PoolWorker (/workspace/___/___/___/node_modules/thread-loader/dist/WorkerPool.js:46:43)
    at WorkerPool.createWorker (/workspace/___/___/___/node_modules/thread-loader/dist/WorkerPool.js:341:23)
    at WorkerPool.distributeJob (/workspace/___/___/___/node_modules/thread-loader/dist/WorkerPool.js:335:28)
    at runQueue (/workspace/___/___/___/node_modules/neo-async/async.js:8099:9)
    at processTicksAndRejections (internal/process/task_queues.js:75:11) {
  errno: -7,
  code: 'E2BIG',
  syscall: 'spawn'
}
npm ERR! code 1
npm ERR! path /workspace/___/___/___
npm ERR! command failed
npm ERR! command sh -c vue-cli-service build

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/___/.npm/_logs/2021-03-08T18_57_06_018Z-debug.log
 

Однако, когда я запускаю npm run serve , все работает нормально. Что здесь не так? Если вам нужны какие-либо дополнительные файлы, которые я не включил, пожалуйста, дайте мне знать.

Комментарии:

1. Есть ли у вас какие-либо ошибки ESLint во всем вашем проекте?

2. npm run serve не возвращает никаких предупреждений или ошибок, все работает нормально. Я также попытался удалить все зависимости, связанные с ESLint package.json , и снова переустановить все зависимости, но проблема по-прежнему сохраняется.

Ответ №1:

Я выяснил, в чем была ошибка. Я пытался прочитать некоторое содержимое файла vue.config.js примерно так:

 const fs = require('fs-extra');
const path = require('path');

// read data
const data = fs.readJsonSync(path.resolve(__dirname, 'data.json'), {
  throws: false
});

// set process variables
process.env.VUE_APP_DATA = JSON.stringify(data);

module.exports = {
  devServer: {
    disableHostCheck: true,
  },
};

 

После удаления fs.readJsonSync(...) он начал работать.

Понравилась статья? Поделить с друзьями:
  • Error sp3 ariston газовый котел ошибка
  • Error sp2 ariston газовый котел
  • Error sp1 на котле аристон
  • Error sp1 ariston газовый котел
  • Error sound перевод