Skip to content

Node fs package throws: Assertion `args[3]->IsInt32()' failed. #36643

Description

@edu81
- Node Version: v13.7.0

- Platform: MacBook Pro Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

What steps will reproduce the bug?

Tried to run a script to download zip files from Google Drive: first file OK (2Gb aprox), second file OK (1.5Gb), third file NOT OK (aprox 3GB)
The code running at this point is:

`await Promise.all(driveFiles.map((file) => googleDrive.downloadFileById(file))).then((downloaded) => downloaded.forEach((d) => console.log(d)));`

dependency is:

const googleDrive = require('./googleApi.js');

and googleApi.js is code to download from Google Drive copy/pasted from example docs:

https://developers.google.com/drive/api/v3/manage-downloads

How often does it reproduce? Is there a required condition?

Everytime when I run it. I run via nodemon mainScript.js

What is the expected behavior?

Files downloaded from my Google Drive and paths printed in console

What do you see instead?

First and second file download OK and when trying to download thhird file i get:

Inode[4463]: ../src/node_file.cc:1833:void node::fs::WriteBuffer(const FunctionCallbackInfo<v8::Value> &): Assertion `args[3]->IsInt32()' failed.
 1: 0x101366e15 node::Abort() (.cold.1) [/...<pathToMyNodeProjectsFolder>.../nodeProjects/testDownloadApi/node_modules/.bin/node]
 2: 0x1000be439 node::Abort() [/...<pathToMyNodeProjectsFolder>.../nodeProjects/testDownloadApi/node_modules/.bin/node]
 3: 0x1000be2a1 node::Assert(node::AssertionInfo const&) [...<pathToMyNodeProjectsFolder>.../nodeProjects/testDownloadApi/node_modules/.bin/node]
 4: 0x1000cf254 node::fs::WriteBuffer(v8::FunctionCallbackInfo<v8::Value> const&) [/...<pathToMyNodeProjectsFolder>.../nodeProjects/testDownloadApi/node_modules/.bin/node]
 5: 0x1002a2948 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/...<pathToMyNodeProjectsFolder>.../nodeProjects/testDownloadApi/no

Activity

  1. added
    fsIssues and PRs related to file-system APIs and the fs module.
    on Dec 27, 2020
  2. edu81 commented on Dec 30, 2020

    @edu81
    Author

    why is this closed? what is the resolution?

  3. Ayase-252 commented on May 5, 2021

    @Ayase-252
    Member

    Per #38546, I reopen the issue, since it turned to a confusing Error now.

    node:internal/fs/utils:343
        throw err;
        ^
    
    Error: EINVAL: invalid argument, write
        at Object.writeSync (node:fs:882:3)
        at Object.<anonymous> (/Users/qingyudeng/projects/node/index.js:5:16)
        at Module._compile (node:internal/modules/cjs/loader:1109:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
        at Module.load (node:internal/modules/cjs/loader:989:32)
        at Function.Module._load (node:internal/modules/cjs/loader:829:14)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
        at node:internal/main/run_main_module:17:47 {
      errno: -22,
      syscall: 'write',
      code: 'EINVAL'
    }
    
  4. Ayase-252 commented on May 11, 2021

    @Ayase-252
    Member

    Since #38546 landed, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions