getsentry/sentry-dart-plugin

Failed to parse org auth token {token} in 1.6.0 and 1.6.2

lexxxel opened this issue · 13 comments

Environment

I have a flutter web project with:

Flutter 3.13.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 12fccda598 (6 weeks ago) • 2023-09-19 13:56:11 -0700
Engine • revision bd986c5ed2
Tools • Dart 3.1.2 • DevTools 2.25.0
...  
sentry_dart_plugin: 1.6.0
...
sentry:
  upload_debug_symbols: true
  upload_source_maps: true
  upload_sources: true
  project: <redacted>
  org: <redacted>
  auth_token: sntrys_eyJ<redacted>DoA
  url: https://sentry.<redacted>.com/
  log_level: debug
  wait_for_processing: true

Steps to Reproduce

  1. run the tool: dart run sentry_dart_plugin

Expected Result

v.1.5.0 gives me:

$ dart run sentry_dart_plugin
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..        
Downloaded Sentry CLI binary checksum verification passed successfully (hash: a9fb79e44c5bae6ca8dfd2c66ac918c7e0405e3456edeb100d698961842f057f).
☑ reading config values                                                             
☑ validating config values                                                             
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 18% uploading debug symbols..                                
INFO    2023-11-03 10:30:51.075267157 +01:00 sentry-cli was invoked with the following command line: "<redacted>/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.<redacted>.com/" "--auth-token" "sntrys_eyJ<redacted>DoA" "--log-level" "info" "debug-files" "upload" "--org" "<redacted>" "--project" "<redacted>" "--include-sources" "<redacted>" "--wait"
  INFO    2023-11-03 10:30:51.075315067 +01:00 Issuing a command for Organization: <redacted> Project: <redacted>

> Found 1 debug information file

> Resolved source code for 0 debug information files

> Prepared debug information file for upload

> Nothing to upload, all files are on the server
☑ uploading debug symbols                                                             

INFO    2023-11-03 10:30:51.683722271 +01:00 sentry-cli was invoked with the following command line: "<redacted>/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.<redacted>.com/" "--auth-token" "sntrys_eyJ<redacted>DoA" "--log-level" "info" "releases" "--org" "<redacted>" "--project" "<redacted>" "new" "<redacted>@1.0.0+1"

Created release <redacted>@1.0.0+1
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 27% uploading source maps..                               
INFO    2023-11-03 10:30:51.986957094 +01:00 sentry-cli was invoked with the following command line: "<redacted>/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.<redacted>.com/" "--auth-token" "sntrys_eyJ<redacted>DoA" "--log-level" "info" "releases" "--org" "<redacted>" "--project" "<redacted>" "files" "<redacted>@1.0.0+1" "upload-sourcemaps" "<redacted>/build/web" "--ext" "map" "--ext" "js" "--dist" "1" "--wait"

> Found 8 files

> Analyzing 8 sources

> Rewriting sources

> Adding source map references

> Bundled 8 files for upload
> Bundle ID: 92f59c55-8bf6-5b08-82e8-f5236dc3aa7d

> Uploaded files to Sentry

> File processing complete
> Organization: ehd
> Project: <redacted>
> Release: <redacted>@1.0.0+1
> Dist: 1
> Upload type: artifact bundle

Source Map Upload Report
  Scripts
    ~/flutter.js
    ~/flutter_service_worker.js
  Minified Scripts
    ~/canvaskit/canvaskit.js (sourcemap at ../main.dart.js.map)
    ~/canvaskit/chromium/canvaskit.js (sourcemap at ../../main.dart.js.map)
    ~/canvaskit/skwasm.js (sourcemap at ../main.dart.js.map)
    ~/canvaskit/skwasm.worker.js (sourcemap at ../main.dart.js.map)
    ~/main.dart.js (sourcemap at main.dart.js.map)
  Source Maps
    ~/main.dart.js.map

INFO    2023-11-03 10:30:53.544894924 +01:00 sentry-cli was invoked with the following command line: "<redacted>/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.<redacted>.com/" "--auth-token" "sntrys_eyJ<redacted>DoA" "--log-level" "info" "releases" "--org" "<redacted>" "--project" "<redacted>" "files" "<redacted>@1.0.0+1" "upload-sourcemaps" "<redacted>" "--ext" "dart" "--dist" "1" "--wait"

