Skip to content

[FR] Better debug message when sign-in method is not enabled from Firebase console #38

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

Open
personalnadir opened this issue Jul 28, 2021 · 2 comments

Comments

@personalnadir
Copy link

personalnadir commented Jul 28, 2021

I am seeing a consistent errors when trying to create or sign in users in the Unity Editor and on iOS device (Android not attempted yet). Both CreateUserWithEmailAndPasswordAsync and SignInWithEmailAndPasswordAsync throw errors caused by internal errors.

No doubt I am doing something wrong, but I'm struggling to dig out what the underlying issues are.

The bug report as such is that the exceptions should contain more detail of the fault so that developers can fix the issues

CreateUserWithEmailAndPasswordAsync encountered an error: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred.
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred.
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Firebase.FirebaseException: An internal error has occurred.<---
<---

 #0 GetStacktrace(int)
 #1 DebugStringToFile(DebugStringToFileData const&)
 #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
 #3  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
 #4  (Mono JIT Code) [Z:\tmp\tmp.SQ3tdXfbub\firebase\app\client\unity\src\Platform\ExceptionAggregator.cs:113] Firebase.ExceptionAggregator:Wrap (System.Action)
 #5  (Mono JIT Code) [Z:\tmp\tmp.SQ3tdXfbub\firebase\app\client\unity\src\Platform\Dispatcher.cs:123] Firebase.Dispatcher:PollJobs ()
 #6  (Mono JIT Code) [Z:\tmp\tmp.SQ3tdXfbub\firebase\app\client\unity\src\Unity\FirebaseHandler.cs:208] Firebase.Platform.FirebaseHandler:Update ()
 #7 mono_jit_runtime_invoke
 #8 do_runtime_invoke
 #9 mono_runtime_invoke
 #10 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
 #11 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
 #12 MonoBehaviour::CallMethodIfAvailable(int)
 #13 MonoBehaviour::CallUpdateMethod(int)
 #14 void BaseBehaviourManager::CommonUpdate<BehaviourManager>()
 #15 BehaviourManager::Update()
 #16 InitPlayerLoopCallbacks()::UpdateScriptRunBehaviourUpdateRegistrator::Forward()
 #17 ExecutePlayerLoop(NativePlayerLoopSystem*)

SignInWithEmailAndPasswordAsync:

SignInWithEmailAndPasswordAsync encountered an error: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred.
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred.
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Firebase.FirebaseException: An internal error has occurred.<---
<---

 #0 GetStacktrace(int)
 #1 DebugStringToFile(DebugStringToFileData const&)
 #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
 #3  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
 #4  (Mono JIT Code) [Z:\tmp\tmp.5N3Xss3REC\firebase\app\client\unity\task-extension\TaskExtension.cs:128] Firebase.Extensions.TaskExtension/<ContinueWithOnMainThread>c__AnonStorey8`1/<ContinueWithOnMainThread>c__AnonStorey9<T_REF>:<>m__0 ()
 #5  (Mono JIT Code) [Z:\tmp\tmp.SQ3tdXfbub\firebase\app\client\unity\src\Platform\ExceptionAggregator.cs:113] Firebase.ExceptionAggregator:Wrap (System.Action)
 #6  (Mono JIT Code) [Z:\tmp\tmp.SQ3tdXfbub\firebase\app\client\unity\src\Platform\Dispatcher.cs:123] Firebase.Dispatcher:PollJobs ()
 #7  (Mono JIT Code) [Z:\tmp\tmp.SQ3tdXfbub\firebase\app\client\unity\src\Unity\FirebaseHandler.cs:208] Firebase.Platform.FirebaseHandler:Update ()
 #8 mono_jit_runtime_invoke
 #9 do_runtime_invoke
 #10 mono_runtime_invoke
 #11 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
 #12 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
 #13 MonoBehaviour::CallMethodIfAvailable(int)
 #14 MonoBehaviour::CallUpdateMethod(int)
 #15 void BaseBehaviourManager::CommonUpdate<BehaviourManager>()
 #16 BehaviourManager::Update()
 #17 InitPlayerLoopCallbacks()::UpdateScriptRunBehaviourUpdateRegistrator::Forward()
 #18 ExecutePlayerLoop(NativePlayerLoopSystem*)
 #19 ExecutePlayerLoop(NativePlayerLoopSystem*)
 #20 PlayerLoop()
 #21 PlayerLoopController::UpdateScene(bool)
 #22 PlayerLoopController::UpdateSceneIfNeeded()
 #23 Application::TickTimer()
 #24 -[EditorApplication TickTimer]
 #25 __NSFireTimer
 #26 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
 #27 __CFRunLoopDoTimer
 #28 __CFRunLoopDoTimers
 #29 __CFRunLoopRun
 #30 CFRunLoopRunSpecific
 #31 RunCurrentEventLoopInMode
 #32 ReceiveNextEventCommon
 #33 _BlockUntilNextEventMatchingListInModeWithFilter
 #34 _DPSNextEvent
 #35 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
 #36 -[NSApplication run]
 #37 NSApplicationMain
 #38 EditorMain(int, char const**)
 #39 main
 #40 start

@personalnadir
Copy link
Author

It turns out the issue was that e-mail authentication was not enabled on the Firebase console. That sounds daft, but it was not mentioned in the authentication start guide or the documentation:
https://firebase.google.com/docs/auth/unity/start

https://firebase.google.com/docs/reference/unity/class/firebase/auth/firebase-auth#class_firebase_1_1_auth_1_1_firebase_auth_1a0490b9393cdad6ec8632769fcf3254cd

The auth SDK should report if the authentication method has not be switched on in the console, instead of generating an internal error.

@chkuang-g
Copy link
Contributor

chkuang-g commented Jun 17, 2022

@personalnadir

Thank you for reporting this. I will change this into a FR for better debugging message. Also modify the title a bit.

TL;DR; When a certain sign-in method was not enabled in Firebase console, instead of throwing an Firebase.FirebaseException: An internal error has occurred, the exception should provide more context for the developer to act upon.

This might need some change in iOS/Android SDK level as well. Need to investigate a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants