Realms.Exceptions.RealmException: Keychain returned unexpected status code

Hi! I install nuget Realm10.0.0.beta1

when code run on:

var app = App.Create("realmmongoapp-ywehx");

I have this exception:

Realms.Exceptions.RealmException: Keychain returned unexpected status code: -25293
   at Realms.NativeException.ThrowIfNecessary(Func`2 overrider)
   at Realms.Sync.AppHandle.CreateApp(AppConfiguration config, Byte[] encryptionKey)
   at Realms.Sync.App.Create(AppConfiguration config)
   at Realms.Sync.App.Create(String appId)

Can you help me?

What platform are you running this on?

Visual Studio for Mac 8.7.8

I’m sorry, I meant what is the platform that you’re targeting (running the app on). Are you building a Xamarin.iOS project running it on a simulator/actual device, or are you running a .NET Core app, targeting your Mac?

Oh, sorry.
I’m running a .NET Core web-app

Hm… I’m failing to reproduce it so far, but will keep trying. In the meantime, can you try setting MetadataPersistenceMode on the realm config to NotEncrypted:

var config = new AppConfiguration("realmmongoapp-ywehx")
{
    MetadataPersistenceMode = MetadataPersistenceMode.NotEncrypted
};

var app = App.Create(config);

Now it’s ok, thanks!

Thanks, now it’s ok, but I have this error on loginAsync:

        var configApp = new AppConfiguration("realmmongoapp-ywehx")
        {
            MetadataPersistenceMode = MetadataPersistenceMode.NotEncrypted
        };
        var app = App.Create("realmmongoapp-ywehx");
        var user = await app.LogInAsync(Credentials.Anonymous());

Realms.Sync.Exceptions.AppException: InvalidSession: authentication via ‘anon-user’ is unsupported
at Realms.Sync.App.LogInAsync(Credentials credentials)

I have enabled anonymous user on console.

Did you deploy the draft after enabling anonymous authentication?

When I have enabled anonymous authentication, it works fine!

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