NullReferenceException
truegoodwill opened this issue · 1 comments
truegoodwill commented
This was found in my Orleans log. I'm guessing this happened because the collection was not already present in the db?
fail: Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage[102202]
Error from storage provider MongoGrainStorage.Orleans.Streams.PubSubRendezvousGrain during ReadState for grain Type=Orleans.Streams.PubSubRendezvousGrain Pk=*grn/716E8E94/0057c0be-1193-4837-a51a-83d1a74cac95+ORLEANS_SIGNALR_STREAM_PROVIDER_SERVERS_STREAM-0x5B52D524 Id=GrainReference:*grn/716E8E94/0057c0be-1193-4837-a51a-83d1a74cac95+ORLEANS_SIGNALR_STREAM_PROVIDER_SERVERS_STREAM Error=
Exc level 0: System.NullReferenceException: Object reference not set to an instance of an object.
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.GetCollection(String grainType)
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.<>c__DisplayClass19_0.<<ReadStateAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.<>c__DisplayClass23_0.<<DoAndLog>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.DoAndLog[T](String actionName, Func`1 action)
at Orleans.Core.StateStorageBridge`1.ReadStateAsync()
System.NullReferenceException: Object reference not set to an instance of an object.
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.GetCollection(String grainType)
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.<>c__DisplayClass19_0.<<ReadStateAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.<>c__DisplayClass23_0.<<DoAndLog>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Orleans.Providers.MongoDB.StorageProviders.MongoGrainStorage.DoAndLog[T](String actionName, Func`1 action)
at Orleans.Core.StateStorageBridge`1.ReadStateAsync()
Configuration:
.UseMongoDBClient(mongoOptions.ConnectionString)
.UseMongoDBClustering(options =>
{
options.DatabaseName = $"{mongoOptions.DBNamePrefix}-Clustering";
options.Strategy = MongoDBMembershipStrategy.SingleDocument;
})
.UseMongoDBReminders(options =>
{
options.DatabaseName = $"{mongoOptions.DBNamePrefix}-Reminders";
})
.AddMongoDBGrainStorage("default", optionsBuilder => optionsBuilder.Configure(options =>
{
options.DatabaseName = $"{mongoOptions.DBNamePrefix}-DefaultStorage";
options.ConfigureJsonSerializerSettings = serializerSettings =>
{
serializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Include;
serializerSettings.ObjectCreationHandling = Newtonsoft.Json.ObjectCreationHandling.Replace;
serializerSettings.DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Populate;
serializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
serializerSettings.Converters.Add(DirectionConverterForNewtonsoft.Instance);
};
}))
.AddMongoDBGrainStorage("PubSubStore", options =>
{
options.DatabaseName = $"{mongoOptions.DBNamePrefix}-PubSubStore";
options.ConfigureJsonSerializerSettings = serializerSettings =>
{
serializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Include;
serializerSettings.ObjectCreationHandling = Newtonsoft.Json.ObjectCreationHandling.Replace;
serializerSettings.DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Populate;
serializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
serializerSettings.Converters.Add(DirectionConverterForNewtonsoft.Instance);
};
})
.AddSimpleMessageStreamProvider(Streams.StreamProvider, options =>
{
options.FireAndForgetDelivery = true;
options.OptimizeForImmutableData = true;
options.PubSubType = Orleans.Streams.StreamPubSubType.ExplicitGrainBasedOnly;
})
SebastianStehle commented
I added a very simple streaming scenario, but I cannot reproduce it.