> Found 62 files

> Analyzing 62 sources

> Rewriting sources
> Adding source map references

> Bundled 62 files for upload
> Bundle ID: acea3b2c-1818-5565-ac1b-c50518ca5e52

> Uploaded files to Sentry

> File processing complete
> Organization: ehd
> Project: <redacted>
> Release: <redacted>@1.0.0+1
> Dist: 1
> Upload type: artifact bundle

Source Map Upload Report
  Scripts
    ~/lib/constants/settings.dart
    <redacted>
☑ uploading source maps                                                             

INFO    2023-11-03 10:30:55.227553846 +01:00 sentry-cli was invoked with the following command line: "<redacted>/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.<redacted>.com/" "--auth-token" "sntrys_eyJ<redacted>DoA" "--log-level" "info" "releases" "--org" "<redacted>" "--project" "<redacted>" "set-commits" "<redacted>@1.0.0+1" "--auto"

INFO    2023-11-03 10:30:55.403934478 +01:00 Resolving HEAD (<redacted>@HEAD)

INFO    2023-11-03 10:30:55.408866330 +01:00 Resolving HEAD (<redacted>@HEAD)

INFO    2023-11-03 10:30:55.410363748 +01:00   -> found matching revision 4dbf0dd0e06d7cfadab343e711b537f943173990
  INFO    2023-11-03 10:30:55.410470729 +01:00 Resolving HEAD (<redacted>@HEAD)

INFO    2023-11-03 10:30:55.413719792 +01:00 Resolving HEAD (<redacted>@HEAD)

+----------------------------------------+--------------+
| Repository                             | Revision     |
+----------------------------------------+--------------+
| <redacted> | 4dbf0dd0e06d |
+----------------------------------------+--------------+

INFO    2023-11-03 10:30:55.791254432 +01:00 sentry-cli was invoked with the following command line: "<redacted>/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--url" "https://sentry.<redacted>.com/" "--auth-token" "sntrys_eyJ<redacted>DoA" "--log-level" "info" "releases" "--org" "<redacted>" "--project" "<redacted>" "finalize" "<redacted>@1.0.0+1"

Finalized release <redacted>@1.0.0+1

Actual Result

v1.6.* gives me:

SENTRY_LOG_LEVEL=debug dart run sentry_dart_plugin --log-level=debug
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..        
Downloaded Sentry CLI binary checksum verification passed successfully (hash: 043c1480ede8e8e093070fa705e2723b2b556763e5c10eaa020e3923fad2da20).
☑ reading config values                                                             
☑ validating config values                                                             
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 18% uploading debug symbols..                                
error: Failed to parse org auth token {token}
  caused by: invalid type: null, expected a string at line 1 column 35

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

exitCode: 1

Also it's not possible to set the log level.

Hi

Have you tried it with other generated auth tokens as well?

How do you generate your token?

Hi

Have you tried it with other generated auth tokens as well?

I think I generated 2 Tokens, neither worked.

How do you generate your token?

I have a self-hosted instance and simply create an auth token under the organization tab on the website:
image
I think I can not change the permissions on free tier.

Tried another fresh token - did not work either

Just for testing: have you tried an auth token on sentry.io and test the plugin there? If it works there, your self-hosted might have an issue

I have not tested there, but everything worked with the version before 1.6.0.

Also, sentry is on the latest version. I would be surprised if the error is on sentries side, I mean, the plugin does not even start to print debug messages.

We bumped the sentry-cli version from 2.19.4 to 2.20.6.

@loewenheim maybe you have an idea here?

@lexxxel Can you decode the part of the token between the underscores with e.g. https://www.base64decode.org/ and post the contents? You don't need to paste the URL or org name, only whether they are strings or null.

Of course:
{"iat":<float_number>,"url":null,"region_url":"https://sentry.<redacted>.com","org":"<redacted>"}�6Ri򳃉58<3 symbols redacted>Ƶ[:�

Org auth tokens with no URL are supported since sentry-cli 2.21.2. It will need to be updated.

Gotcha, thx!

so this is a duplicate of the linked issues in getsentry/sentry-cli#1766

@lexxxel we just released 1.6.3 which should fix your problem

@lexxxel we just released 1.6.3 which should fix your problem

@buenaflor tested and worked - thank you very much