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

receiving { Error: EINVAL: invalid argument, read errno: -4071, code: 'EINVAL', syscall: 'read' } #5

Open
vblain opened this issue Dec 10, 2018 · 5 comments

Comments

@vblain
Copy link

vblain commented Dec 10, 2018

Hi,

Just found your project and it would really solve a problem I'm having with being able to split a large dump file. Are you still supporting this branch ??

I'm currently getting the following error: { Error: EINVAL: invalid argument, read errno: -4071, code: 'EINVAL', syscall: 'read' } when trying to run the project. I do see that some libs are out of data, but currently can't take on updating the code myself.

@vekexasia
Copy link
Owner

Hey @vblain how are you launching the script?

@vblain
Copy link
Author

vblain commented Dec 11, 2018 via email

@cikal
Copy link

cikal commented Jun 13, 2019

@vblain did your problem solved ?
i have same problem here, 3 days ago i using this tools in Ubuntu 16.04 with smooth and very well, but today im using this tools on Windows 7 with no luck..

OS info : Windows 7 (x86)
NodeJS version : v12.4.0
npm version : 6.9.0

Problem :

  • After fresh install global CLI npm install mysqldumpsplit -g
  • then i just run it with no options mysqldumpsplit dummy_backup.sql
  • this dummy_backup.sql (file size only 4,6 Gb) less than 5 Gb, but another day in Ubuntu i has done split 24 Gb w/o problem using this amazing tools.. 😢

Console Throw :

Starting :)
[Error: EINVAL: invalid argument, read] {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'read'
}

@vekexasia can you help to fix it ?
thanks

@cikal
Copy link

cikal commented Jun 13, 2019

Try another way, with clone this repo, and do npm install for all dep. these output from my command prompt, also i has 🔗 attached log files from npm log.

maybe can help you for fixing this tools, again thanks for your time.

[2019-06-13T02_25_02_895Z-debug.log](https://github.com/vekexasia/mysqldumpsplit/files/3283888/2019-06-13T02_25_02_895Z-debug.log)
C:\Users\cikal\Desktop\mysqldumpsplit>npm install
npm WARN deprecated [email protected]: �  Thanks for using Babel: we re
commend using babel-preset-env now: please read https://babeljs.io/env to update
!
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, follo
wing the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: This module is no longer maintained, try thi
s instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alterna
tives.
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use
@segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install th
e latest version of pug instead of jade
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for comp
atibility with current and future versions of Node.js
npm WARN deprecated [email protected]: This package is unmaintained. Use @sinonjs/f
ormatio instead
npm WARN deprecated [email protected]: This package has been deprecated in favour of
@sinonjs/samsam
npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sur
e to switch over as this distribution is no longer supported and may contain bug
s and critical security issues.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This module is no longer maintained, try th
is instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alterna
tives.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
 to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This module relies on Node.js's internals and
 will break at some point. Do not use it, and update to [email protected].
npm WARN deprecated [email protected]: This package has been deprecated in favour of
@sinonjs/samsam
npm WARN deprecated [email protected]: This version has been deprecated in accordance
with the hapi support policy (hapi.im/support). Please upgrade to the latest ver
sion to get the best features, bug fixes, and security patches. If you are unabl
e to upgrade at this time, paid support is available for older versions (hapi.im
/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance
with the hapi support policy (hapi.im/support). Please upgrade to the latest ver
sion to get the best features, bug fixes, and security patches. If you are unabl
e to upgrade at this time, paid support is available for older versions (hapi.im
/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accorda
nce with the hapi support policy (hapi.im/support). Please upgrade to the latest
 version to get the best features, bug fixes, and security patches. If you are u
nable to upgrade at this time, paid support is available for older versions (hap
i.im/commercial).
npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sur
e to switch over as this distribution is no longer supported and may contain bug
s and critical security issues.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
 to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compa
tibility with current and future versions of Node.js
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, fl
atted is its successor.

> [email protected] postinstall C:\Users\cikal\Desktop\mysqldumpsplit\node_modules\c
ore-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfill
ing JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Colle
ctive or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a goo
d job -)

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.

npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly
` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` fo
r more information.

> [email protected] prepublish C:\Users\cikal\Desktop\mysqldumpsplit
> gulp

fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
←[90m    at fs.js:27:26←[39m
    at req_ (C:\Users\cikal\Desktop\mysqldumpsplit\node_modules\←[4mnatives←[24m
\index.js:143:24)
    at Object.req [as require] (C:\Users\cikal\Desktop\mysqldumpsplit\node_modul
es\←[4mnatives←[24m\index.js:55:10)
    at Object.<anonymous> (C:\Users\cikal\Desktop\mysqldumpsplit\node_modules\←[
4mvinyl-fs←[24m\node_modules\←[4mgraceful-fs←[24m\fs.js:1:37)
←[90m    at Module._compile (internal/modules/cjs/loader.js:774:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10
)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:641:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:681:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:16:16)←[39m
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepublish: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cikal\AppData\Roaming\npm-cache\_logs\2019-06-13T02_25_02_
895Z-debug.log

C:\Users\cikal\Desktop\mysqldumpsplit>

2019-06-13T02_25_02_895Z-debug.log

@ilantc
Copy link

ilantc commented Jan 17, 2020

I also encountered this issue, while debugging it I noticed that a negative start index is being send to fs.read on windows.
Adding start = Math.max(start, 0); to readChunkOfFileToBuff seems to solve this.
This is a dirty solution and I'm not sure what's the root cause, so didn't PR this, but this is possibly a quick fix to whoever will encounter this in the future :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants