Skip to content

npm: Useless error handling / stack traces when something breaks #2373

@kubijo

Description

@kubijo

CLI Version

2.39.1

Operating System and Architecture

  • macOS (arm64)
  • macOS (x86_64)
  • Linux (i686)
  • Linux (x86_64)
  • Linux (armv7)
  • Linux (aarch64)
  • Windows (i686)
  • Windows (x86_64)

Operating System Version

Ubuntu 24.10

Link to reproduction repository

Not possible

CLI Command

sentry-cli upload-sourcemaps /tmp/sentry-bundler-plugin-upload-iQxDx6 --ignore node_modules --no-rewrite --use-artifact-bundle

Exact Reproduction Steps

Expected Results

  • A real issue / cause of problem is reported, not a fallback case
  • Stack trace includes real information

Actual Results

I get this output (log-level set to debug).

  • As you can see, the stack trace is less than useless, since this implies that even more has gone wrong in addition to a supposed problem causing the trace to be produced.
  • Were the maps uploaded, or did the whole process fail? I can't tell from this.
  • Another misleading error is when I set url to something that leads to a redirect… it tells me that the project was not found, not that it failed because you intentionally do not support following redirects ... leading me to spend a day hunting down wrong paths...

I do get that the debug log ultimately does say that it encountered a 301/302 even though it says project not found or in the case of this log that the releases request got 502 instead of Info: Successfully uploaded source maps to Sentry, but hopefully, you see that this just doesn't do what it should.

> Bundled 42 files for upload
> Bundle ID: 95362a95-0674-5519-ad70-4fc1c6bb1d63
error: Project not found. Ensure that you configured the correct project and organization.

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
  DEBUG   2025-02-03 14:17:08.152810754 +02:00 skipping update nagger because session is not attended
[sentry-webpack-plugin] Info: Successfully uploaded source maps to Sentry

