nodejs-storage icon indicating copy to clipboard operation
nodejs-storage copied to clipboard

ERR_MULTIPLE_CALLBACK on file.download()

Open Aliaksandr-K-JazzTeam opened this issue 3 years ago • 4 comments

  1. Is this a client library issue or a product issue? yes

  2. Did someone already solve this?

  • Search the issues already opened: https://github.com/googleapis/nodejs-storage/issues
  • Search the issues on our "catch-all" repository: https://github.com/googleapis/google-cloud-node
  • Search or ask on StackOverflow (engineers monitor these tags): http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js no
  1. Do you have a support contract? no

If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

  • OS: Win10 21H2
  • Node.js version: 16.13.2
  • npm version: 8.1.2
  • @google-cloud/storage version: 6.5.2

Steps to reproduce

Try to download a file:

  try {
    await file.download({
      destination: destination
    })
  } catch(e) {
    console.log(e);
  }

As the result catching error ERR_MULTIPLE_CALLBACK

Aliaksandr-K-JazzTeam avatar Oct 11 '22 08:10 Aliaksandr-K-JazzTeam

Hi @Aliaksandr-Kasko-JazzTeam thank you for opening an issue. Can you provide us with a bit more information, how often are you seeing this error? Was the code you provided previously working in a different version of the library? Do other operations (i.e. upload) work correctly?

ddelgrosso1 avatar Oct 11 '22 16:10 ddelgrosso1

Hi, @ddelgrosso1.

  1. I see this error every time with this mentioned version of library.
  2. The code was working with previous versions of library (now I tried with 6.5.0).
  3. I can't try other operations like upload because our project is very complex (first we download a file, then we make computations, at last we upload another computed file).

Aliaksandr-K-JazzTeam avatar Oct 12 '22 13:10 Aliaksandr-K-JazzTeam

@Aliaksandr-Kasko-JazzTeam by chance have you tried the above on a platform other than Windows, if so what was the result? Is there anything special or different about destination argument? Could you provide a more detailed stack trace? Have you also recently changed versions of Node, if so from what version to 16.13.2.

I tried this in both a Linux and Mac environment with v6.5.2 and was unable to recreate the error you are seeing.

ddelgrosso1 avatar Oct 12 '22 14:10 ddelgrosso1

I also tested this in a Windows 10 environment but did not see the issue. @Aliaksandr-Kasko-JazzTeam if you can provide the information from my previous comment I will investigate further.

ddelgrosso1 avatar Oct 18 '22 13:10 ddelgrosso1

Don't know if it helps, but getting the same problem on macOS Monterey version 12.6, node version 14.17.6, @google-cloud/storage version 6.5.4. Fixed by switching on node version 16.18.0 (LTS)

amerej avatar Oct 25 '22 09:10 amerej

Thanks @amerej we believe we have found the cause of this issue and we will be releasing a fix shortly.

ddelgrosso1 avatar Oct 25 '22 13:10 ddelgrosso1

@ddelgrosso1 sorry for my long response and big thanks for fix. Now it works for me

Aliaksandr-K-JazzTeam avatar Nov 01 '22 11:11 Aliaksandr-K-JazzTeam

Thanks for letting me know @Aliaksandr-Kasko-JazzTeam. Glad this resolved your issue.

ddelgrosso1 avatar Nov 01 '22 13:11 ddelgrosso1