Project

General

Profile

Actions

Bug #17779

closed

Exceptions thrown by the Python SDK should include the request id if possible

Added by Peter Amstutz almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Target version:
Story points:
-
Release relationship:
Auto

Subtasks 1 (0 open1 closed)

Task #17791: Review 17779-request-id-in-exceptionResolvedPeter Amstutz09/29/2021Actions

Related issues

Blocked by Arvados - Bug #17830: Controller doesn't propagate back X-Request-Id headers on "new code path" endpointsResolvedWard Vandewege07/22/2021Actions
Actions #1

Updated by Peter Amstutz almost 3 years ago

  • Assigned To set to Lucas Di Pentima
Actions #2

Updated by Lucas Di Pentima almost 3 years ago

  • Status changed from New to In Progress
Actions #3

Updated by Lucas Di Pentima almost 3 years ago

  • Target version changed from 2021-06-23 sprint to 2021-07-07 sprint
Actions #4

Updated by Lucas Di Pentima almost 3 years ago

  • Blocked by Bug #17830: Controller doesn't propagate back X-Request-Id headers on "new code path" endpoints added
Actions #5

Updated by Lucas Di Pentima almost 3 years ago

  • Target version changed from 2021-07-07 sprint to 2021-07-21 sprint
Actions #6

Updated by Lucas Di Pentima almost 3 years ago

  • Status changed from In Progress to New

Pausing this while we fix #17830

Actions #7

Updated by Lucas Di Pentima almost 3 years ago

  • Target version changed from 2021-07-21 sprint to 2021-08-04 sprint
Actions #8

Updated by Lucas Di Pentima over 2 years ago

  • Status changed from New to In Progress
Actions #9

Updated by Lucas Di Pentima over 2 years ago

  • Target version changed from 2021-08-04 sprint to 2021-08-18 sprint
Actions #10

Updated by Lucas Di Pentima over 2 years ago

  • Target version changed from 2021-08-18 sprint to 2021-09-01 sprint
Actions #11

Updated by Lucas Di Pentima over 2 years ago

  • Target version changed from 2021-09-01 sprint to 2021-09-15 sprint
Actions #12

Updated by Lucas Di Pentima over 2 years ago

  • Target version changed from 2021-09-15 sprint to 2021-09-29 sprint
Actions #13

Updated by Tom Clegg over 2 years ago

  • Assigned To changed from Lucas Di Pentima to Tom Clegg

While testing this I found a couple of instances where we do

  try:
    ...
  except RealException as e:
    raise BetterExplanation('encountered error %s', str(e))

In Python 3, this causes a confusing report like this, which is not what we intended:

Traceback:
  (stack trace)
RealException: ...

During handling of the above exception, another exception occurred:

Traceback:
  (stack trace)
BetterExplanation: encountered error ...

Updated to "raise ... from None" to suppress the extra stack trace and the misleading "another exception occurred" text.

Since #13147 arv-put also appends the request ID to anything logged at "debug" or "error" level, so now it appears twice. Not sure whether we want to update arv-put to remove one of them.

2021-09-28 14:24:06 arvados.arv_put[2719] INFO: Resuming upload from cache file /home/tom/.cache/arvados/arv-put/5100a66866e71d151688c003f7e05230
0M / 0M 0.0% 2021-09-28 14:24:34 arvados.arv_put[2719] ERROR: arv-put: Error writing some blocks: block
 f555a8e1db0ef866c91b92db87275b7e+21155 raised KeepWriteError ([req-i6kwtgjylon7bsq0x4uk] failed to write
 f555a8e1db0ef866c91b92db87275b7e after 4 attempts (wanted (2, ['default']) copies but wrote (0, [])):
 service http://localhost:45621/ responded with 0 (7, 'Failed to connect to localhost port 45621:
 Connection refused'); service http://localhost:49069/ responded with 0 (7, 'Failed to connect to
 localhost port 49069: Connection refused')) (X-Request-Id: req-i6kwtgjylon7bsq0x4uk)

17779-request-id-in-exception @ ea5a800b643143baade1eb6c7f1760d366d92674 -- developer-run-tests: #2712

Actions #14

Updated by Peter Amstutz over 2 years ago

  • Release set to 42
Actions #15

Updated by Tom Clegg over 2 years ago

Fixed wrong exception returned for invalid manifest caught by test.

17779-request-id-in-exception @ 13284d68be03f9d23cb59c94bc7dc72701fdec11 -- developer-run-tests: #2715

Actions #16

Updated by Peter Amstutz over 2 years ago

  • Target version changed from 2021-09-29 sprint to 2021-10-13 sprint
Actions #17

Updated by Peter Amstutz over 2 years ago

Tom Clegg wrote:

Fixed wrong exception returned for invalid manifest caught by test.

17779-request-id-in-exception @ 13284d68be03f9d23cb59c94bc7dc72701fdec11 -- developer-run-tests: #2715

LGTM

Actions #18

Updated by Tom Clegg over 2 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados-private:commit:arvados|1441208182ced30e28f05611fbfa51674570dd1e.

Actions

Also available in: Atom PDF