Logs

  DEBUG   2025-02-03 14:17:06.331323515 +02:00 sentry-cli version: 2.39.1, platform: "linux", architecture: "x86_64"
  INFO    2025-02-03 14:17:06.331711620 +02:00 sentry-cli was invoked with the following command line: "sentry-cli" "--header" "sentry-trace:1b7ee14307a4491396442aa9da7e98be-83c4000b61fddd39-1" "--header" "baggage:sentry-environment=production,sentry-release=3.1.1,sentry-public_key=4c2bae7d9fbc413e8f7385f55c515d51,sentry-trace_id=1b7ee14307a4491396442aa9da7e98be,sentry-sample_rate=1,sentry-transaction=debug-id-sourcemap-upload,sentry-sampled=true" "releases" "files" "b87cf47a9" "upload-sourcemaps" "/tmp/sentry-bundler-plugin-upload-iQxDx6" "--ignore" "node_modules" "--no-rewrite" "--use-artifact-bundle"
  DEBUG   2025-02-03 14:17:06.331964427 +02:00 request GET https://__REDACTED__/api/0/organizations/sentry/chunk-upload/
  DEBUG   2025-02-03 14:17:06.331971157 +02:00 pipeline: webpack-plugin/3.1.1
  DEBUG   2025-02-03 14:17:06.331976057 +02:00 using token authentication
  DEBUG   2025-02-03 14:17:06.331980477 +02:00 retry number 0, max retries: 0
  DEBUG   2025-02-03 14:17:06.494007813 +02:00 > GET /api/0/organizations/sentry/chunk-upload/ HTTP/1.1
  DEBUG   2025-02-03 14:17:06.494018563 +02:00 > Host: __REDACTED__
  DEBUG   2025-02-03 14:17:06.494021752 +02:00 > Accept: */*
  DEBUG   2025-02-03 14:17:06.494024632 +02:00 > Connection: TE
  DEBUG   2025-02-03 14:17:06.494027302 +02:00 > TE: gzip
  DEBUG   2025-02-03 14:17:06.494029862 +02:00 > sentry-trace:1b7ee14307a4491396442aa9da7e98be-83c4000b61fddd39-1
  DEBUG   2025-02-03 14:17:06.494032492 +02:00 > baggage:sentry-environment=production,sentry-release=3.1.1,sentry-public_key=4c2bae7d9fbc413e8f7385f55c515d51,sentry-trace_id=1b7ee14307a4491396442aa9da7e98be,sentry-sample_rate=1,sentry-transaction=debug-id-sourcemap-upload,sentry-sampled=true
  DEBUG   2025-02-03 14:17:06.494035222 +02:00 > User-Agent: sentry-cli/2.39.1 webpack-plugin/3.1.1
  DEBUG   2025-02-03 14:17:06.494251990 +02:00 > Authorization: Bearer bd3baa4a***
  DEBUG   2025-02-03 14:17:06.636371550 +02:00 < HTTP/1.1 200 OK
  DEBUG   2025-02-03 14:17:06.636387190 +02:00 < server: nginx
  DEBUG   2025-02-03 14:17:06.636393980 +02:00 < date: Mon, 03 Feb 2025 12:17:06 GMT
  DEBUG   2025-02-03 14:17:06.636398080 +02:00 < content-type: application/json
  DEBUG   2025-02-03 14:17:06.636401820 +02:00 < content-length: 301
  DEBUG   2025-02-03 14:17:06.636406750 +02:00 < allow: GET, POST, HEAD, OPTIONS
  DEBUG   2025-02-03 14:17:06.636412370 +02:00 < access-control-allow-methods: GET, POST, HEAD, OPTIONS
  DEBUG   2025-02-03 14:17:06.636424299 +02:00 < access-control-allow-headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding
  DEBUG   2025-02-03 14:17:06.636428219 +02:00 < access-control-expose-headers: X-Sentry-Error, Retry-After
  DEBUG   2025-02-03 14:17:06.636432259 +02:00 < access-control-allow-origin: *
  DEBUG   2025-02-03 14:17:06.636435199 +02:00 < x-sentry-rate-limit-remaining: 619
  DEBUG   2025-02-03 14:17:06.636438419 +02:00 < x-sentry-rate-limit-limit: 620
  DEBUG   2025-02-03 14:17:06.636441289 +02:00 < x-sentry-rate-limit-reset: 1738585027
  DEBUG   2025-02-03 14:17:06.636444349 +02:00 < vary: Accept-Language, Cookie
  DEBUG   2025-02-03 14:17:06.636447509 +02:00 < content-language: en
  DEBUG   2025-02-03 14:17:06.636450569 +02:00 < x-frame-options: deny
  DEBUG   2025-02-03 14:17:06.636453619 +02:00 < x-content-type-options: nosniff
  DEBUG   2025-02-03 14:17:06.636457239 +02:00 < x-xss-protection: 1; mode=block
  DEBUG   2025-02-03 14:17:06.636479969 +02:00 response status: 200
  DEBUG   2025-02-03 14:17:06.636485819 +02:00 body: {"url":"http://__REDACTED__/api/0/organizations/sentry/chunk-upload/","chunkSize":8388608,"chunksPerRequest":64,"maxFileSize":2147483648,"maxRequestSize":33554432,"concurrency":8,"hashAlgorithm":"sha1","compression":["gzip"],"accept":["debug_files","release_files","pdbs","sources","bcsymbolmaps"]}
> Found 42 files
> Analyzing 42 sources
> Adding source map references
  DEBUG   2025-02-03 14:17:06.771379932 +02:00 request GET https://__REDACTED__/api/0/projects/sentry/frontend/releases/b87cf47a9/files/?cursor=&checksum=0602e21cb93e19354519f3d27b977b520c934524&checksum=0e6bb4298a50e03e1ec821bdab1ec2f470e4f97e&checksum=16c9db2c60c036de9c2d773ebe8fc7612de4e18d&checksum=23f746f76578262a7d2ac446ab73db65face4d36&checksum=261e6d8c3ef89c7ea63ae5eef6c09e4afb6cee7e&checksum=271b3539ab98b2f5f6d57076da78793a669e4044&checksum=2d67ee65d9f9754e773d4a06658612eb7b836fc7&checksum=2d6cfa9808b0c47cc8265fabe652890a3bcb57a5&checksum=2d77fc17835cd0d68429b352c3e73eff94709aca&checksum=2f986a36f85dc1e18f1d015bf65ba268878357a8&checksum=3491b9ca554a46dabae1c3919c1427d23ecb85b4&checksum=3a1bdf5187b4ee1471a233e25899c6897a7e4dd2&checksum=4387955ab3e153ac3d73d33b43da6892418364db&checksum=4b7374c45bedfe5d012c7406645323551c0950eb&checksum=54c3f108bc079830168dfb94c7054e5f16ec7345&checksum=5758cef28e6c43f8a2cf10a5af423605f519e861&checksum=597bd27d1a320e786078bc76c6fdfc09b84758b3&checksum=6446087bf6d6a2e5a1485598d28557583ab8b240&checksum=6ca798ce0e3f787e7fab56856e26cd5b42fb6317&checksum=6f9997320fab7d4b63b431cd831e7439410c1e17&checksum=6fc58ca066ccbd770ec60ab32b48f06a1ac8a44f&checksum=737987a472467a0a596af6ca00639362370285c2&checksum=755e91716b90412a814512029b91235bdd058d1d&checksum=77c793a336e3ed8ddf58bc88de4930bd009eea12&checksum=7d8ec785d8b145a80e12c16447be8d8b260dbf49&checksum=8818066b100a60333b2e361d9d3298728feb1b24&checksum=96f703644bfeb023f669a152d72a93bb7b24374a&checksum=9c6091dcfdb14ebeb484f4cc5de34ce5a5d7c999&checksum=9d7dc5444e2c3f214b796a285824bb0dde0132b5&checksum=9e5c43b446c98c0239a3ccb6c209238bda4533b7&checksum=afaeda0ac69806eef7f05c1b60e7384322a27328&checksum=bd99e001adc48251b691bf96ddd55f12b285b437&checksum=c92181ae97b18d03fca5372231c122347b93902f&checksum=c9e64d1c04940982842f26357a6ea3ae88d8627d&checksum=d00b9a44515e9387d88ca348a12047116cfa0cff&checksum=d02eabab11e29ecefebb24153a6cb35b9b8d1749&checksum=d5537824d66a74b9c095e2da328bfdd58684a849&checksum=e1f04997438a446f5511fcfa1d8b43a997403035&checksum=e5e4db43ffa633c8d2643026cf53011cfba3b8a2&checksum=e7d13092264aafad6f0d6cdbc95f7d49352e2b8d&checksum=f4dd919524a871600308f3a262cf5d2693935856&checksum=fda9c407f92abdb6d8a5d1105c02ed29420833ef
  DEBUG   2025-02-03 14:17:06.771398521 +02:00 pipeline: webpack-plugin/3.1.1
  DEBUG   2025-02-03 14:17:06.771412701 +02:00 using token authentication
  DEBUG   2025-02-03 14:17:06.771425771 +02:00 retry number 0, max retries: 0
  DEBUG   2025-02-03 14:17:06.771561139 +02:00 > GET /api/0/projects/sentry/frontend/releases/b87cf47a9/files/?cursor=&checksum=0602e21cb93e19354519f3d27b977b520c934524&checksum=0e6bb4298a50e03e1ec821bdab1ec2f470e4f97e&checksum=16c9db2c60c036de9c2d773ebe8fc7612de4e18d&checksum=23f746f76578262a7d2ac446ab73db65face4d36&checksum=261e6d8c3ef89c7ea63ae5eef6c09e4afb6cee7e&checksum=271b3539ab98b2f5f6d57076da78793a669e4044&checksum=2d67ee65d9f9754e773d4a06658612eb7b836fc7&checksum=2d6cfa9808b0c47cc8265fabe652890a3bcb57a5&checksum=2d77fc17835cd0d68429b352c3e73eff94709aca&checksum=2f986a36f85dc1e18f1d015bf65ba268878357a8&checksum=3491b9ca554a46dabae1c3919c1427d23ecb85b4&checksum=3a1bdf5187b4ee1471a233e25899c6897a7e4dd2&checksum=4387955ab3e153ac3d73d33b43da6892418364db&checksum=4b7374c45bedfe5d012c7406645323551c0950eb&checksum=54c3f108bc079830168dfb94c7054e5f16ec7345&checksum=5758cef28e6c43f8a2cf10a5af423605f519e861&checksum=597bd27d1a320e786078bc76c6fdfc09b84758b3&checksum=6446087bf6d6a2e5a1485598d28557583ab8b240&checksum=6ca798ce0e3f787e7fab56856e26cd5b42fb6317&checksum=6f9997320fab7d4b63b431cd831e7439410c1e17&checksum=6fc58ca066ccbd770ec60ab32b48f06a1ac8a44f&checksum=737987a472467a0a596af6ca00639362370285c2&checksum=755e91716b90412a814512029b91235bdd058d1d&checksum=77c793a336e3ed8ddf58bc88de4930bd009eea12&checksum=7d8ec785d8b145a80e12c16447be8d8b260dbf49&checksum=8818066b100a60333b2e361d9d3298728feb1b24&checksum=96f703644bfeb023f669a152d72a93bb7b24374a&checksum=9c6091dcfdb14ebeb484f4cc5de34ce5a5d7c999&checksum=9d7dc5444e2c3f214b796a285824bb0dde0132b5&checksum=9e5c43b446c98c0239a3ccb6c209238bda4533b7&checksum=afaeda0ac69806eef7f05c1b60e7384322a27328&checksum=bd99e001adc48251b691bf96ddd55f12b285b437&checksum=c92181ae97b18d03fca5372231c122347b93902f&checksum=c9e64d1c04940982842f26357a6ea3ae88d8627d&checksum=d00b9a44515e9387d88ca348a12047116cfa0cff&checksum=d02eabab11e29ecefebb24153a6cb35b9b8d1749&checksum=d5537824d66a74b9c095e2da328bfdd58684a849&checksum=e1f04997438a446f5511fcfa1d8b43a997403035&checksum=e5e4db43ffa633c8d2643026cf53011cfba3b8a2&checksum=e7d13092264aafad6f0d6cdbc95f7d49352e2b8d&checksum=f4dd919524a871600308f3a262cf5d2693935856&checksum=fda9c407f92abdb6d8a5d1105c02ed29420833ef HTTP/1.1
  DEBUG   2025-02-03 14:17:06.771572339 +02:00 > Host: __REDACTED__
  DEBUG   2025-02-03 14:17:06.771575269 +02:00 > Accept: */*
  DEBUG   2025-02-03 14:17:06.771578009 +02:00 > Connection: TE
  DEBUG   2025-02-03 14:17:06.771580429 +02:00 > TE: gzip
  DEBUG   2025-02-03 14:17:06.771583379 +02:00 > sentry-trace:1b7ee14307a4491396442aa9da7e98be-83c4000b61fddd39-1
  DEBUG   2025-02-03 14:17:06.771593649 +02:00 > baggage:sentry-environment=production,sentry-release=3.1.1,sentry-public_key=4c2bae7d9fbc413e8f7385f55c515d51,sentry-trace_id=1b7ee14307a4491396442aa9da7e98be,sentry-sample_rate=1,sentry-transaction=debug-id-sourcemap-upload,sentry-sampled=true
  DEBUG   2025-02-03 14:17:06.771597459 +02:00 > User-Agent: sentry-cli/2.39.1 webpack-plugin/3.1.1
  DEBUG   2025-02-03 14:17:06.771617219 +02:00 > Authorization: Bearer bd3baa4a***
  DEBUG   2025-02-03 14:17:06.971575039 +02:00 < HTTP/1.1 502 Bad Gateway
  DEBUG   2025-02-03 14:17:06.971632368 +02:00 < server: nginx
  DEBUG   2025-02-03 14:17:06.971639378 +02:00 < date: Mon, 03 Feb 2025 12:17:06 GMT
  DEBUG   2025-02-03 14:17:06.971659258 +02:00 < content-type: text/html
  DEBUG   2025-02-03 14:17:06.971665778 +02:00 < content-length: 150
  DEBUG   2025-02-03 14:17:06.971698258 +02:00 response status: 502
  DEBUG   2025-02-03 14:17:06.971707677 +02:00 body: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

> Bundled 42 files for upload
> Bundle ID: 95362a95-0674-5519-ad70-4fc1c6bb1d63
error: Project not found. Ensure that you configured the correct project and organization.

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
  DEBUG   2025-02-03 14:17:08.152810754 +02:00 skipping update nagger because session is not attended
[sentry-webpack-plugin] Info: Successfully uploaded source maps to Sentry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions