Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud_firestore errors are not explicit at all #34789

Closed
sergiuiacob1 opened this issue Jun 20, 2019 · 4 comments
Closed

cloud_firestore errors are not explicit at all #34789

sergiuiacob1 opened this issue Jun 20, 2019 · 4 comments
Labels
p: cloud_firestore Firebase Firestore plugin package flutter/packages repository. See also p: labels. waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@sergiuiacob1
Copy link

Problem

The cloud_firestore plugin can crash in a horrible way, without any indication to what failed whatsoever. For example, if the database rules DO NOT ALLOW a certain user to access some data and the user tries to access that data, the logs aren't helpful at all

Steps to Reproduce

  1. use cloud_firestore: ^0.12.5+2
  2. Create any transaction of any kind. For example, creating a document in the Cloud Firestore
  3. Set up the rules in the database in such a way that the user requesting to create a document doesn't have the privillege to create that document
  4. Receive the error below

Logs

Flutter doctor:

sergiuiacob: ~ flutter doctor --verbose
[✓] Flutter (Channel beta, v1.6.3, on Mac OS X 10.14.5 18F132, locale en-GB)
    • Flutter version 1.6.3 at /Users/sergiuiacob/development/flutter
    • Framework revision bc7bc94083 (4 weeks ago), 2019-05-23 10:29:07 -0700
    • Engine revision 8dc3a4cde2
    • Dart version 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/sergiuiacob/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Users/sergiuiacob/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5522156/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    ✗ Verify that all connected devices have been paired with this computer in
      Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may
      require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.4
    • CocoaPods version 1.7.1

[✓] Android Studio (version 3.4)
    • Android Studio at /Users/sergiuiacob/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5522156/Android
      Studio.app/Contents
    • Flutter plugin version 36.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2019.1.3)
    • IntelliJ at /Users/sergiuiacob/Applications/JetBrains Toolbox/IntelliJ
      IDEA Ultimate.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.35.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.21.1

[✓] Connected device (2 available)
    • ONEPLUS A3003 • e9abdd97                             • android-arm64 •
      Android 9 (API 28)
    • iPhone Xʀ     • D9A3594F-9429-4ECC-93AD-FA3FF3884D7C • ios           •
      com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)

! Doctor found issues in 2 categories.

Logs when the app crashes:

D/CloudFirestorePlugin(30707): sending set success
E/AndroidRuntime(30707): FATAL EXCEPTION: AsyncTask #6
E/AndroidRuntime(30707): Process: com.sergiuiacob.terrasave, PID: 30707
E/AndroidRuntime(30707): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(30707): 	at android.os.AsyncTask$3.done(AsyncTask.java:354)
E/AndroidRuntime(30707): 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(30707): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(30707): 	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(30707): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime(30707): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(30707): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(30707): 	at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(30707): Caused by: java.lang.IllegalStateException: Transaction has already completed.
E/AndroidRuntime(30707): 	at com.google.firebase.firestore.core.Transaction.write(com.google.firebase:firebase-firestore@@19.0.0:114)
E/AndroidRuntime(30707): 	at com.google.firebase.firestore.core.Transaction.set(com.google.firebase:firebase-firestore@@19.0.0:152)
E/AndroidRuntime(30707): 	at com.google.firebase.firestore.Transaction.set(com.google.firebase:firebase-firestore@@19.0.0:95)
E/AndroidRuntime(30707): 	at com.google.firebase.firestore.Transaction.set(com.google.firebase:firebase-firestore@@19.0.0:70)
E/AndroidRuntime(30707): 	at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$7.doInBackground(CloudFirestorePlugin.java:517)
E/AndroidRuntime(30707): 	at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$7.doInBackground(CloudFirestorePlugin.java:512)
E/AndroidRuntime(30707): 	at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime(30707): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(30707): 	... 4 more
W/OPDiagnose(30707): getService:OPDiagnoseService NULL
D/OSTracker(30707): OS Event: crash
V/FA      (30707): Recording user engagement, ms: 3135
D/AbstractTracker(30707): Event success
I/Process (30707): Sending signal. PID: 30707 SIG: 9
Lost connection to device.
Exited (sigterm)
@sergiuiacob1
Copy link
Author

Also, if a transaction simply runs out of time, the app crashes, even though the runTransaction() function is inside a try - catch block.

@BondarenkoStas
Copy link

@sergiuiacob1 is it the same with cloud_firestore 0.12.9+4 and current flutter stable?

@BondarenkoStas BondarenkoStas added p: cloud_firestore Firebase Firestore plugin plugin waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Oct 4, 2019
@kroikie kroikie closed this as completed Oct 13, 2019
@kroikie
Copy link

kroikie commented Oct 13, 2019

@sergiuiacob1

This issue has been moved to firebase/flutterfire#1223. Any further collaboration will be done there.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: cloud_firestore Firebase Firestore plugin package flutter/packages repository. See also p: labels. waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

3 participants