Flutter Realm auth not working


I’m trying by following the docs to register and then login with realm.
Unfortunatly I got an error “Realm Exception : non-zero custom status code considered fatal” when trying to do :
authProvider.registerUser(email, password)
or :

I created a repo to reproduce here :

You will just need a mongodb free tier account with an empty app and email/password auth enabled (with no confirm email and default reset function)

I’m new to both flutter and realm so the solution may be very simple, please help me !


EDIT : You can look inside these 2 files and look for the _handleSubmitted function.


most probably you are missing network entitlements in your app and it fails on Mac. Could you check you have added these or try running the app on another platform

Thanks for the answer !

I already added this on the android manifest :

<uses-permission android:name="android.permission.INTERNET" />

Did I miss anything else ?

I thought about that so I tried to make a simple http request and it did work.

Thanks for your help !

Just tried running on IOS and it didn’t work too :confused:

Hi again !

Managed to make it work by using another appId found in one of your samble here :

Still not working with my own very simple near-empty realm app.
[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: RealmException: non-zero custom status code considered fatal

Do I need to do anything else beside creating an app (in mongodb) before starting to work ?

I wasn’t able to reproduce your issue with the sample app you provided. I created an empty app on the server and enabled the email auth provider there. Then when I try to login I get invalid username/password error which is understandable since I don’t have any users on the server.
On the server make sure you have “deployed” your app changes and not only “saved” them.

Since you have been able to make this app work with different server app this seems an environment or configuration issue and not Realm issue itself.

I just finally got the solution !

By reading in details the doc, I saw that you cannot choose the GCP as a deployment region for app service, but my atlas cluster is in GCP, so by default when you create an app on app service, it will be on GCP and nothing (or at least user auth) will work.

IMHO, it’s a very annoying bug as you cannot debug anything and the error you will get mean nothing.

Have a nice day :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.