Sentry-dart: 403 when switching from sentry to sentry_flutter

Created on 22 Feb 2021  Â·  4Comments  Â·  Source: getsentry/sentry-dart

_Platform:_

  • [ ] Dart
  • [x] Flutter Android or iOS
  • [ ] Flutter Web

_IDE:_

  • [ ] VSCode
  • [x] IntelliJ/AS
  • [ ] XCode
  • [ ] Other, which one?

_split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):_

  • [ ] Enabled
  • [x] Disabled

_Platform installed with:_

  • [x] pub.dev
  • [ ] GitHub

Output of the command flutter doctor -v below:

[✓] Flutter (Channel dev, 1.27.0-4.0.pre, on macOS 11.1 20C69 darwin-x64, locale en-DE)
    • Flutter version 1.27.0-4.0.pre at /Users/curvel/dev/flutter
    • Framework revision f8cd24de95 (6 days ago), 2021-02-16 11:24:17 -0800
    • Engine revision 1d537824d6
    • Dart version 2.13.0 (build 2.13.0-30.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/curvel/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • GM1913 (mobile) • d3b0f333 • android-arm64  • Android 11 (API 30)
    • macOS (desktop) • macos    • darwin-x64     • macOS 11.1 20C69 darwin-x64
    • Chrome (web)    • chrome   • web-javascript • Google Chrome 88.0.4324.182

• No issues found!

The version of the SDK (See pubspec.lock):
sentry_flutter: 4.0.5


I have the following issue:

After working with the pure "sentry" dart package I wanted to switch to "sentry_flutter". But when calling

  await SentryFlutter.init(
          (options) {
        options.dsn = sentryDsn;
      },
    );

The same way I called Sentry.init(...) with the old package I get a "Request failed, API returned 403" error. Nothing else got changed. And it's the only option I set.

Did I need to change anything else than this and the import?

Steps to reproduce:

  • Switching from "sentry" to "sentry_flutter".

Actual result:

D/Sentry  (17611):         <div class="page-header">
D/Sentry  (17611):             <h2>CSRF Verification Failed</h2>
D/Sentry  (17611):         </div>
D/Sentry  (17611): 
D/Sentry  (17611):         <p>A required security token was not found or was invalid.</p>
D/Sentry  (17611): 
D/Sentry  (17611):         <p>If you're continually seeing this issue, try the following:</p>

Expected result:

  • The same initialization as with the "sentry" package.
question

Most helpful comment

Same issue here,
On-premise Sentry: Sentry 9.1.2
Flutter Sentry: sentry_flutter: 4.0.0

What should I do, if I don't want to upgrade On-premise Sentry?

All 4 comments

@Curvel do you use on-premise Sentry? if so, please read the https://github.com/getsentry/sentry-dart/releases/tag/4.0.0 changelog, specifically _Sentry Self Hosted Compatibility_

@marandaneto thanks a lot, that has to be it! Didn't think about the server version could be conflicting with it due to the sentry dart package working like a charm!

@marandaneto thanks a lot, that has to be it! Didn't think about the server version could be conflicting with it due to the sentry dart package working like a charm!

yeah, the reason is the sentry package uses its own transport layer, an old endpoint that is retro compatible.
sentry_flutter also has its own transport which uses a new format and only available thru newer versions.

Same issue here,
On-premise Sentry: Sentry 9.1.2
Flutter Sentry: sentry_flutter: 4.0.0

What should I do, if I don't want to upgrade On-premise Sentry?

Was this page helpful?
0 / 5 - 0 ratings