question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exception thrown outside of main thread when upload fails

See original GitHub issue
  1. Is this a client library issue or a product issue?

client issue - @google-cloud/storage@6.2.3

  1. Did someone already solve this? no but it’s very similar to https://github.com/googleapis/nodejs-storage/issues/1968, perhaps the same solution can be applied here?

  2. Do you have a support contract? no

Environment details

  • OS: linux
  • Node.js version: 16.x
  • npm version: 8.5.5
  • @google-cloud/storage version: 6.2.3

Steps to reproduce

unfortunately i can’t reliably reproduce it but sometimes we get errors that can’t be caught.

our code:

try {
  await storage.bucket(bucket).file(file).save(data, { resumable: false })
} catch(error) {
 // do something here
}

the stack trace

/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in new ApiError at line 79:15
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in Util.parseHttpRespBody at line 214:38
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in Util.handleResp at line 155:117
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in <anonymous> at line 535:22
/usr/src/app/node_modules/retry-request/index.js in onResponse at line 240:7
/usr/src/app/node_modules/teeny-request/build/src/index.js in <anonymous> at line 157:17
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in runMicrotasks
node:internal/process/task_queues in processTicksAndRejections at line 96:5

and the associated network request:

POST https://storage.googleapis.com/upload/storage/v1/b/BUCKET/o?uploadType=multipart&name=FILENAME [503]

we’ve seen this ~20 times today

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
modosccommented, Jul 20, 2022

@ddelgrosso1 thanks for the suggestion, we’re adding that option now.

0reactions
ddelgrosso1commented, Jul 28, 2022

Thank you for the update @modosc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

can't catch exception in main thread when other ...
It's not so much that the exception isn't caught as it is that destroying a joinable thread terminates the process.
Read more >
Thread.UncaughtExceptionHandler | by Yosi Mizrachi
Today I want to talk about Java's Thread. ... Exception in thread “main” java.lang. ... System.out.println("Failed to divide by zero.");
Read more >
C++ exceptions on iOS | Apple Developer Forums
When C++ exceptions are thrown on the main thread, they are caught by a CFRunLoop exception handler and rethrown, which destroys all the...
Read more >
How to Fix the FileNotFoundException in Java.io
The FileNotFoundException is a checked exception in Java that occurs when an attempt to open a file denoted by a specified pathname fails....
Read more >
Upload component throws an exception · Issue #702
Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Upload cannot be performed without a receiver set at com.vaadin.ui.Upload$2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found